Long sessions accumulate two kinds of content: the work itself (code written, decisions made, files changed) and the conversation around the work (clarifications, detours, articles written, things that were discussed and saved elsewhere).
When Claude Code runs /compact — either automatically as context fills, or when you trigger it manually — it summarizes the conversation to free up tokens. By default it treats everything proportionally. That’s a problem if your session mixed implementation work with something else, because the summary will compress both equally. The code state you need for the next hour might get the same weight as a discussion thread that’s already saved to a file.
You can fix this.
Inline Instructions
The /compact command accepts a focus instruction:
/compact Focus on DarJS implementation state — file locations, architecture, test counts, package structure. Deprioritize article writing discussions — those are saved to files.
That tells the compaction exactly what to keep dense and what to summarize loosely. The saved files don’t need to be in the summary at all — they’re recoverable on demand. The implementation state needs to survive because it’s not recoverable from anything other than the session.
Permanent Default via CLAUDE.md
If you always want the same compaction priority for a project, add it to CLAUDE.md:
# Compact instructions
When compacting, preserve: implementation state, file paths, test counts, architecture decisions, phase status. Deprioritize: conversational back-and-forth, writing discussions, content already saved to files in the repo.
This applies to every auto-compact in that project — you don’t have to remember to pass it each time.
What Actually Happens
The compacted summary replaces the active conversation history in context. The original session history isn’t deleted — you can rewind to it. But the running context from that point forward uses the summary, so what survives the compaction is what Claude has available for the rest of the session.
This is why the distinction matters. A session that built eleven phases of a framework has a specific set of facts that need to carry forward: which packages exist, what each file does, what tests are passing, what the architecture decisions were. A session that also discussed bonus articles and wrote response files has a lot of content that doesn’t need to carry forward — it’s all on disk.
Default compaction doesn’t know the difference. You do. The instruction is how you tell it.
The Practical Rule
Before running /compact, ask: what does the next part of this session actually need? Name those things explicitly in the instruction. Everything else can be summarized loosely or dropped — if it matters, it’s in a file.
/compact Focus on [the work]. Deprioritize [the conversation around the work].
Two sentences. Keeps the signal, drops the noise.