autoCompactEnabled does not trigger automatically despite being set to true

Resolved 💬 2 comments Opened May 31, 2026 by tuckshoprn Closed Jul 3, 2026

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

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