Repository navigation
Description
Problem
T3 Code offers Compact on a Claude thread after its prompt cache expires once the thread reaches 100,000 tokens. The chip defaults to compact-before-send, so pressing Enter after returning to an idle session first compacts the existing conversation and only then sends the typed message.
I often work with long-lived coding-agent threads, including models with a 1M-token context window. At 100K, there may still be plenty of useful context and headroom. I want to preserve architectural decisions and other details rather than accidentally replace the history with a summary.
The threshold is currently hardcoded:
// apps/web/src/components/chat/ContextWindowMeter.logic.ts
const CLAUDE_RESUME_COMPACTION_TOKENS = 100_000;This is different from Claude's Settings → Providers → Claude → Auto-compact after. Setting that to, say, 300K or 500K does not change when the stale-thread Compact chip appears.
Proposal
Add a setting for the resume-compaction suggestion threshold, separate from the existing auto-compaction setting.
- Suggested UI: Settings → Providers → Claude → Suggest compaction on resume after [token count].
- Keep 100,000 as the default for backward compatibility.
- Allow higher thresholds, e.g. 300,000 or 500,000, particularly for 1M-context models.
- Ideally also allow Never, so users who prefer to manage compaction manually can disable the suggestion.
- Only offer the stale-session Compact chip when both conditions are met: the prompt cache has expired and the configured token threshold has been reached.
This would preserve the existing cache-expiry behavior while letting users choose how early the suggestion becomes relevant.
Example
With a configured threshold of 300,000 tokens:
- Work in a Claude thread until it reaches 120K tokens.
- Leave it idle until the prompt cache expires.
- Return and send a prompt. No Compact chip should appear, and the prompt is sent with full history.
- Later, when the thread reaches 320K tokens and becomes stale again, the existing Compact suggestion can appear.
Why not just use "Auto-compact after"?
That setting controls when Claude compacts due to context usage. The stale-resume chip is a separate T3 Code decision based on a fixed 100K threshold and cache TTL. Users configuring one should not have to assume it controls the other.
Related discussions
The question of whether Compact should be on by default is already being discussed in Ideas #17170 and was raised in #17467 / #19182. A persistent Full by default preference would also help avoid accidental compaction, but this request is intentionally narrower: let users configure the 100K threshold independently.
Thanks!
Activity
juliusmarminge commentedon Oct 15, 2026
Note
Grok responding on behalf of Julius.
This is a feature request. Please continue it in Ideas — the closest open thread is #17170 (opt out of stale-Claude compact-before-send); #18659 already floated a configurable resume-compaction token threshold as an optional addition there.
domvo commentedon Oct 20, 2026
I feel like this almost deserves a
buglabel rather than anenhancementlabel. I've already triggered numerous compactions unintentionally.PedroNavHur commentedon Oct 31, 2026
We'd like this setting too, from the other direction.
Since the Compact chip and "Before the cache expires" idle compaction now share one fixed minimum (200,000 tokens,
COMPACTION_SUGGESTION_MIN_TOKENS), a single per-instance setting next to Compact idle threads would serve both camps: people on 1M windows could raise it, and people who want idle compaction earlier could lower it to 100K, Claude Code's own floor foridleCompaction.We compact idle Claude threads at 100K with an external script on four machines, because the built-in mode won't go below 200K. Over the last 14 days it compacted 254 threads. 205 of them were between 100K and 200K, and 189 of those got another message afterward, so each would otherwise have paid a cold re-read of its whole context. With the minimum configurable we could drop the script and use the built-in mode.
Would a PR adding this setting be welcome?
Posted by Claude Code (claude-opus-5-5) via T3 Code triage.
juliusmarminge commentedon Nov 12, 2026
Thanks for writing this up. It asks for new behaviour rather than reporting a defect, so it does not belong in the bug tracker and I'm closing it as not planned here. Feature ideas are discussed in Discussions: please post it there.