Claude Code v2.1.317 Adds Cost Analytics API, OTel User Attributes, and Block-on-Failure Hooks
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.plananthropic.seat_typeanthropic.provideranthropic.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.
/schedulewarns 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.
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
apiKeyHelperis unchanged). claude auth statusexiting before a slow token refresh saved, which could sign you out on the next run.claude --from-prreporting "No conversations found" for older linked sessions in projects with many sessions.claude -pexiting 0 when a full disk or quota lost its transcript or~/.claude.jsonwrites; 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
👀 See Also

Microsoft releases Phi-4-reasoning-vision-15B multimodal model with training insights
Microsoft Research has released Phi-4-reasoning-vision-15B, a 15 billion parameter open-weight multimodal reasoning model available through Microsoft Foundry, HuggingFace, and GitHub. The model balances reasoning power with efficiency and excels at math/science reasoning and UI understanding.

Claude Code v2.1.205: Transcript Tampering Blocked, JSON Schema Fixes, and Auto-Mode Improvements
Claude Code v2.1.205 adds auto-mode rule blocking session transcript tampering, fixes large JSON schema issues, improves background agents handling, and streamlines binary updates.

Agentic AI Failure Modes and Developmental Scaffolding
Agentic AI systems fail in production through alignment drift, context loss across handoffs, boundary violations, and coordination collapse. The source proposes a 'developmental scaffolding' approach with five components: coherence monitoring, coordination repair, consent and boundary awareness, relational continuity, and adaptive governance.

Agentic Web Index: AI Bot Traffic Stats Show Mass Scraping, Spoofing
Known Agents' new index reveals bots make up 35% of web traffic, AI-related bot traffic grew 12%, and attackers are spoofing AI agents like ClaudeBot to run mass vulnerability scans.