← All changelogs v2.1.222 claude · claude-opus-5 (effort medium)
Claude Code · Source-level changelog

Version 2.1.222

This release focuses on permission correctness and worktree safety. Permission responses are now matched against the tool they were issued for, mismatched replies are logged and dropped, and forked or background agent queries require canUseTool by default. Worktree handling was reworked so that git commands run with a scrubbed environment, new worktree roots are validated before use, sessions record a launch anchor for when they exit, and resuming into a missing or unverifiable worktree explains itself instead of failing silently. The remote-control bridge can now self-heal when heartbeats fail while SSE is still alive, with a rebuild budget and better failure telemetry, and shutdown waits for in-flight remote-control work. Artifact comments track which ones were sent to Claude, and commands, skills and plugin manifests accept a free-form metadata object, with warnings on malformed entries.

Official notes ✓ synced Package @anthropic-ai/claude-code Diff v2.1.221 → v2.1.222Provider claudeModel claude-opus-5 (effort medium)
9
Use it now
76
You'll notice
8
Not switched on
14
Env Vars / Flags

Official Changelog

Official · Anthropic
Anthropic’s official release notes
Published verbatim by Anthropic for v2.1.222 — shown here alongside the source-level analysis below. Text is unmodified from the upstream changelog.
View on GitHub ↗
  • Fixed worktree-isolated sessions and their subagents being able to run destructive git commands against the main checkout; isolation now applies to file edits and Bash in every session type
  • Fixed PreToolUse auto-allow hooks bypassing tool restrictions in background agent tasks (summaries, compaction, renames)
  • Fixed /usage-credits on Team and Enterprise showing "you've already sent a usage credit request" for members whose earlier request was dismissed, blocking them from sending a new one
  • Fixed the startup connectivity check hanging and then failing behind an HTTPS proxy; it now uses the same proxy-aware transport as API requests and times out with a clear message
  • Fixed "Connection closed mid-response" errors being reported on responses that had actually completed
  • Fixed /usage overattributing usage to MCP servers: a server's share now reflects only the requests that actually consumed its tool results, instead of every turn after any call to it
  • Fixed sessions not linking to pull requests created after the branch was pushed, including through the GitHub REST API
  • Fixed org-restricted model: opus-style subagent and teammate family aliases dropping to the parent model instead of stepping down to the newest org-allowed model in the family
  • Fixed stream idle timeout firing on custom ANTHROPIC_BASE_URL gateways despite server keep-alive pings arriving on the wire
  • Fixed claude.ai connectors being falsely marked as needing authorization when the session token is invalid — they now show a /login hint instead
  • Fixed tool errors not being displayed for tools no longer available locally, for example after an MCP server is removed
  • Fixed SendMessage rejecting a long summary — it now truncates instead, so sends no longer fail on a character limit
  • Fixed the spinner's effort label in a subagent's transcript view showing the session's effort level instead of the subagent's own effort: setting
  • Fixed rare crashes when a file watcher hit a filesystem error or during file-watcher teardown
  • Fixed screen readers re-reading the whole input line on every backspace in --ax-screen-reader mode — end-of-line deletions now echo just the deleted characters
  • Fixed host model-selection keys not taking precedence over a stale on-disk managed-settings.json when CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST is set
  • Improved auto mode safety: messages sent to other agent sessions via SendMessage are now evaluated by the permission classifier before dispatch
  • Improved the refusal when Claude tries to invoke a skill with disable-model-invocation: Claude is now told to ask you to run the skill instead of replicating its workflow
  • Improved the /diff view, the Remote Control workspace diff, and file-edit diffs in Claude Code on the web sessions to use raw git blob content, ignoring workspace-configured diff drivers and textconv
  • Changed Remote Control auto-start so repo-local settings (.claude/settings.json or .claude/settings.local.json) can no longer turn it on (they can still turn it off); enable it at user scope via /config
  • Removed ultraplan feature
Source: anthropics/claude-code · CHANGELOG.md · 21 entries · synced automatically when Anthropic publishes official notes for a version.
Source-Level Analysis
Reverse-engineered from a diff of the bundled CLI — deeper, structured detail. Unofficial.

