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
- Upgrade Claude Code to v2.1.299 (idle compaction requires v2.1.290 or later) and confirm with: claude --version
- export CLAUDE_CODE_DISABLE_FILE_MENTIONS=1
- export CLAUDE_CODE_IDLE_COMPACT_MIN_TOKENS=100000
- 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.
- 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 costPaste 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
- Upgrade Claude Code to v2.1.299 (idle compaction requires v2.1.290 or later) and confirm with: claude --version
- export CLAUDE_CODE_DISABLE_FILE_MENTIONS=1
- export CLAUDE_CODE_IDLE_COMPACT_MIN_TOKENS=100000
- 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.
- 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
- Restate the change in one sentence.
- Propose a minimal plan for my repo (or a throwaway pilot).
- Implement only what I approve; prefer small diffs and tests.
- Call out risks (permissions, breaking APIs, cost).
Start by confirming you understood the proposal.
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.