Use case

# We fixed this bug last week. Which session was it? *Find it in one search.*

Context Mode saves each prompt, command and tool output as it passes, from every machine and both clients. You search it in the console. Your agent searches it too and reads old output back in full.

[Get started free](https://console.context-mode.com/login) [Read the docs](https://context-mode.com/docs/search)

Find it

Local files Console Agent search Full output Secrets

We fixed the staging deploy last week. How?

Claude Code

- A JSONL file per session
- under ~/.claude/projects
- on the machine that ran it

Codex

- A rollout file
- under ~/.codex/sessions
- on the machine that ran it

Two folders per laptop. The fix from your other machine is not there.

We fixed the staging deploy last week. How?

```
Search: staging deploy

last week · web
“The staging deploy fails. Can you fix it?”

last week · web
$ ./scripts/deploy.sh --env=staging
```

Every workspace, every machine, both clients. Click a hit to read the turns around it.

Your agent searches before it asks you.

```
context-mode-search {"q":"deploy staging"}

// best matches first,
// each with a short snippet
```

The tool tells it to search before it runs a command again only to see an old result.

A snippet is not enough. The agent reads it all.

```
context-mode-search {
  "q":"full output",
  "docid":"…-184320",
  "offset":0}
```

The whole old output, page by page, as it was stored.

The old output had author e-mails in it.

```
$ git log -2
Author: dev <[redacted-email]>
Author: ops <[redacted-email]>
```

Masked before storage. Known secret formats become [redacted-secret], and e-mail addresses become [redacted-email].

The problem

## The fix is somewhere. *Not where you look.*

**History stays on one laptop**

Claude Code keeps a JSONL file per session under `~/.claude/projects`. Codex keeps its own files under `~/.codex/sessions`. Each on the machine that ran it.

**You remember a word, not a session**

You know it was "staging" and "deploy". You do not know which session, which project or which day.

**The agent runs it all again**

Without the old output, your agent runs the same command again to see a result it already had.

How it works

## Saved as you work. *Found when you need it.*

1. 01 **Work as usual** The gateway saves each turn as it passes: your messages, each tool call with its full input, and tool results. Before storage, it masks known secret formats and e-mail addresses.
2. 02 **Type a word** Open [Search](https://context-mode.com/search) in the console. You get each matching exchange with its project and date, from every workspace in your account.
3. 03 **Your agent reads it back** The agent calls `context-mode-search` with words, or with a docid to read the archived output byte for byte, one page at a time.

Search over past prompts needs [Memory](https://context-mode.com/memory) on. Tool output stays searchable with Memory off. The console searches the first 4,000 characters of each tool result; your agent can read the full output.

Context Mode masks secrets only in what it saves to your archive. You and your agent search the same archive.

Proof

## Read back as stored. *Secrets left out.*

**Byte for byte** the test suite stores 5 MB and reads it back identical **Both clients** Claude Code and Codex turns go to the same store **[redacted-secret]** known secret formats are replaced before storage

From the Search docs. Search is not a cost feature and is not measured on its own; for the gateway as a whole, see the [benchmarks](https://context-mode.com/docs/benchmarks). [How output is stored →](https://context-mode.com/docs/search#storage)

Where it lives

## One search. *Not one folder per laptop.*

| History | Context Mode | Local files |
| --- | --- | --- |
| Where it is | The gateway, per account | `~/.claude/projects` or `~/.codex/sessions` , on one machine |
| What you search | Every machine and both clients | One machine, one client |
| How you find it | You search in the console, and your agent searches with a tool | You pick a session with `claude --resume` or open one with `codex resume` |

Sessions from before you connect the gateway are not in the store. [The full comparison →](https://context-mode.com/docs/search#compared)

Products used

## What this *uses.*

**[Search](https://context-mode.com/search)**

Every prompt, command and tool output, from every agent and machine, in one search.

**[Search docs](https://context-mode.com/docs/search)**

What is saved, the tool's fields, how large output is stored, and the limits.

**[Session resume](https://context-mode.com/session-resume)**

Found the session? Open it again in your terminal on any machine.

**Related**

[An all-day session](https://context-mode.com/use-cases/all-day-session), [long sessions](https://context-mode.com/solutions/long-sessions) and [Context Mode for developers](https://context-mode.com/solutions/developers).

## Every session, one search. *Starting today.*

*npx @context-mode/cli* connects your agents. 1,000 requests free, no card.

[Get started free →](https://console.context-mode.com/login) [Read the docs →](https://context-mode.com/docs/search)
