Return less
Clear old tool results
Long sessions keep every earlier tool result in context, and most of it is never read again. Context editing drops stale tool results as the conversation grows, and compaction summarises older turns. Both keep long runs inside the window without starting over.
Where it fits
Context editing and compaction on the Claude API.
/compact and automatic compaction.
Handled by the vendor.
Runs are short.
The setting in each harness
Read on each vendor's own page, linked next to the setting.
| Harness | Setting |
|---|---|
| Claude API and Agent SDK | Beta
|
| OpenAI Responses and Agents SDK |
|
| Pi |
|
| Claude Code | On by default Auto-compaction summarises old turns; |
| Codex | On by default Automatic compaction at the model's default threshold; |
| OpenCode | Compaction: |