Full Byte Developer.

Control Claude Code idle compaction

Choose whether long idle conversations compact automatically, with the documented version and cache limits.

Published · 3 sources

Claude Code can replace a long idle conversation with a summary before you return, per Anthropic's settings reference [1]. You can turn that behavior off without changing every compaction setting.

Open the idle compaction setting

In the terminal, open the configuration menu and change the Idle compaction row. Anthropic says this row requires Claude Code v2.1.302 or later, saves to user settings and takes effect immediately [1].

text
/config

You should see the row when it is available. The docs say another settings source or unavailable feature flags can explain a missing row [1].

Set the preference in JSON

For file-based configuration, merge this field into your settings. The setting requires v2.1.290 or later [1]. User settings apply across projects, subject to higher-priority configuration [3].

~/.claude/settings.json
{
  "idleCompaction": false
}

To restore idle compaction, change the value to true [1].

Check which settings loaded

Anthropic recommends /status when a setting appears to be ignored [3].

text
/status

You should see which configuration sources loaded. A managed or project setting can override your user preference [3].

Decide when to compact manually

The prompt-caching docs recommend compacting at a natural break. Compaction makes a separate summary request; cached history can reduce its input cost, while expired history must be processed again [2].

text
/compact

Idle compaction requires an eligible session, automatic compaction enabled, a one-hour cache lifetime, available feature flags, the context threshold and an awake computer after about an hour idle. The documented default threshold is 200,000 tokens [1].

You now control idle compaction separately and have a manual command for the next natural break in your work.

Keep this guide

By Full Byte Developer

Original posts: TikTok video, Instagram reel

Filed under Claude Code, Cost and context

Sources

Next in this stack