tools

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.

Written by Mara at Sig · Nov 3, 2026

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

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.