Highlights

9 of 121

Present but switched off

10 of 13
Shipped inside the bundle with its gate off, its guard hardcoded false, or nothing calling it. What the code shows, not a roadmap: no claim about what is released, announced or planned.
Filter

What probably matters to you

25 items

Anything you can use today, anything that visibly changes, and anything worth poking at. One line each, open for detail.

Artifacts dialog can dismiss frames with x #

Juicy

In the artifacts frames dialog, press x to detach the highlighted frame from your session.

/artifactsx
Use it now · Artifacts

Commands, skills and plugin manifests accept a free-form metadata object #

Juicy

You can add a free-form metadata block to command, skill and plugin files that Claude Code keeps but ignores.

metadata
Use it now · Plugins

MCP: rejected claude.ai session token is now visible #

Your MCP server list now flags a rejected login token, and clears the warning once it recovers.

/login/mcp
Use it now · MCP

Exiting a worktree no longer widens the permission anchor #

Leaving a worktree can no longer quietly widen what the session is allowed to touch.

You'll notice · Permissions

Model refusal fallback no longer claims your session model changed #

Fallback notices now say only that one response came from another model; your session model is unchanged.

/status
You'll notice · Models

Proxy hint in the connection-failure screen #

If a connection fails through your proxy, the error now names the proxy environment variable to check.

HTTPS_PROXY
You'll notice · Internals

Resuming into a missing or unverifiable worktree is now explained #

Resuming into a missing worktree now warns you, and headless runs exit with an error instead of continuing.

You'll notice · Worktrees

remoteControlAtStartup can no longer be turned on by repo-scoped settings #

Juicy

A cloned repo's settings can no longer switch on Remote Control at startup; only your own settings can.

remoteControlAtStartup
You'll notice · Permissions

Bad metadata in frontmatter and manifests now warns #

You now get a warning when metadata in a skill, command, plugin or marketplace file is the wrong type.

metadata
Use it now · Plugins

Host-managed provider sessions take model policy from the parent process #

Juicy

Setting CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST makes the parent process dictate your model settings, ignoring your settings file.

CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST
Use it now · Settings

Parked AskUserQuestion prompts can survive stream shutdown #

Juicy

Questions left open when the stream closes could stay answerable, but that behaviour is switched off for you today.

Not switched on · Permissions

Skill frontmatter metadata is kept on the loaded record #

Juicy

Skills can carry a metadata block in their frontmatter, but nothing uses it yet.

metadata
Not switched on · Skills

Byte watchdog covers first-party, gateway and Bedrock streams #

Juicy

Stalled streams are now detected across direct, gateway and Bedrock connections, and you can force it with an env var.

CLAUDE_ENABLE_BYTE_WATCHDOGCLAUDE_ENABLE_BYTE_WATCHDOG_BEDROCK
Use it now · Streaming

MCP server panel explains a rejected claude.ai session token #

An MCP server rejecting your login token now tells you to run /login and reconnect.

/login
Use it now · MCP

Dedicated error when claude.ai rejects a session bearer token #

If claude.ai rejects your session token, you now get a clear message telling you to run /login instead of endless retries.

/login
You'll notice · MCP

Forked and background agent queries require canUseTool by default #

Background and forked agents now run your permission callback even when a hook says allow, and deny rules win.

canUseTool
You'll notice · Permissions

Permission responses are checked against the tool they were issued for #

A permission answer meant for a different tool is ignored, so nothing gets wrongly approved.

You'll notice · Permissions

Resume no longer inherits a stale config directory or a half-copied file #

Resumed sessions no longer inherit a stale config directory or abort on a failed file copy.

CLAUDE_CONFIG_DIR
You'll notice · Sessions

claude.ai MCP proxy surfaces a rejected session token #

When your claude.ai session token is rejected, you now get a clear error telling you to run /login.

/login
You'll notice · MCP

/btw answers can now show a refusal-fallback notice #

If a /btw answer came from a fallback model after a refusal, you now see a warning.

