← Back to UsageCut

Why your Claude Code sessions keep hitting compaction

If Claude Code keeps hitting compaction and losing the thread partway through a task, the window is filling faster than the work justifies. The cause is usually not the task size - it is exploration that never leaves context.

The window fills with things you already used

Every turn re-sends the entire conversation so far. That is why cache reads are 93.9% of the billed tokens in measured usage: the model reads the whole history back on each turn. So anything that enters the window stays there, costing space and money for the rest of the session - long after it stopped being useful.

Exploration is the main culprit

The single biggest source of avoidable fill is reads, greps, and Bash output that never lead to an edit. You look at ten files to find the one that matters - and all ten stay in context. On the main thread that exploratory mass is modeled at around 22% of the footprint, and it compounds: it is re-charged as a cache read on every subsequent turn.

The fix is to do the digging somewhere that does not pollute the main window - a subagent that reads everything and hands back a short summary. The main thread keeps the answer, not the search.

The always-on overhead adds up too

Before you type anything, a session already carries fixed weight: the global CLAUDE.md (about 6,344 tokens in the measured setup, much of it conditional), plus the tool schemas of every connected MCP server - including the ones you never call. That is headroom spent before the real work starts.

What actually helps

Compaction is the symptom; the fill is the cause. The durable moves are to offload exploration, slim the always-on header, and let a lossless trimmer collapse bulky output as it appears. Walk through each in how to reduce Claude Code's context window usage, or read cache and compaction explained for the mechanics.

See your own numbers

These are aggregates from real sessions. Your setup is different - run the free scan and get the breakdown for your own Claude Code history. It runs locally; nothing about your code or prompts leaves your machine.

npx usagecutRun a free scan →

NeoMade by Neo

UsageCut by ClockedCode - not affiliated with Anthropic. The figures on this page are measured on real Claude Code sessions and labeled measured or estimated where it matters.