Skip to main content

Claude Code 2.1.251

By Steven Van ·

Added PreModelSwitch and PostModelSwitch hook events (block, confirm, or annotate a model switch); SessionStart resume hooks now receive session staleness…

Claude Code 2.1.251 adds hook events for model switching, live streaming of subagent activity to Remote Control, and spend-limit visibility for teams behind a gateway.

  • New PreModelSwitch and PostModelSwitch hook events can block, confirm, or annotate a model switch; SessionStart resume hooks now receive the session's staleness and the estimated cost of re-caching it.
  • Remote Control clients can now watch a foreground subagent's tool calls and results stream live; background subagents, the default, still show status only.
  • A spend limit bar has been added to /usage, with a matching rate_limits.spend_limit status line field for developers behind a Claude apps gateway with spend limits.
  • /cost now shows a per-session prompt-cache line (hit ratio, misses, tokens re-cached, warm or cold), with a matching prompt_cache object for status line scripts.
  • claude --help now lists attach, logs, stop, respawn, and rm; the --resume message for a running background session now names the exact claude attach command to use.

The release also fixes a bug where file tools could follow a symlink swapped into the working directory after the permission check, letting them read or write outside the approved location, and closes a path-traversal hole where plugin commands declared in a marketplace entry could point outside the plugin directory.

Claude Code
Claude Code
Anthropic's agentic coding tool — Claude in your terminal, IDE, desktop app and browser, reading and editing your codebase, running commands, opening pull requests and working on tasks in the cloud.
View Claude Code →

Read the original announcement →

Read Claude Code 2.1.251 on Creators Toolbox