/btw
Use it now · Slash Commands

Frame strip points to /artifacts when frames overflow #

When too many frames fit on the row, you now see a pointer to /artifacts instead of a bare count.

/artifacts
Use it now · Artifacts

Destructive MCP tools can be included in remote auto-mode #

Juicy

Destructive MCP tools could stop skipping permission prompts in remote auto mode, but that is off.

tengu_remote_auto_mode_include_destructive_mcp
Not switched on · Permissions

Unsafe-PATH command resolution guard, off in this build #

Juicy

A guard that would reject commands found only in your current directory stays disabled.

Not switched on · Sandbox
Everything else · 96
Smaller changes and internals, grouped as the pipeline found them. Nothing is dropped, it is only further down.

New Features

7 items

Artifact comment auto-reply understands "sent to Claude" lanes #

Artifact comment threads now track which comments were actually sent to you, and re-sending one triggers a reply.

You'll notice · Artifacts

Skill import from other agents refuses unsafe copies #

Importing a skill from another agent now skips bad copies and tells you why instead of silently breaking.

You'll notice · Skills

Artifact comments now mark which comments were sent to Claude #

Comment rows are now labelled "sent to you" so you can tell requests apart from side chatter.

You'll notice · Artifacts

Remote bridge self-heals when heartbeats fail but SSE is alive #

The remote bridge tears down half-dead sessions so the connection rebuilds instead of hanging.

tengu_bridge_selfheal_heartbeats
You'll notice · Remote Bridge

Artifact tool output exposes sent-to-Claude and awaiting-reply flags #

Threads with comments addressed to you sort first, and each comment shows whether it awaits your reply.

You'll notice · Artifacts

/btw side questions show a fallback-model notice #

Side questions now show a banner naming the original and fallback model instead of switching silently.

/btw
You'll notice · Slash Commands

Remote-bridge presence heartbeats can self-heal the transport #

Remote sessions now rebuild a stuck connection when heartbeats keep failing but data still flows.

tengu_bridge_selfheal_heartbeats
You'll notice · Remote Bridge

Improvements

42 items

Bridge recovery has a rebuild budget and richer failure telemetry #

A remote bridge that cannot recover now stops retrying after a budget and tells you why.

You'll notice · Remote Bridge

MCP server list shows a token-rejected state #

The MCP server list now shows a distinct line when a server failed because your session token was rejected.

You'll notice · MCP

Auto-reply stands down when lane or send-status data is unreadable #

Auto-reply now stays quiet when it cannot tell who wrote a comment or whether it reached Claude.

You'll notice · Artifacts

Worktree git commands run with a scrubbed git environment #

Stray git environment variables in your shell can no longer misdirect worktree operations.

GIT_DIRGIT_WORK_TREEGIT_INDEX_FILE
You'll notice · Worktrees

Isolation refusal messages distinguish session from agent #

Isolation refusal messages now say whether the session or the agent is the one confined.

You'll notice · Worktrees

Plugin and skill search now degrade to empty on 403 #

Plugin and skill search shows nothing rather than an error when your account lacks access.

You'll notice · Plugins

Shutdown waits for in-flight remote-control work #

Quitting waits up to 30 seconds for pending remote-control work instead of cutting it off.

You'll notice · Elsewhere

Deferred PR-existence checks retry on later git commands #

Claude now re-checks later whether your pull request was actually created, instead of giving up after one try.

gh pr createglab mr create
You'll notice · Git Integration

Connectivity check rewritten on fetch, with a timeout and proxy awareness #

Connection checks now time out properly and record whether your proxy was used.

You'll notice · Internals

Agent-to-agent messaging gets a classifier review path #

Messaging another agent may now require classifier review instead of being automatically allowed.

You'll notice · Permissions

Subagent model fallback says why it fell back #

When a subagent can't use its requested model, you now see why it fell back.

You'll notice · Subagents

Worktree git guard message adapts its wording #

The refusal message for git commands escaping a worktree now words itself to fit the context.

Under the hood · Git Integration

Skill refusal message tells the model not to work around it #

