Worktree isolation hardens git restrictions; MCP usage tracking fixed. Background task tool-bypass closed — dual focus on security & measurement.
Claude Code v2.1.222 Release — Fixes to Worktree Isolation and Tool Restrictions
Original: v2.1.222
Importance: セキュリティ脆弱性と複数の運用上の問題修正。既存ユーザーには強く推奨されるが、即座の本番停止を要求する重大障害ではない。
Summary
Anthropic released Claude Code v2.1.222 with 20 bug fixes and improvements. Key fixes include: worktree-isolated sessions can no longer run destructive git commands against the main checkout; PreToolUse auto-allow hooks no longer bypass tool restrictions in background tasks; `/usage-credits` no longer blocks new requests after dismissed ones; and MCP server usage attribution now accurately reflects only requests that consumed the server's tool results. Focus is on security hardening and operational stability.
Key Points
- Worktree isolation now blocks destructive git commands against main checkout
- PreToolUse auto-allow hooks no longer bypass tool restrictions in background tasks
- MCP server usage attribution now reflects only requests consuming tool results
- Session-to-GitHub-PR linking fixed; connectivity check no longer hangs
- 20 cumulative fixes improve stability and operational reliability
View developer notes (APIs, breaking changes, migration)
v2.1.222 hardens session isolation: worktree-isolated sessions and subagents can no longer execute destructive git commands against the main checkout. PreToolUse auto-allow hooks no longer bypass tool restrictions in background tasks (summaries, compaction, renames). MCP server usage attribution fixed to count only requests that consumed tool results (not every turn post-call). Additional fixes: `/usage-credits` UX for dismissed requests, stream idle timeout handling on custom ANTHROPIC_BASE_URL gateways, org-restricted model family aliases stepping down correctly, SendMessage auto-truncation for long summaries, claude.ai connector auth state reporting, and screen reader echo performance in --ax-screen-reader mode.
Source: https://github.com/anthropics/claude-code/releases/tag/v2.1.222
Outlet: Claude Code Releases
This article is an AI-generated summary (OpenAI GPT-4o-mini) of publicly available information from Anthropic, OpenAI, Google, Meta, Mistral, DeepSeek, Sakana, and other vendors. The original source URL is always provided in accordance with fair-use citation requirements. Summaries are AI-generated and may contain mistranslations or misinterpretations. Always verify details with the original source.