The context window is full

compaction is not the only answer, and it is the lossy one

The warning arrives in the middle of something: the window is nearly full, and the agent offers to compact. You say yes because the alternative is starting over, and the session continues in a thinner version of itself.

What the summary keeps, and what it drops

Measured over 43 real compactions in this repository's own history: the summary retained 77% of the decisions and 0.2% of the commands that had actually been run. The reasoning survives because it is prose. The invocation with the flags that worked, the exact error text, the span an edit replaced — those are the parts a summary treats as noise, and they are the parts you cannot reconstruct from memory.

So the window being full is not really the problem. The problem is that the fix is lossy in a direction nobody chooses on purpose.

Keeping the window small on purpose

deja install --auto

The alternative to carrying everything in context is fetching the part you need when you need it. Recall arrives at session start, on each prompt, before an edit or a command, and after a command fails — each one bounded: an injection is capped at 1,536 bytes per prompt and about 4 KB per tool call. That is a fixed, small cost against a window that otherwise grows until it breaks. What memory costs has the measurement.

After it has already compacted

deja ctx "what we were doing"

The pre-compaction turns are still on disk in full — compaction rewrites the agent's context, not its transcript. deja reads the transcript, so the commands and errors the summary dropped are still searchable, and getting them back is one query.

Why not a bigger window

A larger window moves the wall without removing it, and every token in context is paid on every turn of the session. A 5 GB history searched in under a millisecond and returned as a 1.5 KB digest is a different shape of answer than a 200k-token window that holds the same history and charges for it continuously.

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: no model, no embeddings, nothing leaves the machine (privacy).

Getting started · What memory costs · What compaction drops