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.

Find it

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. 01Work 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. 02Type a word

    Open Search in the console. You get each matching exchange with its project and date, from every workspace in your account.

  3. 03Your 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 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.

Your agent sends each request through Context Mode to the model. On the way, Context Mode adds context-mode-search to the tools and saves the turn to your archive, with secrets masked. Later, you search the archive in the console, and your agent searches it with context-mode-search. Your agent any machine, either client Context Mode add context-mode-search to the tools save the turn, secrets masked The model answers as usual Search your archive one store per account context-mode-search you, in the console
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 bytethe test suite stores 5 MB and reads it back identical
Both clientsClaude 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. How output is stored →

Where it lives

One search. Not one folder per laptop.

HistoryContext ModeLocal files
Where it isThe gateway, per account~/.claude/projects or ~/.codex/sessions, on one machine
What you searchEvery machine and both clientsOne machine, one client
How you find itYou search in the console, and your agent searches with a toolYou 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 →

Products used

What this uses.

Search

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

Search docs

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

Session resume

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

Related

An all-day session, long sessions and Context Mode for developers.

Every session, one search. Starting today.

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

Get started free

Your coding agent costs less and remembers your project.

Start free: 1,000 requests, every feature, no card. After you sign in, the console gives you one command to connect Claude Code or Codex.

Read the docs