Skills
Anthropic Context Engineering Cookbook: Compaction, Tool-Result Clearing, and Structured Memory Primitives for Long-Running Agents
Anthropic published a practical cookbook entry detailing three context management primitives: compaction (distilling context windows into high-fidelity summaries when conversations get long), tool-result clearing (dropping old re-fetchable results while keeping the record that calls happened — the 'safest lightest touch form of compaction'), and structured memory (agent writes to persistent external storage for cross-session progress tracking). Compaction uses the beta tag 'compact-2026-01-12' with configurable input token thresholds. For builders: these are the three levers you have for agents that run beyond 200K tokens — implement all three in your agent harness.
↳ Follow the thread