shiichan

Claude Code v2.1.317 Is Out: Email Address Check and a Cost Report API

Hi everyone, it's Shii-chan! A new Claude Code release, v2.1.317, is out. It's packed, so let me pick out the highlights!

Claude Code Release github.com

What was announced?

v2.1.317 was published as a GitHub release for Claude Code. It includes new features, a long list of fixes, and a few improvements and changes.

What changes

First, additions around privacy and safety:

  • A web or shell tool call now asks first before it sends your account email address to the network
  • Agent SDK hook callbacks get onFailure: "block", so a callback that fails blocks the action instead of letting it run
  • /schedule warns you when a new cloud scheduled task gets connectors you did not ask for, and explains how to remove them
  • When auto mode's check has no answer for a subagent's tool call, a notice now appears in the main view

There are also additions for running it in an organization:

  • OTel metrics, events, and spans gain anthropic.plan, anthropic.seat_type, anthropic.provider, and anthropic.custom_base_url
  • The Claude apps gateway admin API gets a cost report, GET /v1/organizations/analytics/cost, for reading past spend over a date range in total, per developer, per day, or per IdP group
  • On Claude apps gateways with admin: set, each developer's IdP groups are recorded daily and kept for admin.identity_retention_days, and the cost report groups by them
  • Claude Desktop's Code tab shows a notice when your organization's remote managed settings haven't loaded for the session, and another once they do

Dive Deep

New environment variable

This one matters if you run claude -p on a self-hosted runner:

CLAUDE_CODE_DISABLE_NESTED_SESSION_ID=1

Set to 1, a claude -p run inside a session uses that session's ID and transcript, as in earlier versions.

Notable fixes

There are a lot of them, so here are the standouts:

  • Project and local MCP servers disconnecting after the first turn in some Claude desktop sessions
  • Auto mode failing every turn when an LLM gateway set as the base URL answers 403 or 422 to its server-side safety check
  • claude auth status exiting before a slow token refresh was saved, which could sign you out on the next run
  • claude -p exiting 0 when a full disk or quota lost its transcript or ~/.claude.json writes; it now prints an error and, in text and json output, exits 1
  • Stdio MCP servers receiving an empty AWS_BEARER_TOKEN_BEDROCK when their env config sets it to empty; the variable is now unset, so the server can use the machine's own AWS credentials
  • API requests failing with unable to get local issuer certificate behind some TLS-inspecting proxies after a root certificate renewal
  • OpenTelemetry exports hanging indefinitely behind a proxy that never answers; they now time out after 10 seconds, or OTEL_EXPORTER_OTLP_TIMEOUT up to 30 seconds
  • Claude treating partial Grep and Glob results as complete when a search hit its time limit

Improvements and changes

  • The Resume this session with hint at exit repeats the flags you launched with (for example --chrome --debug) ahead of --resume
  • After a 5xx other than 501 or 529, self-hosted runners open a new connection instead of reusing the one that failed
  • Subagents and teammates on a different model from the main conversation use that model's saved effort level or its default, instead of the session's effort level
  • A message sent with SendMessage to a running background agent arrives earlier; its running command moves to the background without being stopped
  • The Read tool's file unchanged since your last Read stub is removed, so reading an unchanged file again returns its content

There are also fixes for Windows, VS Code, cloud sessions, Remote Control, and Claude Tag. See the original release notes for the full list.

Wrap-up

  • A confirmation now appears before your account email address is sent to the network
  • Agent SDK hooks get onFailure: "block"
  • Claude apps gateways get a cost report API and IdP group records
  • OTel gets new anthropic.plan-style attributes and tidier timeouts
  • Many bugs are fixed, mostly around self-hosted runners, MCP, auth, and proxies

If you run Claude Code across an organization, or work with the SDK and gateways, this release is for you!