shiichan

Claude Code v2.1.300 Arrives with Mod Extensions and OpenTelemetry Upgrades!

Hi, it's Shii-chan! Today we're looking at the new Claude Code release v2.1.300. It has a lot of changes, so I'll pick out the highlights!

Claude Code Release github.com

What was announced?

The Claude Code Release on GitHub published v2.1.300. It is a large release with many additions, fixes, and behavior changes.

The story so far

Here are the changes where the before and after are clear.

  • The agent.spawn mod hook could only refuse workflow agents before. Now it can rewrite the agent's prompt and model
  • Large requests to api.anthropic.com now use gzip compression even when telemetry is disabled. Set CLAUDE_CODE_GZIP_REQUEST_BODIES=0 to turn it off
  • On exit, background commands still running 1.5 seconds after being asked to stop are force-killed. In fullscreen mode they could previously be left running

What changes

Added features

  • Added virtualText to a mod's prompt decorations: text drawn in the prompt box that never enters the draft or the submitted prompt
  • Added $.ui.view({ agentId }) for mods to show an agent's transcript in the main view, and $.ui.view({}) goes back
  • Added a dir prop on a mod's Text for right-to-left text
  • Added the prompt.change mod hook, raised when the prompt box's text changes without a typed edit (a recalled history entry, a clear, an undo, or a plugin's fill)
  • Added /advisor on Claude Platform on AWS. No advisor runs until you pick one with /advisor, advisorModel, or --advisor, and CLAUDE_CODE_DISABLE_ADVISOR_TOOL=1 turns it off
  • Added cache_creation_5m_tokens and cache_creation_1h_tokens to the OpenTelemetry api_request event, splitting cache writes by lifetime
  • Added OpenTelemetry GenAI semantic-convention attributes to trace spans, such as gen_ai.provider.name, gen_ai.conversation.id, gen_ai.tool.name, and error.type
  • In VS Code, added the claudeCode.attachSelection setting to stop selected editor text from being added to your messages

Dive Deep

Here are some fixes and changes that may matter for operations.

  • Hook updatedInput: from PreToolUse and PermissionRequest hooks, it is now validated like Claude's own input. Unknown keys are dropped, and input the tool rejects denies the call
  • Fixed agent hooks ignoring their model: aliases like haiku now resolve, and an unavailable model falls back to the caller's
  • Around --worktree: fixed sessions sometimes starting from the wrong commit when a tag or branch was named like a commit ID, among other fixes. Also fixed the branch showing as .invalid in repositories using reftable ref storage
  • Fixed automatic tool search (ENABLE_TOOL_SEARCH=auto) turning off part-way through a conversation, for example while MCP servers reconnect
  • Fixed a conversation failing on every turn with a 400 error when the API rejected an MCP tool's input schema. Claude Code now sends that tool without parameters for the rest of the conversation
  • Fixed a login refused by forceLoginOrgUUID leaving the refused organization's token stored
  • Removed the --sandbox and --no-sandbox flags from claude remote-control, which had no effect. Passing either now exits with an error. Set sandbox.enabled in settings to sandbox sessions
  • The /sandbox mode option now reads "Sandbox commands" instead of "Sandbox BashTool"
  • Local session transcripts now also record each API request's system prompt, tools, and parameters

There are also Claude Tag changes such as Slack Connect channel support and Slack voice clips, and a Code Review fix for @claude review comments from people whose GitHub organization membership is private.

Wrap-up

  • Mod APIs and hooks were extended (virtualText, $.ui.view, dir, prompt.change, rewriting in agent.spawn)
  • OpenTelemetry gains cache-write tokens by lifetime and GenAI convention attributes
  • Many behavior fixes, including hook updatedInput validation, agent hook model, and --worktree
  • --sandbox and --no-sandbox were removed from claude remote-control

This release is for mod authors, people collecting telemetry, and heavy users of hooks and worktrees!