Skip to main content
ClaudeREF.com
← All news
3 November 2026claude-code#claude-code#release#automation#security#hooks

Claude Code v2.1.317: safer scheduled tasks and stronger automation controls

Claude Code v2.1.317 warns about unexpected scheduled-task connectors, asks before sending account email, and adds failure-blocking Agent SDK hooks.

Claude Code v2.1.317 is a small but useful release for teams running scheduled, self-hosted, or programmatic agents. It adds confirmation around two easy-to-miss network boundaries, lets Agent SDK callbacks fail closed, and gives administrators more data for understanding gateway usage. The release also includes fixes for MCP sessions, authentication, long conversations, and telemetry delivery.

The changes that deserve attention

Scheduled tasks now surface unexpected connectors

When /schedule creates a new cloud scheduled task, Claude Code now warns if connectors were attached that were not requested. The warning also explains how to remove them. That is a practical review point: scheduled tasks run unattended, and connectors can expose tools—including write-capable tools—without a prompt during the run. Check the task’s connector list before relying on its next execution.

Network use gets an account-email confirmation

Claude Code now asks before a web or shell tool call sends the account email address to the network. This is a narrow privacy boundary, not a replacement for reviewing the destination or the tool’s full payload. If an automation needs to identify a user externally, make that data flow explicit and document the receiving service.

Agent SDK hooks can fail closed

Agent SDK hook callbacks now support onFailure: "block". With that setting, a callback failure blocks the action instead of allowing it to continue. This is valuable for approval, validation, and audit hooks where “the checker was unavailable” should not silently become “the operation ran.” Use it selectively: a telemetry-only hook may need availability-first behavior, while a policy or authorization hook should usually fail closed.

Self-hosted sessions can preserve the outer session identity

CLAUDE_CODE_DISABLE_NESTED_SESSION_ID=1 makes claude -p running inside an existing session use that session’s ID and transcript, as in earlier versions. The setting is specifically for self-hosted runners. Test it with the runner’s transcript and cleanup logic before enabling it broadly, because identity reuse changes how nested work is correlated and resumed.

Gateway operators get more visibility

The release adds anthropic.plan, anthropic.seat_type, anthropic.provider, and anthropic.custom_base_url to OpenTelemetry metrics, events, and spans. Claude apps gateways also gain a cost-report endpoint at GET /v1/organizations/analytics/cost, with totals and breakdowns by developer, day, or identity-provider group. Gateways with admin: configured record each developer’s IdP groups daily for that grouping. These are administrator-facing surfaces; they do not change the local CLI’s normal telemetry opt-in.

What to do before upgrading

Update a disposable or canary environment first. Review every connector on unattended scheduled tasks, confirm that account-email prompts behave as expected in your network policy, and set onFailure: "block" only on callbacks where continuing without a decision is unsafe. Self-hosted runner operators should test nested-session transcript correlation, while gateway administrators should verify that new OTel dimensions and cost reports fit their retention and access policies.

claude update
claude --version
claude doctor

The English item is reviewed against the official release notes and current Claude Code documentation. Hebrew and Spanish translations are AI-only drafts and remain unpublished until their terminology, technical tokens, links, and formatting receive review.

Claude Code v2.1.317 release notes · Environment variables · Agent SDK hooks · Scheduled tasks · Hooks reference · Claude Code documentation index