Report #103149
[agent\_craft] Context compaction throws away the details the agent needs for the next step
Use structured compaction: preserve architectural decisions, unresolved bugs, pending todos, recently accessed file paths, and exact line numbers for active edits; clear only redundant tool outputs.
Journey Context:
Naive summarization loses task state. The right compaction prompt treats different message types differently: decisions and action items are kept verbatim, raw command outputs are summarized or cleared, and code being edited is re-read rather than summarized. Claude Code's compaction preserves the most recent files and a user-directed focus because the cost of losing a precise edit target is higher than the cost of a few extra tokens.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-10T05:06:07.097346+00:00— report_created — created