Back to blog

Compaction drift is the new bottleneck

Long agent sessions compact away the reasoning that keeps the plan stable. This post unpacks why drift happens and how to preserve intent when the window tightens.

When context turns into summaries

Long CLI sessions accumulate code, configs, and exploration notes. As the window fills, compaction compresses earlier reasoning into brief summaries that omit why decisions were made, leaving only the outcome.

Why intent gets lost

Compaction keeps outputs but drops constraints, tradeoffs, and edge cases. Agents then propose changes that violate earlier decisions or reopen settled paths, which shows up as rework rather than a single wrong answer.

A practical way to fight drift

Move raw code out of the prompt and into local retrieval. With an on-device index and MCP tools, you can rehydrate precise slices on demand so tokens stay reserved for intent, constraints, and next steps.