[BUG] conversation auto-compacts repeatedly while context meter shows ~3%
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Using the Claude Desktop app (GUI) with a Claude Code connection. The context-usage
meter in the bottom-right of the Desktop app reads ~3%, but the underlying Claude
Code session is actually near/over its context limit and auto-compacting correctly
and repeatedly. The meter is drastically under-reporting real token usage.
Evidence from the Code debug log (~/.claude/debug/<session>.txt): autocompact runs
against effectiveWindow=180000, threshold=167000, and fired 20+ times when tokens
crossed the threshold -- e.g. tokens=173352, 170520, 183253, 223842 -- across
2026-06-04 through 2026-06-19. So compaction is behaving normally; the DISPLAY is
wrong. The user sees ~3% while the session is really at ~90-124% of a 180K window.
Net effect: the conversation legitimately fills and compacts (replacing transcript
with a lossy summary), but the meter never reflects it, so it looks like
"compacting at 3%."
Environment:
- Claude Code 2.1.173 (/usr/local/bin/claude)
- Front-end: Claude Desktop app (GUI), Linux 6.17.0-14-generic (Ubuntu)
- effectiveWindow=180000, autocompact threshold=167000
What Should Happen?
The Desktop app's bottom-right context meter should reflect the SAME token count
the Claude Code layer uses (tokens vs. effectiveWindow=180000). When the session is
near the 167000 threshold, the meter should read ~90%+, not ~3%. The meter and the
compactor must share one source of truth so the user can see when a compaction is
about to happen. (The auto-compaction itself appears correct -- only the meter
reading is wrong.)
Error Messages/Logs
No error is surfaced in the UI. The compaction is silent; the only visible symptom
is the meter showing ~3% while compactions occur.
From ~/.claude/debug/<session-id>.txt (Claude Code DEBUG log), representative lines:
autocompact: tokens=2961 threshold=167000 effectiveWindow=180000 (normal check)
autocompact: tokens=173352 threshold=167000 effectiveWindow=180000 (over threshold)
autocompact: tokens=223842 threshold=167000 effectiveWindow=180000 (well over window)
autocompact: tokens=183253 threshold=167000 effectiveWindow=180000
20+ threshold crossings logged between 2026-06-04 and 2026-06-19.
Config (~/.claude.json): tengu_auto_mode_config.model = "claude-opus-4-6[1m]"
(NOTE: model string says [1m], but the Code layer's effectiveWindow is 180000, not
1,000,000 -- a possible secondary inconsistency worth checking.)
The ~3% meter reading is the user's observation from the Desktop app UI; the token
numbers above are from the on-disk Code debug log.
Steps to Reproduce
Steps to reproduce:
- Use the Claude Desktop app (GUI) on Linux with a Claude Code connection
(Claude Code 2.1.173). Auto-mode model: claude-opus-4-6[1m].
- Hold a long, work-heavy conversation (file reads, tool output, large pasted
logs) -- enough that real token usage climbs toward the Code layer's
effectiveWindow=180000 / threshold=167000.
- Watch the context-usage meter in the bottom-right of the Desktop app.
- Observe: the meter stays very low (~3%) and never climbs, while the session
actually compacts/summarizes repeatedly (the assistant begins turns from a
"continuing from a previous conversation" summary and loses recent context).
- Confirm the mismatch in the Claude Code debug log:
- tail -f ~/.claude/debug/<current-session-id>.txt
(or follow the "latest" symlink in ~/.claude/debug/)
- grep for: autocompact: tokens=
- See lines like tokens=173352 threshold=167000 effectiveWindow=180000
i.e. real usage at ~90-124% of the window, while the UI meter shows ~3%.
Expected: meter tracks real token usage (should read ~90%+ near the 167000
threshold).
Actual: meter shows ~3% regardless; compactions fire silently in the background.
Frequency: every time the conversation gets long; the meter never reflects true
usage. 20+ real threshold-crossing compactions were logged between 2026-06-04 and
2026-06-19 in a single project's debug log while the meter stayed low.
Claude Model
Opus
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.1.175
Platform
Anthropic API
Operating System
Ubuntu/Debian Linux
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