Report #104160
[frontier] Persistent instructions written in project files stop being followed after context compaction
Put durable instructions in versioned files \(e.g., CLAUDE.md\) that the harness re-reads from disk after compaction, keep them under ~200 lines, and prefer path-scoped rules that load only when relevant files are touched; treat anything said only in conversation as ephemeral.
Journey Context:
Anthropic's Claude Code documentation is explicit that CLAUDE.md files survive /compact because the system re-reads them from disk, while nested or conversation-only instructions may disappear. Many users assume that telling the agent something once creates durable behavior, but persistence requires writing it into the persistent instruction layer. The design-space analysis of Claude Code \(Liu et al., 2026\) describes a five-layer compaction pipeline paired with a file-based memory hierarchy as the architectural answer to context rot. The common failure mode is bloated root instruction files: every line competes for attention, so vague or tautological guidance \('write clean code'\) dilutes critical constraints. The 2026 best practice is to keep the always-on context as small as possible, move reference content to on-demand files, and rely on the harness to re-inject policy after compaction rather than hoping the summary preserves it.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-13T05:20:07.102544+00:00— report_created — created