You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Claude context meter ignores autoCompactWindow set in ~/.claude/settings.json #29173
I set "autoCompactWindow": 500000 in ~/.claude/settings.json. Claude Code respects it in T3 sessions, because T3 loads user settings via settingSources: ["user", "project", "local"]. But T3's context meter on a 1M model (claude-opus-5-5) shows a 1,000,000 ceiling and no "Compacts automatically at about N tokens" note. A thread approaching ~467K looks like it has plenty of room left, then Claude compacts.
Diagnosis
claudeAutoCompactThreshold() in apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.ts (~L241) only reads T3's own provider setting, providerInstances.claudeAgent.config.autoCompactWindow ("Auto-compact after"). When that setting is empty, T3 reports no autoCompactThreshold, even though the Claude CLI it launches picks up autoCompactWindow from the user's settings.json. Per #22654, the handoff budget also uses this threshold, so it falls back to the full 1M window as well.
The adapter already reads <claudeHome>/settings.json for bypass settings (~L4532). Suggested fix: when the T3 setting is empty, fall back to autoCompactWindow from the Claude home settings.json (and possibly project/local settings) to compute autoCompactThreshold.
Steps to reproduce
Leave Settings → Providers → Claude → "Auto-compact after" empty.
Add "autoCompactWindow": 500000 to ~/.claude/settings.json.
Start a Claude thread on claude-opus-5-5 (1M context) and send a turn.
Hover the context meter. It shows a 1M ceiling and no auto-compact note. Expected: "Compacts automatically at about 467,000 tokens."
Version
Server 0.1.6-nightly.20261031.3973 (commit 85bd3f2). Code path unchanged on main as of 2026-11-02.
Environment
Server: Linux x64, Node v26.12.1, Claude Code 2.1.316. Client: T3 Code Desktop 0.1.7-nightly.20261102.4066 on macOS.
Evidence
Source reading only. The T3 `settings.json``claudeAgent` instance config has no `autoCompactWindow`;`~/.claude/settings.json` has `autoCompactWindow: 500000`. The meter showed 1M with no threshold. I did not observe a live auto-compaction to confirm the trigger point.
Related issues
#18307 (same symptom for the T3 setting, fixed), #22654 (threshold minus 33K reserve), #12495.
Fix applied or workaround
Set the same value in Settings → Providers → Claude → "Auto-compact after". It is passed as SDK flag settings, which override user settings.
Filed by
Claude Opus 5.5 (claude-opus-5-5) in Claude Code, via T3 Code triage.
Follow-up on how the meter presents this, with the T3 "Auto-compact after" setting now filled in as the workaround. Same autoCompactWindow of 500,000 on claude-opus-5-5 (screenshots are from different threads):
Claude Code Desktop treats it as the window: 137k / 500k, with a 33k "Autocompact buffer" and free space counted inside 500k.
T3 Code keeps the model window as the ceiling: 39k / 1m, 4% used, with a tick and "Compacts automatically at about 467,000 tokens."
Both compact at the same point, but T3's percentage understates how close a thread is: when Claude compacts, the meter reads about 47%. I understand #8144 deliberately kept the 1M ceiling. Would you consider using autoCompactWindow as the meter's denominator when it is set, or offering that as an option, so it matches Claude Code Desktop?
Another data point, and a way to read the window that may cover the cases #29220 and #27810 list as out of scope.
Setup: T3 Code 0.1.6 desktop on macOS, Claude Code 2.1.316. T3's "Auto-compact after" is empty, and ~/.claude/settings.json sets the window per model (modelSettings.claude-opus-5-5.autoCompactWindow: 600000).
On an Opus 5.5 thread the meter reads 222k / 1m, while Claude compacts at about 567,000.
Asking Claude Code directly: the Agent SDK's Query.getContextUsage({ detail: "summary" }) (present in 0.3.276,
the version 0.1.6 pins) returns the window the running Claude Code process is using. I asked it in a streaming session
the way T3 runs Claude, after init, mid-turn, after each result and after setModel:
after setModel to Sonnet 5.5: it reported the new model;
every answer came back in 4–12 ms, and the stream kept flowing after the mid-turn question.
Since Claude Code resolves its own settings before answering, this should also cover CLAUDE_CODE_AUTO_COMPACT_WINDOW, --autocompact, managed policy settings, a non-default CLAUDE_CONFIG_DIR and model aliases. I have only tested the
per-model settings.json value and T3's own setting, though.
I have this working locally in ClaudeAdapterV2.ts: each live session keeps the last window Claude Code reported,
refreshed after init, after each result and after a live model switch, and the meter shows today's figures until
Claude Code has answered. With the T3 setting empty the meter reads 39k / 600k ("Compacts automatically at about
567,000 tokens"); with it at 400000, 39k / 400k. Screenshots attached.
Happy to open a follow-up PR on top of #29220 if this direction is wanted, or leave it here as a note.
Still reproduces on the latest nightly, with a per-model window of 400k.
Version: T3 Code server 0.1.8-nightly.20261105.4218, Claude Code 2.1.318, claude-opus-5-5, Linux x64. Adapter code on main @ 337c585 still only passes T3's own setting to claudeAutoCompactThreshold.
Config:~/.claude/settings.json has modelSettings.claude-opus-5-5.autoCompactWindow: 400000, and T3's "Auto-compact after" is empty. I ruled out other sources on the thread's live process: it started after the setting was saved, CLAUDE_CODE_AUTO_COMPACT_WINDOW is unset, the project's .claude/settings.json is empty, and --settings is only {"fastMode":false,"showThinkingSummaries":true}.
Source
Window reported
/context (fresh claude -p, same user settings)
28.2k / 400k, with a 33k autocompact buffer
T3 context meter (the thread)
188k / 1m
T3 persisted provider turn (the thread, a later turn)
usedTokens: 194151, maxTokens: 1000000, no autoCompactThreshold
result.modelUsage["claude-opus-5-5"].contextWindow (fresh claude -p)
1000000
At 188k the meter fills about 19% while the thread is 47% of the way through the real 400k window. With the 33k reserve, Claude should compact at about 367,000, when the meter would read about 37%. I did not observe that compaction live.
The last row may help choose between the open PRs: result.modelUsage still reports 1M when autoCompactWindow is set. So going by its description, #31370 would not change this case on its own, because it takes the window from that field. This case needs the settings lookup (#29220, #27810) or getContextUsage, as suggested above.
The denominator matters to me as well as the threshold note. A meter reading 188k / 400k would match /context.
Investigated and posted by Claude Opus 5.5 in Claude Code, at the reporter's request.
Activity
cyanyux commentedon Nov 2, 2026
Follow-up on how the meter presents this, with the T3 "Auto-compact after" setting now filled in as the workaround. Same
autoCompactWindowof 500,000 on claude-opus-5-5 (screenshots are from different threads):137k / 500k, with a 33k "Autocompact buffer" and free space counted inside 500k.39k / 1m, 4% used, with a tick and "Compacts automatically at about 467,000 tokens."Both compact at the same point, but T3's percentage understates how close a thread is: when Claude compacts, the meter reads about 47%. I understand #8144 deliberately kept the 1M ceiling. Would you consider using
autoCompactWindowas the meter's denominator when it is set, or offering that as an option, so it matches Claude Code Desktop?potatomen73 commentedon Nov 4, 2026
Another data point, and a way to read the window that may cover the cases #29220 and #27810 list as out of scope.
Setup: T3 Code 0.1.6 desktop on macOS, Claude Code 2.1.316. T3's "Auto-compact after" is empty, and
~/.claude/settings.jsonsets the window per model (modelSettings.claude-opus-5-5.autoCompactWindow: 600000).On an Opus 5.5 thread the meter reads
222k / 1m, while Claude compacts at about 567,000.Asking Claude Code directly: the Agent SDK's
Query.getContextUsage({ detail: "summary" })(present in 0.3.276,the version 0.1.6 pins) returns the window the running Claude Code process is using. I asked it in a streaming session
the way T3 runs Claude, after
init, mid-turn, after eachresultand aftersetModel:maxTokens 600000,autoCompactThreshold 567000,isAutoCompactEnabled true;setModelto Sonnet 5.5: it reported the new model;Since Claude Code resolves its own settings before answering, this should also cover
CLAUDE_CODE_AUTO_COMPACT_WINDOW,--autocompact, managed policy settings, a non-defaultCLAUDE_CONFIG_DIRand model aliases. I have only tested theper-model
settings.jsonvalue and T3's own setting, though.I have this working locally in
ClaudeAdapterV2.ts: each live session keeps the last window Claude Code reported,refreshed after
init, after eachresultand after a live model switch, and the meter shows today's figures untilClaude Code has answered. With the T3 setting empty the meter reads
39k / 600k("Compacts automatically at about567,000 tokens"); with it at 400000,
39k / 400k. Screenshots attached.Happy to open a follow-up PR on top of #29220 if this direction is wanted, or leave it here as a note.
yu2001-s commentedon Nov 5, 2026
Still reproduces on the latest nightly, with a per-model window of 400k.
Version: T3 Code server 0.1.8-nightly.20261105.4218, Claude Code 2.1.318,
claude-opus-5-5, Linux x64. Adapter code onmain@ 337c585 still only passes T3's own setting toclaudeAutoCompactThreshold.Config:
~/.claude/settings.jsonhasmodelSettings.claude-opus-5-5.autoCompactWindow: 400000, and T3's "Auto-compact after" is empty. I ruled out other sources on the thread's live process: it started after the setting was saved,CLAUDE_CODE_AUTO_COMPACT_WINDOWis unset, the project's.claude/settings.jsonis empty, and--settingsis only{"fastMode":false,"showThinkingSummaries":true}./context(freshclaude -p, same user settings)28.2k / 400k, with a 33k autocompact buffer188k / 1musedTokens: 194151,maxTokens: 1000000, noautoCompactThresholdresult.modelUsage["claude-opus-5-5"].contextWindow(freshclaude -p)1000000At
188kthe meter fills about 19% while the thread is 47% of the way through the real 400k window. With the 33k reserve, Claude should compact at about 367,000, when the meter would read about 37%. I did not observe that compaction live.The last row may help choose between the open PRs:
result.modelUsagestill reports 1M whenautoCompactWindowis set. So going by its description, #31370 would not change this case on its own, because it takes the window from that field. This case needs the settings lookup (#29220, #27810) orgetContextUsage, as suggested above.The denominator matters to me as well as the threshold note. A meter reading
188k / 400kwould match/context.Investigated and posted by Claude Opus 5.5 in Claude Code, at the reporter's request.
juliusmarminge commentedon Nov 9, 2026
Thanks for the report! #29220, merged as 20841cdfb6, reports the threshold from Claude settings. The meter denominator follow-up remains separate.