Source · release

Claude Code release 2.1.311

Author
Anthropic
Published
26 October 2026
Added
27 October 2026
Original
https://github.com/anthropics/claude-code/releases/tag/v2.1.311

Summary

Claude Code 2.1.311 was released on 2026-10-26 (21:51 UTC). It is mostly fixes, but it changes what ultrathink does, and it stops standard-context sessions from failing when a request goes over 200K tokens. It also fixes subagents and MCP servers, hooks, and compaction. The TypeScript Agent SDK 0.3.311, released the same day, matches this version and splits cache-write token counts by cache lifetime.

Key points

  • ultrathink = xhigh effort: in the interactive terminal, typing ultrathink now runs that turn at xhigh effort on Opus 5.5, Sonnet 5.5, Haiku 5.5, and Fable 5.1 (on Anthropic's API). If you type it while Claude is working, the rest of that turn runs at the higher effort. The rainbow highlight shows only where the keyword can raise effort.
  • No more "Usage credits required for 1M context": standard-context sessions that pass 200K tokens now compact and carry on instead of stopping.
  • Subagents and MCP: subagents can use tools from MCP servers that finish connecting after the subagent starts. A subagent's worktree is no longer removed while a background subagent it started is still using it.
  • Hooks: SubagentStop hooks now run once, when the subagent finishes. Before, they ran about twice a minute for each running subagent.
  • Memory files: after automatic compaction, Claude no longer sees outdated MEMORY.md and CLAUDE.md content when those files were edited earlier in the session. Very long list items in CLAUDE.md no longer freeze Claude Code at startup or after edits.
  • Shell timeouts: a command that hits its timeout now returns the output so far and says it is still running in the background.
  • Retries: Claude Code no longer retries requests the API marks as not retryable, which could block unattended runs (CLAUDE_CODE_RETRY_WATCHDOG) indefinitely.
  • Cloud providers: on Bedrock, Mantle, Vertex, and Foundry, model settings now come from a signed file on downloads.claude.ai. Set CLAUDE_CODE_MODEL_CATALOG=off to turn this off.
  • Self-hosted runner: new --hold-idle-file and --max-hold-min options keep an idle session while the host reports processes it left running.
  • VS Code: syntax colouring in replies. Custom skills and slash commands sent from the VS Code or JetBrains panel now include the open file or selection.
  • Agent SDK (TypeScript) 0.3.311: ModelUsage gains cacheCreationEphemeral5mInputTokens and cacheCreationEphemeral1hInputTokens, and the minimum Node.js version is now 18.14.0 (npm install @anthropic-ai/claude-agent-sdk@0.3.311). The Python SDK had no matching release by 2026-10-27.

Why it matters

ultrathink is now a quick way to get xhigh effort for one turn without changing /effort. The 200K fix and the retry fix remove two ways a long or unattended session could stop.