Add Compact Instructions to CLAUDE.md so every /compact keeps what matters
Declare a Compact Instructions section in CLAUDE.md so both manual /compact and autocompact preserve the project’s critical decisions by default.
The problem
Steering `/compact focus on …` works once, but autocompact still fires later with generic criteria and drops the constraints you always need.
The hack
Add a `## Compact Instructions` section to CLAUDE.md listing what must survive (active goal, open decisions, failing tests) and what to drop (rabbit holes, resolved debugging).
Why it works
Community playbooks and Anthropic’s compaction model: CLAUDE.md guidance applies to every compaction, including auto — project defaults beat one-off focus strings.
Setup
1. Open CLAUDE.md and add a short Compact Instructions section. 2. List must-keep items (current goal, API contracts, failing tests) and safe-to-drop noise. 3. During a long session, run `/compact` or wait for autocompact. 4. Confirm critical constraints still present via `/btw` or a quick probe question.
Discussion
No comments yet. Be the first to say whether this worked for you.