claude-code - 💡(How to fix) Fix [Feature Request] User-configurable autocompact threshold for context fill percentage [1 participants]

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…
GitHub stats
anthropics/claude-code#57773Fetched 2026-05-11 03:25:47
View on GitHub
Comments
0
Participants
1
Timeline
5
Reactions
0
Participants
Timeline (top)
labeled ×5

Fix Action

Fix / Workaround

My current workaround: I anxiously watch /context and manually /compact around 120–150k tokens. This is fragile — one distracted moment and the model is already in the danger zone before I notice.

RAW_BUFFERClick to expand / collapse

Bug Description Feature request: user-configurable autocompact threshold

I want a setting (env var or settings.json key) that lets me control at what context fill % autocompact triggers. Today the threshold + ~33k buffer is hardcoded.

Why this matters — concrete pain: On Opus 4.7 (1M context), I observe severe quality degradation past ~150k tokens on complex tasks: coding, product strategy, marketing analysis. Worse, the model starts taking dangerous, careless actions I never asked for:

  • deleting/removing users
  • revoking API tokens
  • imprecise / wrong actions in agent-browser sessions

This is a real safety problem, not a vibes complaint. Going past 200k tokens is genuinely risky for me.

My current workaround: I anxiously watch /context and manually /compact around 120–150k tokens. This is fragile — one distracted moment and the model is already in the danger zone before I notice.

Ask: expose a knob like autoCompactThreshold: 0.15 (or env var) so users on large-context mode compact aggressively early, well before quality cliffs and unsafe-action regimes. The default can stay where it is; this is purely opt-in.

Closed as duplicates: #15435, #12053 — but neither shipped a solution. Please reconsider; for power users on 1M-context models the current behavior is actively unsafe.

Environment Info

  • Platform: darwin
  • Terminal: vscode
  • Version: 2.1.138
  • Feedback ID: 8ebca5c3-8c4d-4d7d-aa9a-b4bf48ffb002

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

claude-code - 💡(How to fix) Fix [Feature Request] User-configurable autocompact threshold for context fill percentage [1 participants]