Claude Code · verified 2026-10-14

Claude Code idle compaction: what changed and how to disable it

Short answer: Set "idleCompaction": false in settings.json to turn it off, or raise the 200K-token minimum with CLAUDE_CODE_IDLE_COMPACT_MIN_TOKENS. Both need Claude Code v2.1.290 or later.

What changed

  • Changelog: “Added idle compaction in the terminal: a 200K+ token conversation left idle for about 54 minutes is compacted before its one-hour prompt cache expires, so your next message doesn't reprocess it all.” Claude Code CHANGELOG (2.1.299) ↗
  • Changelog: “Added CLAUDE_CODE_IDLE_COMPACT_MIN_TOKENS to change idle compaction's 200K-token minimum; "idleCompaction": false in settings.json turns it off. Both need v2.1.290 or later.” Claude Code CHANGELOG (2.1.299) ↗

Who is affected

Terminal users with long sessions (200K+ tokens) who step away for about an hour and want the full, uncompacted history when they come back.

Exact fix

~/.claude/settings.json (or a project .claude/settings.json)

{
  "idleCompaction": false
}

Or keep it on but only for bigger conversations

export CLAUDE_CODE_IDLE_COMPACT_MIN_TOKENS=400000

Other agents

Codex CLI, Cursor and Gemini CLI: we did not find an equivalent idle-compaction setting in their official docs. Unknown. See the compatibility table.

Moving this setup to another agent? Paste your config into the free converter: it outputs the exact files for Claude Code, Codex CLI, Cursor and Gemini CLI.

FAQ

How do I disable Claude Code idle compaction?
Add "idleCompaction": false to settings.json. It needs v2.1.290 or later, per the official changelog.
When does idle compaction trigger?
Per the changelog: in the terminal, for a conversation of 200K+ tokens left idle for about 54 minutes, before the one-hour prompt cache expires.

Every claim above links to an official source (vendor docs, changelog or source code), except where a user report is labelled as such. Last verified 2026-10-14. All config changes · RSS