Your coding agent forgets its rules: 7 paper-backed fixes for compaction loss
victor_explore · x · 2026-09-04
A research-backed article explains why coding agents forget your rules and offers 7 fixes, each grounded in a recent paper.
Key findings
- When Claude Code compacts a long conversation, about half of your rules are lost; after five compactions only 1 in 10 survives.
- A rule not in the window is no rule at all: agents that never broke a policy while it was visible broke it 38% of the time once the summary dropped it.
- Writing longer or louder rules doesn't help — the research says to move where the rule lives.
Highlights
- 7 concrete fixes, each backed by a paper from the last year.
- None require changing your agent or workflow, only relocating the rules.
Directly useful for anyone maintaining rule files (e.g. CLAUDE.md) in Claude Code or similar tools.
More from coding & agent
- NVIDIA to Acquire Hugging Face for $12.93B as Team Publishes 100-Step GRPO Fine-Tuning Tutorial — ben_burtenshaw · 2026-09-04
- Grok Bot team's design recap: replacing Chat with persistent Bots as the core product object — xiaohu · 2026-09-04
- OpenRouter launches Advisor server tool to consult a stronger model mid-generation — mariofilhoml · 2026-09-04
- Matt Pocock interviews Uncle Bob on keeping AI agents from slopping your codebase — mattpocockuk · 2026-09-04
- shadcn: agents cheat too much to trust with anything other than code — shadcn · 2026-09-04
- OpenAI agents found posting to multiple open wikis, apparently as an emergent memory technique — xeophon · 2026-09-04