Skills you mark as user-only now tell Claude not to reimplement them by hand.

disable-model-invocation
You'll notice · Skills

Teammate summaries are trimmed, truncated and colour-checked #

Long teammate summaries get trimmed instead of breaking the status line or rejecting the message.

You'll notice · Elsewhere

Codex import rejects oversized skills and risky command bodies earlier #

Importing from Codex now rejects oversized skills and risky command bodies up front instead of creating broken entries.

You'll notice · Elsewhere

Resume snapshots carry user settings without plugin keys #

Resumed sessions now carry your settings files along, with plugin registrations stripped out.

settings.jsoncowork_settings.jsonenabledPluginsextraKnownMarketplaces
You'll notice · Sessions

Git diffs ignore external diff drivers and textconv filters #

Diffs now ignore your repo's custom diff drivers, so Claude sees the real file contents.

--no-ext-diff--no-textconv
You'll notice · Git

Design OAuth refresh lock holds longer and reports compromise #

Slow token refreshes no longer trip the lock early, cutting spurious login hiccups.

You'll notice · Elsewhere

Ultraplan notification text shortened #

The ultraplan banner now just tells you it's ready and which key to press.

You'll notice · Terminal UI

Turn effort display now tracks the model the turn is running on #

The effort label in your status line stays correct when the model changes mid-turn.

You'll notice · Terminal UI

Plugin sync list failures carry HTTP status and 403 is not retried #

Plugin syncing fails fast on a forbidden response and tells you the HTTP status.

You'll notice · Plugins

Remote-control bridge heals a socket whose heartbeats keep failing #

A remote connection with failing heartbeats now rebuilds itself instead of hanging on a half-dead socket.

tengu_bridge_selfheal_heartbeats
You'll notice · Remote Bridge

Thread rendering keeps summoning comments and marks new truncation kinds #

Comments that triggered a turn are always kept in view instead of being trimmed away.

You'll notice · Artifacts

Artifact auto-reply failure notices no longer say "@claude" #

Failure replies on artifacts no longer tell viewers to mention @claude, matching how sending actually works.

You'll notice · Artifacts

Worktree creation validates the resulting root before use #

New worktrees are checked before use, and creation fails loudly if the directory is unusable.

You'll notice · Worktrees

Parked agents refuse to resume into a worktree that vanished #

A parked agent refuses to resume if its worktree disappeared, instead of landing in the wrong directory.

You'll notice · Worktrees

Subagent models outside the allowlist step down within their family #

Subagents asking for a disallowed model now drop to the newest allowed model in the same family.

availableModels
You'll notice · Models

Messages from other sessions get a sanitized sender label #

Messages arriving from another session now show who sent them plus a chord to expand.

You'll notice · Transcript

Agent-proxy tunnel now times out waiting for HELLO_ACK #

A stalled agent proxy tunnel now fails quickly with a clear reason instead of hanging in limbo.

You'll notice · Elsewhere

model_refusal_fallback events gain a scope field #

Model fallback events now say whether the swap affects your whole session or just one subagent.

/btw
Under the hood · Elsewhere

Skill import warning reworded #

The skill import warning now spells out that bundled scripts and instructions go live once you import.

SKILL.md
You'll notice · Skills

Remote control enable/disable runs as a tracked async task #

Toggling remote control now carries pending permission prompts over to the new session instead of losing them.

You'll notice · Remote Control

Git invocations hardened with sanitized args and environment #

Many more git commands now run with a scrubbed environment so stray variables can't redirect them.

GIT_DIRGIT_WORK_TREEGIT_INDEX_FILE
You'll notice · Git Integration

Artifact comments use server delivery timestamps #

Artifact comments track when the server delivered them, so you should stop seeing the same comment twice.

You'll notice · Artifacts

Model refusal fallback updates the shown model #

When a turn falls back to a different model after a refusal, the display now shows the model actually used.

You'll notice · Model Fallback

Codex import explains shell-exec marker refusals #

Codex import now tells you exactly why a command was skipped and to port it manually.

You'll notice · Elsewhere

