Search docs: sessions, prompts and archived tool output

The gateway saves each turn of your Claude Code and Codex sessions as it passes. You search them in the console. Your agent searches the same store with context-mode-search, and reads archived tool output back byte for byte, except secrets and e-mail addresses, which are masked before storage.

Key facts

What it is
A search over the prompts, commands and tool output that passed through the gateway, in the console and as a tool for your agent.
Who it is for
Developers who need an old fix, command or output from any session or machine.
Clients
Claude Code and Codex, in one history. Search covers archived tool output, and search over past prompts comes with Memory.
Measured result
Not a cost feature, and not measured on its own. For the gateway as a whole, see Benchmarks.
Limits
The console searches the first 4,000 characters of each tool result; the agent can read the full output. Stored prompts have no automatic expiry yet.

What is saved

Each request carries the conversation. The gateway appends the new turns to your account's store, grouped by workspace (a project and a worktree) and by session. Claude Code and Codex turns go to the same store. Client preamble, such as Codex's environment block, is stripped first.

textyour messages and the agent's replies, the first 6,000 characters of each block
commandseach tool call with its name and full input
tool resultsthe first 4,000 characters in the turn; when the gateway shortens a result, the full output goes to the archive first

Sessions from before you connected the gateway are not in the store.

Search in the console

Open Search in the sidebar at console.context-mode.com. Type at least 2 characters.

To open a session again in your terminal, see Session resume.

The agent's search tool

The gateway adds context-mode-search to the tools of Claude Code and Codex requests and answers the call itself. Nothing runs on your machine. The tool has two modes.

FieldMeaning
qSearch words. Required in both modes.
kHow many matches to return.
docidThe archive id to read, for example from a Context Saving label.
offsetByte offset to start the page at.
limitBytes per page. Default 60,000, maximum 120,000.

A read answers with total_bytes, offset, returned_bytes and next_offset. The agent passes next_offset back until it is null. An id with nothing behind it answers found: false.

When Context Saving shortens a result, the label it leaves names the call to make:

context-mode-search {"q":"full output","docid":"context-mode-toolcap-9f2c1b-184320","offset":0}

How large output is stored

The archive is a SQLite database with a full-text index, one per account. A large output is split into pages of 512,000 characters under one docid. A read crosses pages, so total_bytes and next_offset cover the whole output. The test suite stores 5 MB and reads it back identical. On the deployed gateway, Context Saving labels paged back to the stored output byte for byte.

Masking. Before archived text is stored, the gateway replaces known secret formats with [redacted-secret] and every e-mail address with [redacted-email]. So a git log reads back with its author addresses masked. This keeps secrets out of the archive.

Who can read it

Compared with local history

ToolWhere the history lives
Claude CodeA JSONL file per session under ~/.claude/projects, on the machine that ran it. claude --resume picks from those files.
CodexA rollout file under ~/.codex/sessions, on the machine that ran it. codex resume opens it.
claude-mem and similar pluginsA database on your own machine.
Context ModeThe gateway, per account. Every machine and both clients in one search, and the agent reads the same archive.

Limits

FAQ

Can I search sessions that ran on another machine?

Yes. The history is kept at the gateway, so every machine and both clients share it.

Can my agent search it too?

Yes, with the context-mode-search tool. It reads archived tool output back byte for byte, except secrets and e-mail addresses, which are masked before storage.

Is anything masked?

Yes. Secrets and e-mail addresses are masked before storage.

Compared with other tools: see the landscape.