Claude Code 2.1.317 lets a failing Agent SDK hook block the action, and asks before your email leaves the machine
The release hit npm Monday at 6:57 PM ET. It also adds a cost report to the Claude apps gateway admin API and changes how subagents on a different model pick their effort level.
Claude Code 2.1.317 was published to npm on November 2 at 23:57 UTC (6:57 PM ET), with the GitHub release about 90 minutes later.
The change we'd look at first: Agent SDK hook callbacks now accept onFailure: "block". Before this, a callback that failed let the action run. With the new setting, a broken callback stops it instead. A second safety change asks before a web or shell tool call sends your account email address to the network, and /schedule now warns when a new cloud scheduled task picks up connectors you didn't ask for, with steps to remove them.
For teams on the Claude apps gateway, there's a cost report at GET /v1/organizations/analytics/cost, with totals per developer, per day or per IdP group over a date range.
Two behavior changes could show up in your sessions. Subagents and teammates on a different model from the main conversation now use that model's saved effort level (or its default) instead of the session's. And the Read tool no longer returns a short "file unchanged since your last Read" stub: reading an unchanged file again returns its full content.
Among the fixes: claude -p used to exit 0 when a full disk or quota lost its transcript writes, and now prints an error and exits 1. claude auth status no longer exits before a slow token refresh is saved, which could sign you out on the next run.
Why it matters for builders
If you use SDK hooks to deny risky actions, a crash in the hook used to mean the action went through. That's the opposite of what a guard should do, and now it's one setting to fix.
Try this
Run claude --version and update to 2.1.317. Add onFailure: "block" to each Agent SDK hook callback that exists to deny an action, then make one callback throw on purpose and check that the action stops.
Sources
Get stories like this every Monday
One tested AI workflow with the prompts, plus 3 news items that matter if you build. Free.
More AI news
- Trajectory raises $45M led by Sequoia to keep retraining open models on feedback from your app
- NorthCUA puts three open computer-use models on Hugging Face under Apache 2.0, from 9B to 397B
- Meituan releases LongCat-2.5, a 1.6T-parameter agent model trained on Chinese chips, API only for now
- Claude's Messages API can now hold a conversation server-side, so agents send only the new turn