The agent lost the context you had
a crash, a clear, a reconnect — the work is still on disk
It happens mid-task, not between tasks: the window is cleared, the CLI is restarted, a session is resumed and comes back empty, the tab is closed by something that is not you. The agent is now confidently a stranger to work you did an hour ago.
The context is not gone, the pointer to it is
Almost every coding agent writes each turn to disk as it happens — forty-one tools, one on-disk format each. What a crash or a clear destroys is the model's working set, not the transcript. The file is still sitting under ~/.claude/projects, ~/.codex/sessions, ~/.qwen/projects or wherever your agent keeps it, with the decision you now cannot recall.
Getting it back into the session you are in
deja wip deja "the thing you were doing"
deja wip answers the first question a stranded session has — what was I doing — from the last session's own transcript in this directory: the task, what it settled, the files in flight, the last command and whether it failed. Nothing was stored for it; it is derived each time.
Search runs over every agent's history on the machine, so it does not matter which tool held the lost context — or whether that tool still exists. deja ctx <query> gives the single best-matching session as a digest rather than a wall of transcript, which is what you want to paste back into a fresh window.
If the tool you lost supports it, deja resume <id> prints the exact command that reopens that conversation, in the directory it belongs to — thirty-five of the forty-one do. Bare deja opens a screen that starts on the sessions behind your uncommitted change, which is usually the one you lost: r reopens it, or o hands what it asked, settled and left open to whichever agent you pick.
Not losing it the next time
deja install --auto
After this the recovery is not a thing you have to think of. Recall arrives at session start, so a fresh window opens already knowing the project's recent decisions; on each prompt, so a question about old work is answered from the transcript instead of from a guess; and on every agent with a compaction event deja hooks (Claude Code, Codex, Qwen, Kimi, Grok, Cursor CLI, opencode, pi and the rest) the working context is captured as a compaction starts and handed back once afterwards. A cleared window costs a paragraph of context rather than an afternoon.
What it cannot do
Anything the agent never wrote down is not recoverable, and deja does not pretend otherwise: it indexes the files, it does not reconstruct what was in the model's head. Sessions that were never flushed to disk before the crash — some tools write on turn boundaries, not on every token — lose their last turn. That last turn is usually the one you remember anyway.
The part that is not about this
The index covers every agent's transcripts on the machine — each in its own format — including sessions from before deja was installed. Indexing and search are local: BM25 over the transcripts, no model needed (embeddings are optional, through deja embed), credentials stripped as the index is built (privacy).
Getting started · Finding a session · What compaction drops
Found this useful? Star deja-vu on GitHub.