claude-code - 💡(How to fix) Fix autoCompactEnabled does not trigger automatically despite being set to true

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…

autoCompactEnabled: true is set in the global ~/.claude/settings.json, but auto-compact never triggers automatically during a session. Sessions have reached 300,000+ tokens without any compaction occurring. The user has had to manually initiate compaction each time.

Root Cause

autoCompactEnabled: true is set in the global ~/.claude/settings.json, but auto-compact never triggers automatically during a session. Sessions have reached 300,000+ tokens without any compaction occurring. The user has had to manually initiate compaction each time.

Code Example

{
  "autoCompactEnabled": true
}
RAW_BUFFERClick to expand / collapse

Bug Report

Claude Code version: 2.1.158

OS: Linux 6.17.0-35-generic

Description

autoCompactEnabled: true is set in the global ~/.claude/settings.json, but auto-compact never triggers automatically during a session. Sessions have reached 300,000+ tokens without any compaction occurring. The user has had to manually initiate compaction each time.

Configuration

~/.claude/settings.json (relevant section):

{
  "autoCompactEnabled": true
}

Note: Previously also had "autoCompactWindow": 150000 set (suggested by Claude in a prior session). This has been removed to use the default threshold, but the issue existed both with and without that setting.

Expected behaviour

Auto-compact should trigger automatically when the conversation approaches the context limit, without requiring manual intervention.

Actual behaviour

Auto-compact never triggers. Sessions grow past 300K tokens with no automatic compaction.

Steps to reproduce

  1. Set autoCompactEnabled: true in ~/.claude/settings.json
  2. Start a long interactive session
  3. Observe that compaction is never triggered automatically, even past 300K tokens

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