Claude Code 2.1.221‑2.1.226: Cross‑Session Messaging, Self‑Hosted Runner, and 8 Key Enhancements

Across six incremental releases (2.1.221‑2.1.226), Claude Code adds cross‑session messaging, a self‑hosted runner for on‑premise execution, independent worktrees via /fork, unified code‑review commands, a VS Code focus view, credential masking, background session commits, a ZIP plugin source, and detailed upgrade steps, with the author validating each change on a local 2.1.226 installation and outlining usage scenarios and security boundaries.

Tech Ocean
Tech Ocean
Tech Ocean
Claude Code 2.1.221‑2.1.226: Cross‑Session Messaging, Self‑Hosted Runner, and 8 Key Enhancements

Claude Code has progressed through six patch releases (2.1.221 → 2.1.226). The author confirms the installed version with claude --version and inspects the new CLI flags ( --capacity, --base-dir, lifecycle hooks, health checks) that appear in the local binary.

1. Cross‑Session Messaging: No More Manual Context Transfer

Starting with 2.1.224, agents can discover other sessions via ListAgents and send plain‑text notifications with SendMessage. The author illustrates a three‑task scenario (backend order API, frontend order page, integration tests) and shows how a change in session A ( orderStatusstatus) can be broadcast to sessions B and C using /list‑agents or its alias /peers. Version 2.1.225 adds proactive cross‑machine contact, allowing agents to locate remote sessions by name without waiting for an inbound message. Permissions are scoped per‑message; messages are not shared context, do not sync files, and cannot approve dangerous operations.

Claude Code 跨会话与跨机器消息的工作方式
Claude Code 跨会话与跨机器消息的工作方式

2. Self‑Hosted Runner: Running Code Inside Enterprise Networks

Version 2.1.224 introduces self‑hosted environments. Developers still trigger tasks from the Claude web, mobile, or desktop UI, but code checkout, file I/O, builds, and tool execution happen on servers, VMs, or containers under the organization’s control via the claude self-hosted-runner command.

✅ Required when the build must access internal networks.

✅ Needed for private artifact repositories or SDKs.

✅ Allows tests that call internal APIs, databases, or test environments.

✅ Guarantees repository copies and build artifacts stay on owned machines.

Only prompts, model replies, and tool results are sent to api.anthropic.com for inference; the control plane remains Anthropic‑hosted. The feature is limited to Team and Enterprise plans, requires enabling Claude Code on the web, supports GitHub checkout only, and cannot be used by Zero Data Retention organizations or for tasks such as Code Review or Claude Security.

3. /fork Worktree: Isolated Code Copies for Each Agent

The /fork command (added in 2.1.221) creates a separate Git worktree for a new session, preventing the new agent from sharing the checkout of the original session. Version 2.1.222 further isolates worktrees so that agents cannot execute destructive Git commands on the main worktree. While worktree isolation avoids runtime overwrites, Git conflicts still need manual resolution during merges.

Claude Code 使用独立 worktree 隔离主会话和分身
Claude Code 使用独立 worktree 隔离主会话和分身

4. /code‑review Ultra: Unified Entry for Code Review

Version 2.1.223 renames /review to /code-review. The command can be invoked with a review intensity (e.g., /code-review high 128) or the deepest mode /code-review ultra. When no intensity is supplied, the previous level is reused. The author advises using high for ordinary changes and reserving ultra for high‑risk modifications such as permission changes, concurrency, payments, or data migration, because deeper reviews increase latency.

5. VS Code Focus View: Collapsible Tool Summaries

Starting with 2.1.221, the Focus View (triggered by Ctrl + Alt + F or the command palette entry “Claude Code: Toggle Focus view”) collapses each tool step into an expandable summary while preserving live status. Version 2.1.225 fixes a folding bug that previously hid pending tasks and answered questions.

6. Credential Masking: Hiding Secrets in Commands and Logs

Version 2.1.221 adds sandbox credential masking on Linux and WSL: files containing credentials are replaced with placeholders during reads, and the sandbox proxy injects the real values when sending requests. Version 2.1.224 refines the rules with specific masking directives ( extract, decode: "jwt", awsPairs, sigv4) that require the network.tlsTerminate flag and appropriate --settings. macOS only supports a “mask” mode that blocks reads entirely. The feature reduces plaintext exposure but does not replace other security practices such as least‑privilege, network egress controls, log sanitization, and key rotation.

7. Background Sessions Commit Work

Version 2.1.221 changes background sessions to automatically git commit and git push their work, creating a Draft PR only when explicitly requested. The commit policy follows rules defined in CLAUDE.md, e.g., only commit to task branches, forbid direct main pushes, disallow force‑push, run tests before committing, and avoid unrelated changes.

8. ZIP Plugin Source: Deploy Internal Plugins Without Git or npm

Version 2.1.224 adds an archive plugin source. Teams can host a ZIP file at an HTTPS URL, optionally pinning a SHA‑256 checksum. This simplifies distribution of internal Skills, Hooks, and MCP configurations, offering integrity verification without the overhead of a Git repository or npm publishing. However, ZIP plugins may still contain executable code, so source whitelisting and version pinning are recommended.

9. Upgrade Checklist for 2.1.226

Verify the installed version with claude --version.

Open two distinct task sessions, run /list‑agents, and send a non‑sensitive test message to confirm cross‑session discovery.

Use /fork to create a worktree, modify different files in each session, and observe that they do not interfere during execution.

Run /review on a real diff; for high‑risk changes, try /code‑review ultra instead of defaulting to the strongest level.

If you work mainly in VS Code, enable Focus View for a cleaner workflow.

The author concludes that the six releases collectively shape a collaboration boundary: sessions know where to send messages, forks know which codebase to operate on, background tasks reliably persist results, enterprises can host execution environments, and security administrators gain finer‑grained permission and credential controls.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

code reviewAI code assistantworktreeClaude Codecross-session messagingcredential maskingself‑hosted runner
Tech Ocean
Written by

Tech Ocean

Focused on AI programming, sharing ready-to-use development efficiency solutions.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.