claudekit / updates / claude-code-2-1-299
[ PATCH · ]

Claude Code 2.1.299

Adds idle compaction, which compacts a large idle conversation before its one-hour prompt cache expires, and `CLAUDE_CODE_DISABLE_FILE_MENTIONS`, which gives Claude the paths of `@` file mentions instead of their contents. MCP allow rules now reach only the server they name. Fixes requests to Anthropic carrying the API key configured for a third-party gateway, and several sandbox escapes.

Official announcement →

This article is a summary based on official documentation.

What changed

Claude Code 2.1.299 shipped on October 14, 2026. It adds idle compaction in the terminal, an environment variable that changes how @ file mentions work, and /effort and /fast in agent view. Some changes can alter how existing settings behave, notably MCP allow rules and when UserPromptSubmit hooks run. The fixes span third-party gateway API keys, the sandbox, MCP, cloud sessions and Remote Control, and wrapping of CJK and emoji text, and two regressions from 2.1.296 are fixed. The release is very large, so the items below are a selection of the changes with the most user impact.

New features

  • 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_IDLE_COMPACT_MIN_TOKENS changes the 200K-token minimum, and "idleCompaction": false in settings.json turns it off. Both need v2.1.290 or later.

  • CLAUDE_CODE_DISABLE_FILE_MENTIONS

    With this environment variable, Claude gets the paths of @ file mentions to read with its file tools, not the files’ contents.

  • /effort and /fast in agent view

    Set what new sessions start with. A bare /model, /effort or /fast there now opens a picker.

  • New /usage warnings

    /usage now warns about max effort, workflows, always-on context and large tool results.

  • A one-time note in plan mode

    Shown when plan mode won’t ask before most edits or commands because bypass permissions is available.

  • --disallow-tools for claude plugin eval

    --disallow-tools and a disallowed_tools case field keep specific built-in tools, such as Agent, out of eval runs.

  • --shutdown-drain-sec for claude self-hosted-runner orchestrator

    On SIGTERM the orchestrator stops polling and gives the poll in flight and running spawn hooks up to that many seconds to finish.

  • Turning off the attribution block behind a Claude apps gateway

    Set CLAUDE_CODE_ATTRIBUTION_HEADER=0 in the env of a Claude apps gateway’s code policy to turn off the attribution block in Claude Desktop’s Code tab. The attribution block in Claude Code sessions behind a gateway gets a new field, and the same setting removes it.

  • Mod API additions

    Mods installed by managed settings can read the bytes of an image or document attached to the prompt through $.prompt.media in a prompt.submit hook, and check how the session is signed in with $.session.identity(). A mod’s Text gets size, weight, mono and tabular, and its Box gets named spacing steps (xs to xl); bold is deprecated in favor of weight. A mod’s skill.prompt hook now receives the skill’s frontmatter, source, plugin name and file path, and the session.append hook gets a queue door.

Key improvements

  • Memory and disk use for @-mentioned PDFs

    Their bytes are no longer kept in the session transcript.

  • Startup warning for an unrecognized model ID

    Now one short line under the welcome banner with a docs link, instead of a long raw message.

  • “Unknown skill” errors

    The Skill tool now suggests a skill’s listed name when Claude wrongly adds the anthropic-skills: prefix to it.

  • /reload-skills

    Now says it re-sends the full skill list to Claude, which is how to get skills back after compaction.

  • Worktree creation errors

    When a worktree can’t be created because its base commit doesn’t resolve, the error says how the lookup ended and the likely reasons, such as a repository without a commit. Creating a worktree at a bare-repository layout’s root now explains the layout instead of showing an unrelated git error.

  • Artifact watching

    A local session can now watch up to 25 published artifacts at once, up from 10.

  • Background agent notifications

    They now say when an agent is only waiting on its own background work, got a message too late for its result, or was stopped by a usage limit.

  • Errors for an expired claude.ai login

    When a cloud session is refused because your claude.ai login was rejected or has expired, the error now tells you to sign in again with claude auth login.

  • [VSCode] Startup

    In workspaces without a Python environment, Claude starts while the Python extension loads. In a new window on a folder you’ve opened before, the model picker and slash command menu fill in right away.

