Skills
Set the agent's auto-compaction threshold below the default and compact at task boundaries, not at capacity
Coding agents trigger automatic compaction near 83–95% of the context window, which is inside the degradation zone and can cascade into repeated re-compaction that doubles token spend. Set Codex CLI's `model_auto_compact_token_limit = 160000` (≈80% of a 200K window), use Claude Code's `/compact focus on <X>` to control what survives, and verify the effective threshold with `/status` since v0.100+ silently clamps custom limits to 90%. OpenCode protects the most recent 40K tokens and only prunes after 20K freed — mirror that by compacting at logical feature boundaries where summaries are cleanest.
↳ Follow the thread