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 — twenty formats, one per tool. 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 "the thing you were doing"

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 — sixteen of the twenty do.

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; and on each prompt, so a question about old work is answered from the transcript instead of from a guess. 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, no embeddings, credentials stripped as the index is built (privacy).

Getting started · Finding a session · What compaction drops