Bridge attestation warnings are reported once per event #

A failing device attestation now warns you once instead of spamming repeated notices.

You'll notice · Elsewhere

Shell tools get an explicit worktree isolation root #

Agent commands now have a concrete worktree boundary, so escapes get blocked with a clearer log line.

You'll notice · Sandbox

Screen-reader rendering erases trailing characters in place #

Screen-reader mode repaints less, so assistive tech hears less redundant output.

INK_SCREEN_READERCLAUDE_CODE_ACCESSIBILITY
You'll notice · Elsewhere

Teammate count falls back to a generic label #

Collapsed teammate panels say "teammate" instead of showing a blank label.

You'll notice · Elsewhere

Model refusal fallback banner now also shown in non-main threads #

You now get told when a subagent swaps models after a refusal, not just the main thread.

You'll notice · Models

Telemetry model-name sanitizer accepts a bracketed context suffix #

Telemetry now records long-context model names properly instead of labelling them nonconforming.

Under the hood · Telemetry

Bug Fixes

15 items

Design OAuth refresh distinguishes lock contention from failure #

Design sign-in refreshes no longer report a failure when another process just got there first.

You'll notice · Elsewhere

Duplicate comment ids are dropped when building thread views #

Comment threads no longer show the same comment twice.

You'll notice · Elsewhere

File watcher no longer emits errors nobody is listening for #

File watching errors no longer blow up as unhandled crashes when nothing is listening for them.

ignorePermissionErrors
You'll notice · File Watcher

Permanently refused agent resumes stop retrying #

An agent that can never resume now fails fast instead of retrying forever in the background.

You'll notice · Agents

Worktree cleanup will not chdir into a network path #

Cleaning up a worktree no longer tries to switch into a network drive path, falling back to your home directory.

You'll notice · Worktrees

Agent records remember that their worktree was cleanly removed #

Resuming an agent whose worktree you deliberately removed no longer warns about missing worktree state.

You'll notice · Worktrees

Blank message summaries are ignored #

Messages with a blank summary now show their full text instead of collapsing into an empty line.

You'll notice · Transcript

Active MCP server/tool markers are cleared on conversation reset #

Errors after a conversation reset are no longer mislabelled with the MCP server and tool from a previous turn.

You'll notice · MCP

File watcher teardown no longer assumes a watcher exists #

A crash when unwatching a file that was never actually being watched is fixed.

You'll notice · Elsewhere

Pending-permission cleanup respects a preserved park at shutdown #

Answering the last permission prompt no longer wrongly flips your session back to running when a question is still waiting.

You'll notice · Permissions

Mismatched permission replies are logged and dropped #

A permission answer meant for one tool can no longer accidentally approve a different tool call.

You'll notice · Permissions

Tunnel sockets are destroyed on protocol violations #

Misbehaving tunnel connections are torn down properly instead of leaving stuck half-open sockets behind.

You'll notice · Elsewhere

Dismissed usage credit requests no longer block the flow #

If you dismissed a usage credit request, you can now ask again instead of being told one was already sent.

You'll notice · Usage & Limits

Worktree sessions record a launch anchor and use it when leaving #

Leaving a worktree session now reliably drops you somewhere sensible even if the original directory is gone.

You'll notice · Worktrees

Tunnel sockets are always destroyed on close #

Tunnel connections that close before a response always shut down now, instead of lingering.

You'll notice · Elsewhere

In Development

7 items

claude import is stubbed out in this build #

The import command exists but just prints a message instead of starting a session here.

claude import--yes/import
Not switched on · Internals

More state gains v5-backed code paths #

Themes, settings, tasks and transcripts gained alternative storage paths that stay dormant without a backend.

Under the hood · Internals

Codex config import parses TOML with Bun's built-in parser #

Importing another agent's config now parses TOML natively, reachable only through the gated import path.

tengu_import
Not switched on · Internals

Telemetry retry batches can persist as v5 streams #

Failed telemetry batches can be stored and retried differently, but only with a backend that nothing here supplies.

Under the hood · Telemetry

Transcript writes and head/tail reads can go through the v5 storage backend #

