Skip to content
Proposals/Set CLAUDE_CODE_IDLE_COMPACT_MIN_TOKENS and disa
proposaldeveloperP5Worth a lookClaude Code

Set CLAUDE_CODE_IDLE_COMPACT_MIN_TOKENS and disable @-mention file stuffing

Claude Code v2.1.299 compacts idle 200K+ token terminal chats ~54 minutes before the 1-hour prompt cache expires, and can give Claude @-mention paths instead of file contents. Set CLAUDE_CODE_IDLE_COMPACT_MIN_TOKENS and CLAUDE_CODE_DISABLE_FILE_MENTIONS; do not set idleCompaction false.

Why this loop

Long terminal sessions that sit idle used to miss the 1-hour prompt cache and then reprocess the full conversation. v2.1.299 (idle compaction needs v2.1.290 or later) now compactes a 200K+ token conversation left idle about 54 minutes before that cache expires, so the next message does not reprocess it all. Change the 200K floor with CLAUDE_CODE_IDLE_COMPACT_MIN_TOKENS. Only put "idleCompaction": false in settings.json if you want that off. CLAUDE_CODE_DISABLE_FILE_MENTIONS makes @-mentions pass paths so Claude reads files with its file tools instead of injecting contents into the prompt. In agent view, /effort and /fast set what new sessions start with; a bare /model, /effort or /fast opens a picker. Upgrade also closes a sandbox hole: a sandboxed shell command could write into --plugin-dir, whose code Claude Code reloads and runs outside the sandbox.

Proposed actions

  1. Upgrade Claude Code to v2.1.299 (idle compaction requires v2.1.290 or later) and confirm with: claude --version
  2. export CLAUDE_CODE_DISABLE_FILE_MENTIONS=1
  3. export CLAUDE_CODE_IDLE_COMPACT_MIN_TOKENS=100000
  4. In settings.json leave idle compaction on (do not add "idleCompaction": false) so a 200K+ token terminal conversation idle ~54 minutes is compacted before the 1-hour prompt cache expires.
  5. In agent view, run /effort or /fast to set what new sessions start with; a bare /model, /effort or /fast now opens a picker.

Agent prompt

Paste into your agent or query via MCP (get_agent_prompt) — free, no extra AI cost

Paste into Claude Code / CLAUDE.md task

DevAgentRadar → Claude Code

You are helping me adopt a real coding-assistant change. Work only from the facts below. Do not invent features.

Context

Assistant: Claude Code Proposal: Set CLAUDE_CODE_IDLE_COMPACT_MIN_TOKENS and disable @-mention file stuffing Summary: Claude Code v2.1.299 compacts idle 200K+ token terminal chats ~54 minutes before the 1-hour prompt cache expires, and can give Claude @-mention paths instead of file contents. Set CLAUDE_CODE_IDLE_COMPACT_MIN_TOKENS and CLAUDE_CODE_DISABLE_FILE_MENTIONS; do not set idleCompaction false. Primary source: https://github.com/anthropics/claude-code/releases/tag/v2.1.299

Why it matters

Long terminal sessions that sit idle used to miss the 1-hour prompt cache and then reprocess the full conversation. v2.1.299 (idle compaction needs v2.1.290 or later) now compactes a 200K+ token conversation left idle about 54 minutes before that cache expires, so the next message does not reprocess it all. Change the 200K floor with CLAUDE_CODE_IDLE_COMPACT_MIN_TOKENS. Only put "idleCompaction": false in settings.json if you want that off. CLAUDE_CODE_DISABLE_FILE_MENTIONS makes @-mentions pass paths so Claude reads files with its file tools instead of injecting contents into the prompt. In agent view, /effort and /fast set what new sessions start with; a bare /model, /effort or /fast opens a picker. Upgrade also closes a sandbox hole: a sandboxed shell command could write into --plugin-dir, whose code Claude Code reloads and runs outside the sandbox.

Suggested actions

  1. Upgrade Claude Code to v2.1.299 (idle compaction requires v2.1.290 or later) and confirm with: claude --version
  2. export CLAUDE_CODE_DISABLE_FILE_MENTIONS=1
  3. export CLAUDE_CODE_IDLE_COMPACT_MIN_TOKENS=100000
  4. In settings.json leave idle compaction on (do not add "idleCompaction": false) so a 200K+ token terminal conversation idle ~54 minutes is compacted before the 1-hour prompt cache expires.
  5. In agent view, run /effort or /fast to set what new sessions start with; a bare /model, /effort or /fast now opens a picker.

Config surfaces this release may change

  • context and compaction settings (high confidence) — check your repo before applying
  • hooks (high confidence) — check your repo before applying
  • sandbox settings (high confidence) — check your repo before applying
  • settings files (high confidence) — check your repo before applying
  • background and headless runs — check your repo before applying
  • MCP servers — check your repo before applying
  • permission rules — check your repo before applying
  • skills — check your repo before applying
  • subagent definitions — check your repo before applying

After you finish

Do not report this as applied to DevAgentRadar. You cannot write the visitor's loop.

Tell the human: open https://devagentradar.com/proposals/claude-code-v2-1-299-set-claude-code-idle-compact-min-tokens-and-disable and mark Applied, Skipped, or Failed. Proposal id: 946cef01-950c-46aa-b560-f0382f1b3096

Your job

  1. Restate the change in one sentence.
  2. Propose a minimal plan for my repo (or a throwaway pilot).
  3. Implement only what I approve; prefer small diffs and tests.
  4. Call out risks (permissions, breaking APIs, cost).

Start by confirming you understood the proposal.

agentmcpmodelsecurityideRelease source ↗

Your loop

This browser · no sign-in · not shared as “you”

After you run the prompt

Only you can mark this. Agents cannot write your loop.

Your decision stays on this device. A public tally appears after a few votes.

Originating release signal

Claude Codev2.1.299Oct 14, 2026

v2.1.299

Added CLAUDE_CODE_DISABLE_FILE_MENTIONS environment variable: Claude gets the paths of @ file mentions to read with its file tools, not the files' contents · 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 · 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 · +83 more changes
Verified excerpt — the source's own words

What's changed

  • Added CLAUDE_CODE_DISABLE_FILE_MENTIONS environment variable: Claude gets the paths of @ file mentions to read with its file tools, not the files' contents
  • 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
  • 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
  • Added $.prompt.media so a prompt.submit hook of a mod installed by managed settings can read the bytes of an image or document attached to the prompt
  • Added $.session.identity() for mods installed by managed settings: how the session is signed in, and its organization and email when managed forceLoginOrgUUID lists that organization
  • Added size, weight, mono and tabular to a mod's Text and named spacing steps (xs to xl) to its Box; bold is deprecated in favor of weight

Excerpt ends here — this release continues at the source ↗.

Primary source ↗