Finding the session where you solved it

search by the token you remember, not the topic you half-remember

You fixed it. You remember the error, roughly. You do not remember whether it was Claude Code or Codex, which project it was under, or whether it was three weeks or three months ago — and the harness's own history list is a wall of titles, in one tool, in reverse order. Nothing on the machine lets you search chat history across all of them at once.

Search by the most specific thing you remember

Not the topic — the token. An exact error string, a function name, a file path, a flag. Those survive in a transcript verbatim, and they are what separates the session you want from forty that discuss the same subject:

$ deja "connection pool exhausted"
[claude] api   · Jul 8 · 8f31c0a9 — 2 matches
  login started failing after refresh token rotation; jwt kid mismatch in tests
  fixed by reloading jwks cache after rotateKey and adding a clock-skew test
[codex]  web   · Jul 1 · b77d91e2 — 1 match
  refresh token cookie needed SameSite=Lax in local callback flow

Several words are ANDed, quotes require the exact phrase, and when nothing matches exactly the search falls back to word forms and close spellings rather than returning nothing. The harness column matters more than it looks: the session you want is often in the tool you were not thinking of.

Narrowing without guessing

  • --harness claude, --project api-gateway — when you are sure, and only then.
  • --since 30d — a hard filter. A date inside the query is the softer version: it weighs recent sessions up without hiding older ones, because "I think it was in spring" is a hint and should not throw away the answer if it was April.
  • --role user — search only what you typed, which is a good filter when you remember your own words but not the answer.
  • deja last 20 --project api — no query at all, just the recent sessions in one project.

Reading it, then continuing it

A hit gives you a session id. Two things to do with it:

deja show 8f31c0a9      # read the session
deja ctx  8f31c0a9      # a Markdown digest to paste into whatever you are doing now
deja resume 8f31c0a9    # reopen it in the agent that ran it

resume hands the id back to the harness that owns the session, with the project directory where that harness scopes its list to one. It works for fifteen of the twenty harnesses deja reads — Claude Code, Codex, Cursor, opencode, Gemini CLI, Cline, Copilot, Goose, Kimi, Qwen, pi, omp, OpenClaw, Antigravity and Hermes. The remaining five — aider, Grok Build, Roo Code, DeepSeek Harness and Zed — have no resume path of their own, and deja says so rather than pretending.

Ids are matched by prefix, so the eight characters a result prints are enough to type.

When the answer is a command rather than a session

Often what you actually want is not the conversation but one line out of it:

deja how "docker compose up"    # the invocation this project really uses
deja fix "pq: too many connections"   # what was run after that error, where it stayed fixed
deja blame path/to/file.go      # which sessions decided what about this file

Those skip the reading step entirely.

Where the transcripts live · How search and ranking work · When the session was in another agent