Skip to content

Claude Code

Claude Code 2.1.318: login expiry warning, runner log change

4 min read

Written by an AI model from the linked sources and checked against them by a second model. How we work

All about: Claude Code versions and changes →

Claude Code 2.1.318, in the GitHub release notes published November 4, shows unattended jobs when their stored claude.ai sign-in will run out. The date appears as loginExpiresAt in claude auth status and as credential_expires_at in claude -p JSON results. On self-hosted runners, scripts that match retryable=true: or retryable=false: in the orchestrator’s logs stop matching, because nack lines now end their fields with reason=… after retryable=….

Sign-in expiry in claude -p

Text output from claude -p also gets a one-line warning on stderr, starting 10 days before the stored sign-in ends. A pipeline that parses JSON results can read credential_expires_at on every run, so it doesn’t have to wait for that warning. When the limit is reached, the sign-in failure now says so, and in claude -p it names claude auth login and claude setup-token as the way back.

Several other login fixes affect the same jobs. Jobs no longer exit with “Not logged in” when another terminal or host signs in again to the same account and organization on the same home. claude plugin commands no longer exit before a slow token refresh is saved, which could sign you out on the next run. Tokens from setup-token are no longer refused at start on machines with forceLoginOrgUUID set, as long as the token belongs to a permitted organization.

Changes that need a script or habit adjusted

The runner’s ok session=… lines also moved: they now print at every log level on stdout, where before they went to stderr and only at debug level, and they carry reason=… after jti=…. The spawn-runner hook gets a new CLAUDE_RUNNER_SPAWN_REASON variable that says why Anthropic sent the request, for example runner_lost or resumed. It is unset when no reason was sent.

A non-interactive launch that finds a ~/.claude.json that isn’t valid JSON now fails, says how to restore the file and leaves it alone. Before, it replaced the file with defaults. So a CI job with a damaged config now stops instead of carrying on with a reset one. Other behaviour changes:

  • Claude Code no longer installs or updates the IDE extension when started in an IDE terminal. Use /ide from an outside terminal or your editor’s extensions view.
  • With “Switch models when a message is flagged” set to “Ask each time”, subagents now stop instead of switching models.
  • Background subagents move a shell command to the background after 3 minutes on all providers, so the prompt cache doesn’t expire while it runs.
  • deniedMcpServers URL entries now also block Anthropic-provided servers whose upstream URL matches, plus connectors in cloud sessions and on self-hosted runners, where the session gets the connector’s own URL. Any other connector has to be denied by name.
  • /claude-api managed-agents-onboard now gives a new agent’s built-in tools the auto permission policy (“Judge risky actions”) by default. Saying “run without asking” opts out.
  • Whatever a mod attaches at prompt.submit now stays in the user’s turn. It no longer goes out as a system message.

The release also removes the 2.1.288 fix that kept the model’s earlier thinking when resuming a conversation started on 2.1.286 or earlier. That thinking can now be dropped.

Shared network home directories

Many of the fixes are for homes on network file systems. /logout, claude auth logout and claude mcp remove used to report success when the config file couldn’t be updated, and changes to trust, consent or MCP settings were dropped without a message. A full network home that still accepted new files could replace the stored login with an empty file. Saves of ~/.claude.json, settings files and the stored login are now less often deleted, briefly emptied or replaced by a near-empty or older copy. The lock fix is only partial: claude mcp add and remove now wait for the config lock or exit 1, but another job’s save can still replace a saved server.

Unattended runs also stop rewriting ~/.claude.json on every run when nothing in it changed. On a home that only runs claude -p, retention cleanup now takes a fresh backup before deleting the last good one.

Other fixes

--continue no longer sometimes loses the earlier conversation after a malformed tool call’s retries run out, a regression from 2.1.314. macOS sessions with many running Bash commands no longer stall while memory grows. Keys typed just after sending a message, or before a slow prompt appears, no longer answer permission prompts. For mod authors, $.model.fork takes an effort option, so a quick side job can run at low effort whatever the session uses.

On the Claude apps gateway, mantle upstreams now accept assume_role. That covers a role in another AWS account and per-developer AWS cost attribution.

No comments yet. Be the first.

Join the conversation

Sign in to leave a comment. It appears after moderation.