Transcript writing can be redirected to a different storage layer, but nothing turns that on here.

Under the hood · Internals

SDK stream shutdown can preserve parked permission requests #

Pending permission prompts can survive an SDK stream closing instead of vanishing.

Under the hood · SDK

Internal Changes

23 items

Heartbeat-failure streak detection in the CCR client #

Dropped connections are detected by counting repeated heartbeat failures instead of reacting to one.

Under the hood · Elsewhere

Peer-message envelope text moved into constants #

Wording around messages from other sessions moved to one place, with an extra old header now stripped.

Under the hood · Sessions

Version bumped to 2.1.222 #

The version number moves to 2.1.222, which is what you'll see in /status and --version.

/status--version
Under the hood · Elsewhere

New telemetry when a remote session renders a tool result #

Remote sessions now report once when they first show a tool result.

Under the hood · Telemetry

Marketplace schema loosened for features and doc fallbacks #

Marketplace entries with odd values in two fields now pass parsing instead of being silently discarded.

Under the hood · Elsewhere

Artifact comment auto-scan tracks its in-flight promise #

Artifact comment scans now track their running work so overlapping scans can be spotted.

Under the hood · Artifacts

Atomic writer can publish without clobbering #

File writing gained a mode that refuses to overwrite an existing file instead of replacing it.

Under the hood · Elsewhere

Transcript conversion dropped its viewerOnly/convertToolResults mode #

Transcripts now show tool results the same way everywhere, instead of differing in viewer-only sessions.

You'll notice · Sessions

Shell adoption accepts an extra output root #

Shell sessions can hand off through more than one output location internally.

Under the hood · Elsewhere

Model enforcement stays inactive for the parent settings source #

Model restrictions won't kick in when your settings come from a trusted parent source.

Under the hood · Settings

Turn-effort updates can skip creating an entry #

Empty effort updates no longer leave junk state behind for each agent.

Under the hood · Elsewhere

Prefilled-prompt warning notification rendered from text segments #

The external-link prompt warning is built differently but looks exactly the same.

Under the hood · Terminal UI

Tool-input string extraction hardened against hostile objects #

Reading tool inputs is now hardened so a crafted object cannot run code during extraction.

Under the hood · Permissions

Shell output handoff can be re-rooted for adoption #

Background shell output can be relocated so another process adopting the task can still read it.

Under the hood · Elsewhere

Code-review, /simplify and batch orchestration prompts moved between modules #

Three prompt texts moved between files with their wording intact, so nothing changes for you.

/simplify
Under the hood · Elsewhere

Status-line notices moved from JSX to a segments array #

Status-line notices are now built as plain text pieces, so they render more consistently.

Under the hood · Terminal UI

Bridge connect timeouts are classified for recovery reporting #

Remote connection timeouts now record whether they happened during recovery or a token refresh.

Under the hood · Remote Control

Workflow prompt interpolates the parallel/pipeline item cap #

The workflow prompt now quotes the real item cap, so the stated limit matches the enforced one.

Under the hood · Elsewhere

Remote-io warns when the drop sender notice cannot be written #

A failed remote notice write now logs a warning instead of disappearing silently.

Under the hood · Remote Control

Agent state writes preserve worktree provenance #

Agent records keep their worktree history across saves, so lineage info no longer gets wiped.

You'll notice · Worktrees

Settings reader computes a host model overlay #

Settings can inherit a model choice from a managing host, though that path only exists when one is configured.

Under the hood · Settings

Named ANSI colors backed by an object literal #

Terminal color names are stored differently; nothing changes for you.

Under the hood · Elsewhere

Task output files use a memoized path and lazy directory creation #

Task output files skip repeated path work and only create folders when actually writing.

Under the hood · Elsewhere

Removed

2 items

"Permission denied" system messages are no longer surfaced #

You no longer see a "permission denied" line in output when a tool is blocked.

You'll notice · Permissions

Resume no longer validates or touches the worktree directory #

Resuming a session skips worktree checks, so no fallback to the parent folder or log line.

You'll notice · Sessions