Context compaction

Summarizing a long agent session so it fits the context window again, keeping the decisions and dropping the detail.

Updated November 23, 2026

When a session grows long, agents such as Claude Code and Codex can compact it: the conversation so far is replaced by a summary, and work continues with room to spare. Many agents do this automatically near the limit, and offer a /compact command to do it on purpose.

Compaction loses detail by design, so anything that must survive (a decision, a constraint) belongs in an instructions file rather than in the chat.