Claude Code: Auto-compact Now Defaults to 400K

Claude Code: Auto-compact Now Defaults to 400K

Web Development
Claude Code v2.1.334: auto-compact on 1M models drops from ~967K to ~400K tokens

TL;DR: Claude Code 2.1.334 (Dec 1, 2026) lowers the default auto-compact window on most 1M-context models from ~967K to ~400K tokens. Smaller requests mean lower usage and cost, and Anthropic says quality stays the same for most tasks.

What changed

  • Auto-compact now fires near 400K tokens instead of ~967K.
  • Models: Fable, Sonnet 5+, Haiku 5.5, Opus 4.7+.
  • Also covers headless -p runs and the Agent SDK.
  • New Auto-compact window row in /config.
  • Rolling out gradually. It's already on if you use a third-party provider or have telemetry off.

Why it matters

Every turn re-sends the whole conversation. With a 1M window, a long session could carry close to a million tokens per request before anything got compacted. Compacting earlier keeps each request smaller, so long sessions burn far less usage.

Heads up

  • Compaction is lossy: Claude continues from a summary, not the full history.
  • The status line still counts against 1M, so it shows ~37% when compaction fires (~367K). That's expected, not a bug.
  • Still an open question: how very long, complex tasks hold up with the smaller window.

How to control it

  • /autocompact 1m brings back the full ~1M window.
  • /config → Auto-compact window lets you see and change it.
  • CLAUDE_CODE_AUTO_COMPACT_WINDOW=400000 pins the window via env var.
  • CLAUDE_AUTOCOMPACT_PCT_OVERRIDE=50 fires at a % of that window.
  • /compact compacts manually whenever you want.

Sources

Follow @webde for more web dev news.

Report Page