Auto-compact triggers at ~420K tokens despite Opus having 1M context window — threshold should be configurable
Resolved 💬 4 comments Opened Mar 30, 2026 by tellsgo Closed May 2, 2026
Problem
Claude Code's auto-compact triggers at approximately 420K tokens, even when using Claude Opus (which has a 1M token context window via the API). This means only ~42% of the purchased context window is actually usable before compaction is forced.
The bottom-right status bar shows "0% until auto-compact" at ~419K tokens — far from the 1M limit.
Expected behavior
The auto-compact threshold should either:
- Default to a value much closer to the model's actual context window limit, or
- Be user-configurable via
settings.json(e.g.,autoCompactThreshold: 800000)
Why this matters
- Users paying for Opus specifically for its large context window are not getting what they paid for
- The threshold is not documented anywhere — users discover it by hitting the wall
- There is no knob in
settings.jsonto adjust this behavior (confirmed by reviewing the full settings schema)
Environment
- Claude Code CLI
- Model: Claude Opus (1M context window)
- Observed compact trigger: ~419K–420K tokens
- Platform: Linux
Requested change
Expose autoCompactThreshold (or equivalent) as a configurable field in settings.json, so users can set it closer to the model's actual limit.
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