Changed behavior

  • MCP allow rules reach only the server they name

    mcp__a no longer allows a server named a__b or a_. Write mcp__<server>__* with the server’s whole normalized name. Agent tools: lists likewise take only the named MCP server’s tools; list a server whose name contains __ as mcp__<whole name>__*.

  • UserPromptSubmit hooks run before expansion

    They now run before a skill or custom slash command expands, so a hook that blocks the prompt also stops its embedded shell commands. A skill’s own frontmatter UserPromptSubmit hook first runs on the prompt after the one that invokes the skill.

  • The resume command printed at exit

    It names the session by its ID, no longer by its name, so that nothing in a session name can run when the line is pasted. For a worktree session it uses -w and -r if the long flags don’t fit the terminal.

  • HTTP redirects on MCP requests

    Requests to claude.ai’s connector proxy and to Anthropic-hosted MCP servers no longer follow HTTP redirects, nor do MCP requests through the session’s MCP proxy in cloud and self-hosted runner sessions. Redirects by a connector’s own server are unaffected.

  • Skill and command names with hidden characters

    A skill or command whose file or folder name has hidden, direction-changing or blank-like characters, < or > is no longer offered until renamed.

  • Plugin hooks that can’t be reached

    Actions a plugin hook can block are now refused, not let through, when the hook can’t be handed them or can’t hand back its answer; a tool that already ran has its result withheld. Plugin hooks and workflow scripts refuse values they hand back that nest deeper than 28,000 levels (workflow scripts allowed 100,000).

  • claude plugin test

    A call to a mod’s served $ method that hasn’t answered within ten seconds now fails, as in a session. In ui.render trees, each mod’s Box or Text root carries part: { plugin }, so exact-tree assertions must include it.

  • MCP protocol version and tool description length

    Cloud session and Remote Control MCP connectors negotiate MCP protocol version 2026-07-28 by default on installs that fetch no flags; MCP_PROTOCOL_NEGOTIATION=legacy opts out. Tool descriptions and server instructions from Anthropic’s first-party MCP servers at api.anthropic.com reach Claude in full instead of being cut at 4,096 characters.

  • Permissions in Cowork cloud sessions

    In auto mode, a PermissionRequest hook can no longer approve shell commands or subagents. Outside auto mode, an approved-site Claude in Chrome action that the safety classifier flags now asks you instead of being refused, unless managed settings apply.

  • /btw in non-interactive sessions

    Side questions return a timeout error when still unanswered after 11 minutes.

  • /ultrareview upload errors

    They no longer suggest git add ., which could stage or commit untracked files such as .env.

  • Other changes

    WebFetch page reads pick their effort as web searches do. The turn.start mod hook also hears subagents’ and teammates’ turns; tell them apart by e.agentId. The cyber safeguard notice no longer asks people to apply to the Cyber Verification Program.

Bug fixes

Gateways & API keys

  • Feature flag, startup, fast mode, profile and feedback requests to Anthropic carrying the API key configured for a third-party gateway (ANTHROPIC_BASE_URL); Anthropic API keys are still sent.
  • The server-managed settings request to Anthropic carrying a third-party gateway’s API key when a managed settings file sets ANTHROPIC_BASE_URL.
  • Streams through a custom ANTHROPIC_BASE_URL being aborted after 180 seconds with no data arriving; they now wait 300 seconds, whether or not feature flags are loaded.
  • Sessions on a gateway-specific model name behind a custom ANTHROPIC_BASE_URL ending with Prompt is too long · automatic compaction failed near 200K tokens instead of sending the request.
  • The Claude apps gateway serving models that a policy’s availableModelsMatch: exact or deniedModels blocks; it now answers 400 and leaves them out of its model lists.
  • forceLoginOrgUUID and forceLoginMethod from MDM or the managed-settings file being hidden or replaced by server-managed settings.

