WhatBroke

Claude Code says "context left until auto-compact" — what it means

Claude Code Last checked 2026-10-14

It is a fuel gauge, not an error. When the conversation gets close to the limit you set, Claude Code summarises everything so far and keeps going from the summary. Nothing is lost from your files, but detail from earlier in the conversation is. Run /compact yourself at a clean stopping point instead of letting it fire mid-task.

What you saw

Context left until auto-compact: 12%

A percentage counter in the status line that keeps dropping as you work. Sometimes the session pauses and prints something like "Compacting conversation…" and then carries on, noticeably dumber about what you were doing ten minutes ago.

Common follow-on symptom: right after a compact, Claude re-reads files it already read, forgets a decision you made, or re-introduces a bug you just fixed.

What it actually means

Claude Code holds your whole session — your messages, its replies, every file it read and every command output — in one context window. That window has a size limit.

Auto-compact is the safety valve. Rather than hard-failing when the window fills, Claude Code writes a summary of the conversation so far and restarts from that summary. The session survives; the fine detail does not.

So the counter is telling you how much working memory is left before that lossy summarisation happens. Low context does not mean you are doing anything wrong. Reading large files, long test output and long agent runs all burn it fast.

The danger is not the compaction itself — it is compaction happening *in the middle of a multi-step task*, so the half of the plan that was still in its head gets compressed into one sentence.

The fix

  1. Finish the current step first. Do not start a new task at low context.

  2. Compact deliberately, at a clean boundary, with instructions about what to keep:

    /compact Keep the migration plan, the schema decisions, and the list of files already updated. Drop the test output.
  3. If what you are doing is genuinely a new task, start a fresh session instead of compacting. /clear gives you a clean window with no summarisation loss at all.

  4. Before compacting or clearing, have Claude write the state down somewhere durable — a file is memory that survives any context event:

    Write the current plan, what is done, what is left, and the key decisions to NOTES.md before we compact.
  5. If you hit this constantly, raise the window with /autocompact (requires Claude Code v2.1.221 or later). Pass a size such as 500k, or auto to go back to the default tuned for your model.

    /autocompact 500k

How to stop it happening again

Keep a NOTES.md or PLAN.md in the repo and tell Claude to update it as it works. Files survive compaction; conversation does not. This single habit removes most of the pain.

Do not paste huge files into chat. Let Claude read the specific file it needs, when it needs it.

One session, one task. Long-running sessions that drift across three unrelated jobs are the ones that compact at the worst moment.

Put permanent project context — stack, conventions, commands, things never to touch — in CLAUDE.md. That gets re-read, so it is not lost when the conversation is summarised.

Treat the counter like fuel: below about 20%, stop starting new things.

Related questions

Does auto-compact delete my code?

No. Compaction only affects the conversation history held in context. Your files on disk are untouched.

Should I turn auto-compact off?

Usually no. Without it, a full context window ends the session abruptly. Setting a larger window with /autocompact is the better lever than disabling the safety valve.

Why does Claude re-read files after compacting?

Because the file contents were part of the conversation that just got summarised. Re-reading is correct behaviour — it is rebuilding what it lost.

What is the difference between /compact and /clear?

/compact summarises the conversation and continues with that summary. /clear throws the conversation away entirely and starts fresh. Use /compact to continue the same task, /clear to start a different one.

Other things that break

What Broke This Week

One email, most Thursdays. New symptoms, tool updates that quietly break things, and one fix worth stealing. Unsubscribe in one click.