Claude Code 2.1.318 warns before your login dies in headless runs

The release also prompts before your account email leaves the machine, lets Agent SDK hooks hard-block on failure, and adds a per-developer cost API.

Nowline NOV 5 3:00 PM banner

Top AI stories from the last hour

Top AI stories from the last hour

Copy markdown

  • Headless runs stop dying on a silent logout

    A stored claude.ai sign-in now surfaces its expiry: `claude auth status` reports `loginExpiresAt`, `claude -p` JSON returns `credential_expires_at`, and you get a one-line stderr warning starting 10 days out. 2.1.318 also fixes jobs exiting with a bare “Not logged in” when another terminal re-signs in on the same home. If you run Claude Code in CI or on a schedule, your pipeline now warns you before auth lapses instead of failing mid-run.

  • A prompt before your account email hits the network

    Landing in 2.1.317, Claude Code now “asks before a web or shell tool call sends your account email address to the network.” That closes a quiet path where a tool invocation could ship your login email to an arbitrary host — you get a chance to deny it first.

  • A failing Agent SDK hook can now hard-block the action

    `onFailure: "block"` on Agent SDK hook callbacks means a hook that throws stops the action instead of letting it through. If you gate writes or shell calls behind a policy hook, a crash in that hook now fails closed, not open.

  • Read your Claude Code spend per developer over the API

    The Claude apps gateway admin API gains `GET /v1/organizations/analytics/cost`, returning past spend across a date range — in total, per developer, per day, or per IdP group. Team leads can wire Claude Code costs straight into a dashboard without scraping the console.

  • Cloud sessions start with no repo and read Actions logs

    2.1.318 adds a “No repository” option so an Anthropic-hosted cloud session can spin up without picking a repo, and fixes `gh run view --log` / `gh api` log reads that used to hit an unreachable redirect. Useful for throwaway scripting and for agents that debug CI failures.

  • Re-reading an unchanged file returns its contents again

    Claude Code dropped the Read tool’s “file unchanged since your last Read” stub — reading the same file twice now returns the full content, not a placeholder. Agent loops that re-read context no longer get a confusing empty response.