claude-code - 💡(How to fix) Fix [Bug] Auto-compact never triggers despite statusline reporting "100% context used" (v2.1.153, Max sub, 200K mode)

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Auto-compact does not trigger on Claude Code v2.1.153 with Max subscription in default 200K context mode. Claude Code's own built-in system statusline (bottom-right of the UI) reports "100% context used", yet no compaction event ever fires and the session continues to grow.

Importantly, this means the client itself recognizes the threshold has been reached, but the trigger action is never invoked.

Root Cause

Suspected root cause

Fix Action

Fix / Workaround

The user-side context indicator (raw % against 200K window) shows ~90%, while the system statusline (relative to usable-space after the ~33K compaction buffer) reads 100% — i.e. the client knows we are past the compaction trigger line and is signaling it on screen, but the actual compaction dispatch never runs.

Based on naming, tengu_compact_cache_prefix appears to introduce a new compaction implementation using prompt-cache prefix instead of a dedicated summarization request. If this new path has a bug in its trigger dispatch (or in detecting the new prefix-based summary completion), it would match the symptoms precisely:

Code Example

[]
RAW_BUFFERClick to expand / collapse

Summary

Auto-compact does not trigger on Claude Code v2.1.153 with Max subscription in default 200K context mode. Claude Code's own built-in system statusline (bottom-right of the UI) reports "100% context used", yet no compaction event ever fires and the session continues to grow.

Importantly, this means the client itself recognizes the threshold has been reached, but the trigger action is never invoked.

Environment

  • Platform: darwin (macOS)
  • Terminal: iTerm.app
  • Claude Code version: 2.1.153
  • Subscription: Max (official OAuth) — NOT API key, NO third-party gateway
  • Model: claude-opus-4-7
  • Context window: 200K (CLAUDE_CODE_DISABLE_1M_CONTEXT=1 is set)
  • Feedback ID: 39674a54-5584-44fa-8656-6fbc7e51ab32

Symptoms

Claude Code's built-in system statusline displays:

100% context used

But auto-compact never fires. Session remains usable; manual /compact works.

The user-side context indicator (raw % against 200K window) shows ~90%, while the system statusline (relative to usable-space after the ~33K compaction buffer) reads 100% — i.e. the client knows we are past the compaction trigger line and is signaling it on screen, but the actual compaction dispatch never runs.

Quantitative Evidence (extracted directly from session transcript .jsonl)

Token usage progression in a single session, monotonically increasing past the expected trigger:

Timestamp (local)Total input (incl. cache)% of 200K
05:45:05173,50186.8%
05:46:16174,35987.2%
05:47:42176,13888.1%
05:48:16179,95090.0%
05:50:14181,53690.8%

Expected: auto-compact should fire around ~83.5% (~167K tokens), well before the system statusline reports "100% context used".

Actual: zero compact_boundary events in the transcript across the entire session, despite the client's own statusline announcing 100%.

Regression marker

The same session length / same model / same subscription would reliably trigger auto-compact in the version immediately prior to v2.1.153. This is a regression, not a long-standing limitation.

Variables I ruled out

  • Local autoCompactEnabled = false — not set anywhere (~/.claude.json, ~/.claude/settings.json, project .claude/settings.json, project .claude/settings.local.json)
  • Local autoCompactPct override — not set
  • Third-party API gateway — ANTHROPIC_BASE_URL is unset in the running process (verified via ps eww <pid>)
  • 1M context window confusion — CLAUDE_CODE_DISABLE_1M_CONTEXT=1, model is 200K
  • SessionStart(compact) hook blocking — hook present but purely advisory; exit code 0
  • File-read-too-large cascading — no MaxFileReadTokenExceededError in this session

Suspected root cause

A GrowthBook flag in my cached features:

  • tengu_compact_cache_prefix = true
  • tengu_hawthorn_window = 200000
  • tengu_hawthorn_steeple = false
  • tengu_post_compact_survey = false

Based on naming, tengu_compact_cache_prefix appears to introduce a new compaction implementation using prompt-cache prefix instead of a dedicated summarization request. If this new path has a bug in its trigger dispatch (or in detecting the new prefix-based summary completion), it would match the symptoms precisely:

  • client correctly identifies the threshold (statusline reports 100%)
  • but the compaction action is never invoked
  • session continues to grow past the buffer line
  • manual /compact still works (presumably uses a different code path)

A server-side flag-rollout regression would also explain why this is not visible in the v2.1.153 client changelog (no compaction-related entries in v2.1.152 / v2.1.153) yet users observe a coincident behavior change.

Related issues

  • #17292 — "Autocompact not triggering at high context usage (90%+)" — same symptom on older versions (v2.1.3); closed as not-planned, but the pattern is back in v2.1.153
  • #18159 — context-limit calculation desync — different angle but same family

Reproduction

Use Claude Code v2.1.153 on Max subscription, run a long session with claude-opus-4-7 in default 200K mode. Watch the system statusline reach "100% context used". No compaction will fire.

Feedback ID 39674a54-5584-44fa-8656-6fbc7e51ab32 has the full transcript attached for internal triage.

Errors

[]

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING