Claude Code 2.1.251 streams subagent work live

Claude Code 2.1.251 adds two hook events, PreModelSwitch and PostModelSwitch, which can block, confirm or annotate a model switch, according to the release notes on Github published August 28. The release also shows prompt-cache costs in /cost, in status line scripts and in the hooks that run when a session resumes.
Hooks around a model switch
In Claude Code, a hook is a shell command, HTTP endpoint, MCP tool call, prompt or subagent that runs at a fixed point in the session lifecycle. When the event fires, Claude Code passes the handler JSON describing the event, Anthropic’s hooks documentation says. The same events fire in the terminal, the IDE extensions, the Desktop app and cloud sessions. For tool calls the mechanism is already familiar: a PreToolUse hook that exits with a blocking status stops the call whatever the model intends. The two new events give a hook the same kind of control over switching models.
SessionStart also gets new inputs. That event already fires when a session starts or resumes. On resume, its hooks now receive how stale the session is and the estimated cost of re-caching it.
A few other model-related items come with the new events:
/effortnow saves a default effort level for each model, so each model keeps its own setting when you switch.- Opus 5 requests with effort at xhigh or max and thinking turned off used to fail with “effort … is not supported when thinking is disabled”. In that case effort is now sent as high.
- The tip “switch to Opus 1M for 5x more context” no longer shows when the current Opus model already has a 1M context window.
- Cloud sessions stop telling Claude the model has changed when the host is only setting the session’s initial model.
Cache costs in /cost
/cost gains a prompt-cache line for each session. It shows the hit ratio, the number of misses, the tokens that were re-cached, and whether the cache is warm or cold. Status line scripts get the same data as a prompt_cache object. Version 2.1.248 had already added a per-agent prompt cache TTL through experimental.cacheTtl in agent frontmatter, with values of “5m” or “1h”. Version 2.1.251 shows how that cache is performing.
Developers behind a Claude apps gateway with spend limits get a Spend limit bar in /usage and a rate_limits.spend_limit field for the status line. Gateway sessions also stop treating a stored Anthropic profile, such as a Console sign-in, as active. Before the fix, that profile was listed in /status and used to retry gateway 401 errors, even though requests never used it. A separate fix covers Team and Enterprise members whose admin set the org’s usage-credit limit to $0: /usage-credits now offers to ask the admin instead of saying a cap was reached.
Subagents, teams and Remote Control
Remote Control clients now get a live stream of a foreground subagent’s tool calls and results. Background subagents, which are still the default, show status only. In the VS Code extension, the Remote Control banner is replaced by a footer pill. It appears while Remote Control is on or has failed, opens the session on claude.ai/code, and is toggled with /remote-control.
Messaging between agents gets several fixes. In agent teams, a teammate’s final answer used to stop short of the team lead, which got a content-free “available” notice. The answer now arrives in the idle notification. Background subagents can now reply to an unnamed sibling or parent agent; the cause, per the notes, was that “from was the agent type, which is not an address.” Messages from your own subagents are framed differently too: Claude is told the sender is a worker inside the current session and not an unrelated Claude session.
CLAUDE_CODE_SUBAGENT_MODEL changes meaning. It used to override the model for every subagent. Now it only sets the default, and both an agent definition’s model: field and an explicit per-spawn model take precedence over it. If you used the variable to force one model across all subagents, that no longer holds.
The release also fixes TUI lag when many subagents run in parallel: per-second progress ticks now replace the previous tick instead of piling up in the transcript. Background sessions and their subagents can now edit files inside a git worktree they created with git worktree add. Backgrounded sessions started with ←, /background or --bg used to lose a Vertex or Bedrock gateway exported in the shell, so every request failed; they now keep it. Another fix stops claude --bg --model fable on Max plans from asking for usage credits while the interactive session on the same account still had Fable allowance. claude --help now lists attach, logs, stop, respawn and rm, and for a background session that is still running, the --resume message gives the exact claude attach <id> command.
Symlinks, plugins and settings
The security fixes include a race in the file tools. Read, Write and Edit could follow a symlink that was swapped inside the working directory after the permission check had passed, which let them read or write outside the approved location. Grep and Glob had a related gap: they did not apply Read(...) deny rules to files reached through a symlinked search path. The Workflow tool could read a scriptPath outside what the session was allowed to read, and quote it in errors, before its permission check ran.
Plugin commands declared in a marketplace entry could point outside the plugin directory. Those paths are now rejected with a path-traversal error. Bash permission checks used to auto-approve commands that assign an arithmetic expression to an integer shell variable, such as OPTIND=1/0 or RANDOM=2+2. Those now prompt for approval.
Project settings can no longer turn on detailed beta tracing or raw API body logging, and a lower-scope beta tracing endpoint can no longer bypass an OTLP collector pinned by managed settings or a host app. More settings now need approval:
- Server-managed settings that terminate sandbox TLS, route sandbox traffic through your own proxy, inject credentials or weaken sandbox isolation require approval before they apply.
ANTHROPIC_CUSTOM_HEADERScoming from managed or project settings requires approval when it sets a credential, org or tenant, routing, or API-behavior header, such asAuthorizationorHost.- The managed-settings approval dialog now lists only the settings that changed since you last approved them, and it no longer reappears after you sign in again to the same gateway with unchanged settings.
Bash output files for sandboxed commands are now created and read back in a new way, so a sandboxed command cannot redirect or replace them. Claude in Chrome sends browser actions through Claude Code’s permission checks in every case; sessions with telemetry disabled previously used the Chrome extension’s own prompts.
Defaults that moved
Seat-based Enterprise subscriptions now default to Opus 5, the same as other premium plans. When the active model isn’t a recognized Claude model, for example a third-party model behind a custom ANTHROPIC_BASE_URL, the default commit trailer becomes Co-Authored-By: Claude Code. /radio is now available on Bedrock, Vertex AI, Foundry and Claude Platform on AWS, and with telemetry disabled. On those providers and with telemetry off, the footer PR badge calls the GitHub API directly with gh auth token, GH_TOKEN or GITHUB_TOKEN instead of running gh pr view.
The native binary is about 5 MB smaller, and dropping syntax highlighting for six rarely used languages (1c, gml, isbl, mathematica, maxima and sqf) takes off another 2.5 MB. Other fixes cover conversations stuck on “text content blocks must be non-empty” after a thinking-only turn, and SDK and cloud sessions that hung forever when an SDK MCP server’s handshake acknowledgment was lost. That wait now times out after 70 seconds and marks only that server as failed. Session transcripts are no longer silently overwritten when a directory change moves a session onto an existing transcript with the same ID.
The env block in a project-level .claude/settings.json no longer sets CLAUDE_CONFIG_DIR, CLAUDE_CODE_TMPDIR, or TMPDIR, TMP and TEMP. Those now go in your shell, your user settings or managed settings.
Up next
Open weights land as a dry run for Qwen4
Alibaba opened the weights of Qwen3.8-Flash-Next and called it “an early preview of the architecture used in Qwen4”, the role Qwen3-Next played for Qwen3.5. Training it took around one-ninth of Qwen3.7-Plus’s resources.
Related stories
- --restricted strips code execution from Claude Code 2.1.248
- Claude Code 2.1.259 hands MCP servers to the whole org
- Claude Code 2.1.326 runs Code Mode with agent teams on
- Claude Code’s Code Mode runs tool calls as JavaScript
- Claude Code Projects: proactive coordinator, /btw, /fork
- Claude Code 2.1.323 lets Claude call tools via JavaScript
Comments
No comments yet. Be the first.
Join the conversation
Sign in to leave a comment. It appears after moderation.

