Claude Code v2.1.299: idle compaction, @-mention paths, relaxed rm prompts#
Published by Alex Sorokoletov
Part of the Claude Code Version Tracker series. | Official Env Vars | Official Changelog
Claude Code v2.1.299 brings idle compaction to the terminal: a conversation past 200K tokens, left idle for about 54 minutes, is compacted before its one-hour prompt cache expires, so your next message skips reprocessing it all.[1] It adds CLAUDE_CODE_DISABLE_FILE_MENTIONS to pass @ file paths rather than inlined contents, and no longer prompts on shell scripts that never run rm. It follows v2.1.296.
Idle compaction keeps a long session's cache warm#
A terminal conversation holds a prompt cache that Anthropic keeps for one hour. When a large session sits idle until that hour is nearly up, the cache expires and the next message has to reprocess the whole conversation. v2.1.299 compacts a 200K-plus-token conversation after about 54 minutes of idle time, before the cache lapses, so the next turn starts from the compacted state instead of the full history.[1]
Two controls shape it. "idleCompaction": false in settings.json turns the behavior off, and CLAUDE_CODE_IDLE_COMPACT_MIN_TOKENS moves the 200K-token floor below which an idle session is left alone.[1] That environment variable has been present since v2.1.290, published October 5, which this release's notes are the first to document; the v2.1.290 notes listed compaction fixes but did not mention idle compaction itself.
@ file mentions can hand Claude paths instead of contents#
By default, an @ file mention inlines the file's text into the prompt. Setting CLAUDE_CODE_DISABLE_FILE_MENTIONS changes that: Claude receives the paths of the mentioned files and reads them with its own file tools when it needs them, rather than having the contents pasted in up front.[1] For a mention that points at a large file, that keeps the bytes out of the prompt until they are actually read. A related change stops @-mentioned PDFs from keeping their bytes in the session transcript, trimming memory and disk use on long sessions.[1]
Fewer spurious rm prompts, stricter MCP rule matching#
The permission prompt for rm no longer fires on a shell -c script that does not run rm. An rm built at run time inside a script Claude Code cannot read also stops prompting, unless you set CLAUDE_CODE_STRICT_INLINE_SHELL_RM_PROMPT=1 to keep the stricter check.[1]
MCP allow rules now match only the server they name. mcp__a no longer covers a server named a__b or a_; to grant a server whose normalized name contains a double underscore, write mcp__<server>__* with the whole name, and the same applies to a subagent's tools: list.[1] If an existing rule or agent definition stops matching after the update, that scoping change is the reason to check.
Several fixes close ways a command or teammate could reach past its bounds: a sandboxed command could write into a --plugin-dir folder whose code Claude Code then reloads and runs outside the sandbox, a sandboxed macOS command could read or write a denied path through a symlink, and an agent teammate started with no description could keep part of a credential from its prompt in the task description shown for it.[1] The resume command printed at exit now names the session by its ID instead of its name, so nothing in a session name can run when the line is pasted.[1]
New Environment Variables#
| Variable | What It Does |
|---|---|
CLAUDE_CODE_DISABLE_FILE_MENTIONS | Switches @ file mentions from inlining file contents to passing their paths, which Claude reads with its file tools on demand. Keeps large mentioned files out of the prompt until they are needed. New in v2.1.299. |
CLAUDE_CODE_IDLE_COMPACT_MIN_TOKENS | Sets the token floor below which an idle conversation is not compacted, overriding the 200K default. Present since v2.1.290; documented in the v2.1.299 notes alongside the idleCompaction setting. |
CLAUDE_CODE_STRICT_INLINE_SHELL_RM_PROMPT | Set to 1 to keep prompting on a run-time or inline rm in a shell -c script Claude Code cannot read. Left unset, scripts that do not visibly run rm no longer trigger the prompt. New in v2.1.299. |
What These Tell Us#
The session-length work points at the one-hour prompt cache as the thing to protect. Idle compaction and the CLAUDE_CODE_IDLE_COMPACT_MIN_TOKENS floor act on a conversation while no one is typing, so the cost of a long gap lands on a background compaction rather than on the next message. The @-mention path mode and the PDF transcript change pull in the same direction, holding file bytes out of the prompt until a tool reads them.
The permission changes trade two kinds of friction. Relaxing the inline-rm prompt removes false stops on scripts that never delete anything, while the opt-in variable keeps the strict check for anyone who wants it. Tightening MCP rule matching to the whole server name is the opposite move: a rule now reaches only what it spells out, which can require rewriting rules that leaned on the looser prefix.
Sources#
- Claude Code Official Changelog, v2.1.299 release notes
This analysis is conducted for educational and research purposes under fair use principles. All trademarks and software referenced belong to their respective owners.
Related Versions#
- Claude Code v2.1.294: natural-language prompt and agent hooks now enforce their rule
- Claude Code v2.1.293: Haiku 5.5, subagent status-line agentType, deferred-tool control for mods
- Claude Code v2.1.292: one-command marketplace plugin installs, sub-agent effort levels, and network-path read fixes
- Claude Code v2.1.291: permission-prompt and session-quit regression fixes
- Claude Code v2.1.290: WebFetch paging, scheduled tasks survive resume, web-search refill control
Previous Claude Code analysis: v2.1.296 (October 14, 2026)
All 71 Claude Code analyses: Claude Code Version Tracker · Official Claude Code changelog