Anthropic · 2026-11-03 · notable
Claude Code 2.1.317 — gateway cost report and blocking Agent SDK hooks
In short
Claude Code 2.1.317 adds a cost report to the Claude apps gateway admin API, lets failed Agent SDK hook callbacks block an action, and asks before a tool call sends your account email to the network.
Anthropic · 2026-11-03 · 1 source checked

Claude Code 2.1.317 gives gateway admins a spend report and lets Agent SDK hooks fail closed.
What is it?
The Claude apps gateway admin API gets a cost report in Claude Code 2.1.317: GET /v1/organizations/analytics/cost reads past spend over a date range, in total, per developer, per day or per IdP group. The release also adds onFailure: "block" for Agent SDK hook callbacks, so a callback that fails stops the action instead of letting it run.
How does it work?
To group spend by team, gateways with admin set now keep a daily record of each developer's IdP groups for admin.identity_retention_days. A new check asks before a web or shell tool call sends your account email address to the network, and OTel metrics, events and spans gain plan, seat type, provider and custom base URL attributes.
Why does it matter?
Companies that route Claude Code through a gateway can now answer "who spent what" from the API instead of the dashboard, and SDK users can make security hooks fail safe. Most of the rest of the release is fixes, including MCP servers disconnecting in desktop sessions and claude -p exiting 0 after a failed transcript write.
Who is it for?
teams running Claude Code behind a company gateway or the Agent SDK
Try it
npm i -g @anthropic-ai/claude-code@2.1.317