conon.ai

conon.ai/Tips

Tell Compaction What To Keep

When a long conversation gets squeezed, the agent decides what survives — and may drop exactly what you needed. One line in CLAUDE.md fixes it forever: 'when compacting, always preserve the list of changed files and my requirements'. Works in every session, no reminders, and /compact accepts the same guidance inline.

ProPROMPTINGClaude Code

Why it works

When a long conversation gets squeezed, the agent decides what survives — and its guess can drop exactly the requirement you stated once, three hours ago. One line in CLAUDE.md turns the guess into an instruction, permanently: every compaction in every session preserves YOUR named essentials. It's the cheapest insurance in the entire toolchain: one sentence, written once.

How to do it

  1. Open CLAUDE.md (or say: 'add this line to CLAUDE.md').
  2. Add the preserve-line naming YOUR essentials: changed files, stated requirements, agreed decisions.
  3. Tune it to your work: data folks add 'the query and its parameters'; writers add 'tone decisions'.
  4. It now applies to every compaction — manual or automatic — without being asked.
  5. For one-off needs, the inline form works too: '/compact keep the file list.'
  6. After the next compaction, verify once: ask about a preserved item; confirm it survived.

Copy this

prompt
Add to CLAUDE.md: "When compacting this conversation, always preserve: the list of files changed so far, my stated requirements, and any decisions we agreed on."

What to watch for

  • The line preserves CATEGORIES, not everything — 'preserve all context' is self-defeating; compaction exists because everything doesn't fit.
  • Long interview sessions and data runs are where the unprotected loss hurts most; if you do those, this line isn't optional.

Sources

Original: conon.aiDocumentation: code.claude.com

Read next

We build and operate the systems behind tips like this one — agents, automations and internal tools, shipped into production. See what the studio does →