Claude Code v2.1.317: a prompt before tools send your email, SDK hooks that block on failure#

Published by

Part of the Claude Code Version Tracker series. | Official Env Vars | Official Changelog

Claude Code v2.1.317, covering the two builds published since v2.1.315, adds a confirmation prompt before a web or shell tool call sends your signed-in account email address off the machine, an onFailure: "block" setting for Agent SDK hook callbacks, and CLAUDE_CODE_DISABLE_NESTED_SESSION_ID so a nested claude -p can reuse its parent session's ID and transcript.

A prompt before a tool call carries your email off the machine#

A web or shell tool call now asks before it runs when its input carries the email address of the signed-in account. The check covers the web tools (WebFetch, WebSearch, WebBrowser) and the shell tools (Bash, Monitor, PowerShell, Tmux), and it matches the account address in the call's input, including a URL-encoded form.[1] You can allow the call or decline it.

SDK hook callbacks that block, and a nested-session switch#

Agent SDK hook callbacks take a new onFailure: "block" setting. A callback that fails blocks the action it was checking.[1]

CLAUDE_CODE_DISABLE_NESTED_SESSION_ID controls how claude -p behaves inside another session. A claude -p started inside a cloud or self-hosted runner session now gets its own session ID and transcript; set the variable to 1 on a self-hosted runner and it uses that session's ID and transcript, as earlier versions did.[1] The default change also fixes a nested claude -p writing into its parent's transcript, which could resume the wrong conversation after a restart.

Reading an unchanged file returns its content#

The Read tool's "file unchanged since your last Read" stub is removed; reading a file again with no change since returns its content.[1]

Fast mode for Opus 4.8 is deprecated as of October 30, 2026 and will be removed on November 30, 2026. After removal, a fast-mode request on Opus 4.8 returns an error and does not fall back to standard Opus 4.8; Opus 5.5 keeps the speedup.[2]

Spend reporting and OpenTelemetry attributes#

The Claude apps gateway admin API gains a cost report at GET /v1/organizations/analytics/cost, which reads past spend over a date range in total, per developer, per day, or per IdP group.[1] Gateways with admin: set keep a daily record of each developer's IdP groups for admin.identity_retention_days, which the report groups by. OTel metrics, events, and spans add anthropic.plan, anthropic.seat_type, anthropic.provider, and anthropic.custom_base_url.[1] v2.1.316 added pooled group budgets, one monthly budget a group's members share on top of each member's own limit, set with pooled_budget on the spend-limits admin API.[2]

Reconnection and session recovery#

Several fixes target self-hosted runners. After a 5xx other than 501 or 529, a runner and its sessions open a new connection on the next poll, and a session opens new connections after a heartbeat goes unanswered.[1] Auto mode gains a notice when its check returns no answer for a subagent's tool call, a case that used to leave nothing in the main view.[1]

New environment variables#

VariableWhat It Does
CLAUDE_CODE_DISABLE_NESTED_SESSION_IDOn a self-hosted runner, set it to 1 so a claude -p started inside a session uses that session's ID and transcript. Left unset, a nested claude -p gets its own session ID and transcript.
CLAUDE_CODE_DISABLE_MCP_TASKSSet it to turn off the MCP tasks feature. When set, Claude Code reports the feature as off; left unset, the feature is decided by Claude Code's usual rollout check. Not named in the release notes.

Two boundaries: what leaves the machine, and which session a run belongs to#

The release draws two lines. The email prompt and the onFailure: "block" setting govern what a tool call is allowed to carry out before it runs. The nested-session default, the runner reconnection changes, the fix that restores a self-hosted runner session's recent turns after a restart, and the fix that keeps a cloud or SDK session's title when a new message or Stop arrives govern which conversation a run belongs to.

For anything unattended, both lines shift on upgrade. A script that pipes the signed-in account's address through a web or shell tool now stops for a prompt, and a self-hosted claude -p that counted on sharing its parent's transcript gets its own session ID unless CLAUDE_CODE_DISABLE_NESTED_SESSION_ID is set. A runner upgrading from v2.1.315 is worth a check on both.

This analysis is conducted for educational and research purposes under fair use principles. All trademarks and software referenced belong to their respective owners.

Sources#

  1. Claude Code Official Changelog, v2.1.317 release notes
  2. Claude Code Official Changelog, v2.1.316 release notes

Previous Claude Code analysis: v2.1.315 (October 31, 2026)

All 85 Claude Code analyses: Claude Code Version Tracker · Official Claude Code changelog