Claude Code v2.1.317 Adds Cost Analytics API, OTel User Attributes, and Block-on-Failure Hooks

✍️ OpenClawRadar📅 Published: November 3, 2026🔗 Source
Ad

Claude Code v2.1.317 is a maintenance release with a handful of additions aimed at teams running the app through a gateway, monitoring via OpenTelemetry, or building on the Agent SDK.

Gateway cost reporting

The Claude apps gateway admin API now exposes GET /v1/organizations/analytics/cost. It returns past spend over a date range, broken down in total, per developer, per day, or per IdP group. To support the IdP grouping, gateways with admin: set now keep a daily record of each developer's IdP groups, retained for admin.identity_retention_days.

OpenTelemetry attributes

Four new attributes are attached to OTel metrics, events, and spans:

  • anthropic.plan
  • anthropic.seat_type
  • anthropic.provider
  • anthropic.custom_base_url

If you already scrape Claude Code telemetry into a dashboard, these let you split traces by subscription tier or by which provider/base URL the request went through.

Agent SDK hook behavior

Hook callbacks now accept onFailure: "block". Previously a failing callback let the action proceed; with this set, the failure blocks the action instead.

Privacy and scheduling guards

Two new prompts reduce surprise data exposure:

  • A check asks before a web or shell tool call sends your account email address over the network.
  • /schedule warns when a new cloud scheduled task picks up connectors you didn't request, and tells you how to remove them.

Also new: notices in Claude Desktop's Code tab when your organization's remote managed settings haven't loaded yet, and when they have. Auto mode now surfaces a notice when its check has no answer for a subagent's tool call, instead of leaving the main view empty.

Ad

Self-hosted runner escape hatch

Set CLAUDE_CODE_DISABLE_NESTED_SESSION_ID=1 on a self-hosted runner to make claude -p inside a session use that session's ID and transcript, restoring the pre-change behavior.

Notable fixes

  • Project and local MCP servers disconnecting after the first turn in some desktop sessions.
  • Auto mode failing every turn when an LLM gateway base URL returns 403/422 to the server-side safety check (403 with apiKeyHelper is unchanged).
  • claude auth status exiting before a slow token refresh saved, which could sign you out on the next run.
  • claude --from-pr reporting "No conversations found" for older linked sessions in projects with many sessions.
  • claude -p exiting 0 when a full disk or quota lost its transcript or ~/.claude.json writes; it now prints an error and exits 1 in text and json output. Full NFS exports may be missed.
  • Edits to settings files made in the first second or so after launch not taking effect until another settings change.
  • Old transcripts not cleaned up when runs skip cleanup, e.g. with --setting-sources.
  • Claude apps gateway hiding Bedrock's "Input is too long." error, which left sessions failing every turn with "upstream rejected the request" instead of compacting.

There are another dozen fixes for agent teams, /team-onboarding, /loop wakeups, cloud session titles, skills synced from claude.ai, and screen reader verbosity—the full list is in the release notes.

📖 Read the full source: GitHub Claude-Code

Ad

👀 See Also