Skip to content
OpenAgentsbeta
text
1# Context Compaction
2
3A long task does not fail at the context limit, it degrades well before it. The agent
4starts forgetting decisions it made an hour ago, re-litigates settled questions, and
5re-reads files it already understood. This harness compacts deliberately: it decides
6in advance what must survive, writes a checkpoint that can be resumed cold, and drops
7the rest.
8
9## When to use
10
11- Multi-hour or multi-session tasks: migrations, large refactors, long investigations.
12- Any agent loop that runs until a goal is met rather than for a fixed number of steps.
13- Work that may be interrupted and picked up later, possibly by someone else.
14
15## Install
16
17```bash
18npx openagents-cli add openagents/context-compaction
19```
20
21| Runtime | Installed to |
22|---|---|
23| `claude-code` | `.claude/skills/context-compaction/` |
24| `codex` | `.codex/skills/context-compaction/` |
25| `openai-agents` | `agents/context-compaction/` |
26| `langgraph` | `graphs/context-compaction/` |
27| `generic` | `.openagents/context-compaction/` |
28
29## What is in the package
30
31- `HARNESS.md` - what survives compaction, what does not, and when to trigger it.
32- `templates/checkpoint.md` - the checkpoint format, resumable without the transcript.
33
34## License
35
36MIT
37

Keyboard shortcuts

Focus search
/
Go to Explore
ge
Go to Home
gh
Go to Tags
gt
Go to Collections
gc
Show this help
?
Close suggestions or this dialog
Esc