Sandbox & permissions

  • A sandboxed shell command being able to write into a --plugin-dir folder, whose code Claude Code reloads and runs outside the sandbox.
  • Sandboxed commands on macOS being able to read or write a denied path by its real location when the denied path passes through a symlink.
  • Sandbox denyRead and allowRead globs with braces, parentheses or backslashes in a folder’s name being read differently by Claude Code’s settings checks than by the sandbox; glob allowRead and allowWrite entries are also re-checked when their starting directory is replaced by a symlink.
  • Plan mode running a write (an MCP tool’s, a file’s, a shell command’s) that a PreToolUse hook or a mod’s tool.check hook allowed.
  • rm prompts on shell -c scripts that don’t run rm. An rm built at run time in a script Claude Code can’t read no longer prompts unless CLAUDE_CODE_STRICT_INLINE_SHELL_RM_PROMPT=1.
  • An agent teammate started without a description keeping part of a credential from its prompt in the task description shown for it.
  • The Write and Edit tools creating a mod in a session’s mods folder without asking in accept-edits mode when the config directory’s path has no .claude in it.
  • Worktree-isolated sessions accepting some awk programs the isolation guard should refuse.

MCP

  • MCP connections over HTTP hanging for 30 seconds and failing when a server never ends the body of its reply to a notification (#99014).
  • MCP OAuth sign-in, token refresh and sign-out not sending configured headers/headersHelper values, which broke servers behind an authenticating proxy.
  • claude mcp list, claude doctor and /status reporting an empty .mcp.json as invalid.
  • A settings file being ignored when enabledMcpjsonServers or disabledMcpjsonServers held a single server name as a plain string.
  • claude mcp list, claude mcp get and subagent MCP servers starting a server that a policy check blocks; servers added to a running headless or SDK session are also no longer contacted before policy checks run.
  • MCP servers named constructor or prototype never being connected, and tools of a server named constructor or toString asking for permission in auto mode and bypass permissions mode.
  • Deny and ask rules for an MCP server (mcp__<server>) not applying when the server’s normalized name contains a double underscore.
  • MCP tool calls in headless and SDK sessions sometimes failing or running twice when a background reconnect closed the connection they were running on.

Sessions, cloud & Remote Control

  • Cloud and headless sessions running an approved tool call twice if a new message arrived as the session resumed after a restart (regression in 2.1.296).
  • Edit and Retry in Cowork and claude.ai cloud sessions failing on a message stopped while its UserPromptSubmit or mod prompt.submit hooks were still running (regression in 2.1.296).
  • The claude.ai view of a Remote Control or cloud session freezing when a large batch of events could not finish uploading over a slow connection.
  • A Remote Control prompt being lost when another queued prompt in the same batch failed to deliver; files of 30 to 35 MiB, and files in long-running sessions, now also arrive over Remote Control.
  • A cloud session sometimes ignoring the answer to a permission prompt or a question when it was given while the session’s worker was being replaced; replies cut short when the worker was replaced right after a compaction or the output token limit are also fixed.
  • High memory use after resuming a cloud or Remote Control session that had run many subagents.
  • Replies cut off at the output token limit ending the turn silently, with no retry or error, after a request fell back to non-streaming mode.
  • SendMessage not finding a subagent by name after the CLI restarted and resumed the session (names given before the last compaction still need the agent ID).
  • Background sessions started with --safe-mode silently leaving safe mode when the session was woken or restarted.

Scheduled tasks

  • Scheduled wakeups (ScheduleWakeup) not firing while a background task was running in Agent SDK, IDE and claude remote-control sessions.
  • Scheduled tasks being announced for the wrong minute; the scheduling tools now report each job’s actual next run time.
  • Scheduled tasks and loops firing again after every turn, or firing early, during the repeated hour when daylight saving time ends.

Memory & debug logs

  • Memory growth under heavy debug logging (--debug, --debug-file), and a hang on exit when the debug log is on a disk or network mount that stops accepting writes.
  • Memory growing without bound when debug output goes to stderr and the parent process stops reading it.

Files, images & display

  • Read garbling UTF-16LE files with a byte-order mark, and Write dropping byte-order marks or silently converting Windows-1252, Shift-JIS, GBK or UTF-16BE files to UTF-8 (now refused).
  • Wrapped text mixing CJK or emoji with Latin words losing its last line or leaving a blank row at some terminal widths, along with blank rows in very narrow terminals and text cut beside wide characters.
  • Bold, italic and other nested text styles running over table borders or being lost on wrapped rows.
  • Long conversations losing newly attached images on every turn after one oversized image was refused by the API; images attached while Claude is working (VS Code, desktop app, SDK) are also no longer sent at full size.
  • Long pastes in terminals without bracketed paste losing all text after an invisible control character, such as a mis-decoded curly quote.
  • claude -p saying nothing when a settings file fails validation; text-output runs now list the file and the invalid entry on stderr.
  • /usage, the approaching-limit warning and the status line sometimes showing more than 100% used (#92238).

Plugins & mods

  • Installed mods that kept running in an open session after being turned off remotely; they now unload between turns.
  • A mod that submits a prompt at the end of every turn keeping a headless run going past --max-turns, --max-budget-usd, an interrupt, or the end of the host’s conversation.
  • Mods’ hooks being handed values with __proto__ keys silently removed, which could skip a tool.check guard on a tool call another mod made.
  • A user-installed mod’s $.env.set changing the environment or shell prefix that command hooks from managed settings start with.
  • /reload-plugins not loading a plugin installed from another terminal a moment earlier.
  • claude plugin eval passing runs that the API refused; a run that ends on an API error now scores 0 and makes the suite exit 1.

Windows

  • The process-liveness check leaving orphaned PowerShell processes behind on busy machines until memory ran out.
  • PreToolUse and PermissionRequest hooks that set no shell failing open when Git for Windows isn’t installed; a guard that fails now blocks the call.
  • Bash commands failing with “command not found” for a whole session when Git Bash did not report its PATH at startup.
  • Sandboxed commands failing on WSL2 with bwrap: Can't mkdir /mnt/c/Program Files/ClaudeCode when the sandbox can write to the Windows drive.

VSCode & cloud sessions

  • [VSCode] An unsent prompt and its attachments being lost when switching to another session and back.
  • [VSCode] Unused blank chats keeping a background Claude process running after starting a new conversation.
  • [Cloud sessions] A memory spike that could crash a session when many of its existing output files were re-sent to it at once.
  • [Cloud sessions] Saving an edited routine silently moving it to a different environment when its own had been deleted or wasn’t in the list.
  • [Remote Control] Sessions whose computer can’t be reached still appearing to send your messages; your text now stays in the box and Send is off until it reconnects.

Claude Tag & Code Review

  • [Claude Tag] Claude in Slack staying silent on untagged posts that a channel’s own instructions tell it to answer, in channels with guests.
  • [Claude Tag] Claude in Slack reporting a reply to another channel’s thread as posted when it isn’t a member there; it now says the reply wasn’t delivered and how to fix that.
  • [Claude Tag] Claude in Slack sometimes ending a turn without posting its answer when a self-hosted runner’s image has no python3.
  • [Code Review] The monthly spend-limit comment and check-run card sending admins to Claude Code settings; they now link the Usage page, where that limit is set.

Notes

  • If you write MCP allow rules as mcp__<server>, they now reach only that server. Tools of a server whose name merely starts the same way (such as a__b) may prompt again; add mcp__<server>__* with the server’s whole normalized name where needed. The same applies to agent tools: lists.
  • If you check prompts with a UserPromptSubmit hook, it now runs before a skill or custom slash command expands. A hook that relied on the expanded text should be re-checked.
  • If you saw tool calls run twice in cloud sessions, or Edit and Retry fail in Cowork, after 2.1.296, both regressions are fixed here.
  • Idle compaction only applies to 200K+ token conversations left idle in the terminal for about 54 minutes. Set "idleCompaction": false in settings.json to turn it off.
  • If you use a third-party gateway (ANTHROPIC_BASE_URL), earlier versions sent its API key with some requests to Anthropic. This release fixes that.
  • If you followed the old /ultrareview advice to run git add ., check that untracked files such as .env weren’t staged.