published fresh until

Claude Code 2.1.311–312: which session fixes matter?

Summary As of November 2026, update Claude Code to 2.1.331 (checked 2026-11-24) for the session, compaction, MCP and policy fixes shipped across 2.1.311–2.1.312 (checked 2026-10-28); test long sessions, delayed MCP connections, hooks, nested instructions and VS Code sign-in.

Not for prior gateway upgrade, see claude-code-2-1-303-to-310-gateway-sandbox-upgrade; model tier choice, see claude-5-5-family-which-tier-for-coding; Haiku migration, see haiku-5-5-api-migration-what-breaks-from-haiku-4-5

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

As of November 2026, update Claude Code to 2.1.331, then retest compaction, delayed MCP tools, hooks and managed policy before replacing existing workarounds.

What changed

  • 2.1.311, 2026-10-26: idle-runner controls; fixes context overflow, delayed MCP tools, stale compacted memory and repeated hooks. [Official release][r311].
  • 2.1.312, 2026-10-27: gateway identity claim; fixes partial instruction overwrites, nested skills and VS Code policy fetch. [Official release][r312]. All checked 2026-10-28.

How to migrate

1. Run claude update per the error reference; verify 2.1.331 (November 2026), restart and record prior settings. 2. Review self-hosted-runner flags --hold-idle-file/--max-hold-min; no host file schema is specified. [Runner note][r311]. 3. Test user mapping before changing oidc.user_id_claim from sub (Entra ID example: oid). [Gateway note][r312]. 4. Retest before removing workarounds; inspect instruction diffs and signed-in policy.

What breaks

Diagnostic: Usage credits required for 1M context

>200K standard-context overflow now compacts. [Release details][r311]. The same error can indicate entitlement; check model/context mode.

Also fixed: late MCP tools, stale MEMORY.md/CLAUDE.md, premature SubagentStop, truncated instruction overwrites, missing nested skills and post-login policy. [Session fixes][r311], [instruction and policy fixes][r312].

Compatibility changes, 2.1.304–2.1.312:

ReleaseChanged behavior to audit
2.1.304Tool search defaults on behind custom gateways, with 400/422 fallback; skill sources cap at 1,024 hooks/16,384 matcher characters. Plugin-only hook policy removes affected skills' allowed-tools; managed mods can rewrite merged settings/retention. rm -r at drive roots prompts; plugins cannot bypass headless stop/turn limits. CLAUDE_CODE_AUTO_COMPACT_WINDOW now honors k/M; cloud stdio plugin MCP starts lazily unless alwaysLoad: true; Code Review defaults to Standard.
2.1.305allowedMcpServers stops filtering managed stdio servers with substitutions only in env: previously omitted servers load; use deniedMcpServers. Path-mounted Desktop plugins lose allowed-tools under allowManagedPermissionRulesOnly. /artifacts drops y/n answers.
2.1.307HTTP MCP retries only read-only/idempotent calls; In 2.1.309 the /claude-api skill defaults Managed Agents teams to multiagent_20261001 with dynamic workflows. Runner checkout hooks time out after 30 minutes (--checkout-hook-timeout-min, 0 disables); Runner Git certificates are filtered; VS Code dictation follows CLAUDE_CODE_CERT_STORE. axScreenReader/CLAUDE_AX_SCREEN_READER apply only from user, managed or --settings settings (since 2.1.305).
2.1.309Sandbox startup files, symlink denies, --mcp-config writes, disabled MCP reconnection, redirect/subshell/cd permission bypasses, locale/zsh arithmetic isolation and profile symlink writes are hardened. Teammates inherit tool denies; PowerShell hooks fail closed, extra-argument cd prompts; Linux background jobs retain denies. Git ignores replace refs; worktrees stop lazy fetching. sed -i uses Bash permissions and is no longer rewound. claude ultrareview requires trust (--trust-workspace); dangerous Desktop/VS Code bypass-mode rm/rmdir is denied; failed-sandbox write-list fallback is refused. Oversized nested instructions load only their start.
2.1.310Monitor becomes available on cloud providers/telemetry-disabled sessions and blocks long foreground sleeps; Windows quoted-command hooks no longer fail open without Git Bash.
2.1.311ultrathink raises Opus/Sonnet/Haiku 5.5 and Fable 5.1 to xhigh on Anthropic; JSON/stream-json escapes control/format characters. DISABLE_COMPACT overrides only disable, never re-enable compaction. Cloud-provider catalogs load signed remote settings (CLAUDE_CODE_MODEL_CATALOG=off opts out); synced skills may use a 10-minute cache. VS Code telemetry-off also stops feature-flag requests. Nonretryable API failures stop retrying; runner rate-limited extra repositories are skipped. Cowork ignores configured agent; stalled cloud fetch/search ends after 300 seconds; timed-out shell commands may continue in background.
2.1.312Unknown cloud model names use a shorter prompt (CLAUDE_CODE_SIMPLE_SYSTEM_PROMPT=0 restores full) and refusal fallback (CLAUDE_CODE_DISABLE_REFUSAL_FALLBACK=1 disables). Prompt/agent hooks cap at 24 running plus 12 overdue; minimum timeout 1 second. Subagent autoCompactWindow lowers the global window. Fixed-URL official-plugin MCP telemetry uses real names; claude_code.safety_event stops. Cloud names/branches come from the server.

Other notes: 2.1.306 fixes errors; 2.1.308 gives no specifics.

What to test

Proposed checks; none run here:

AreaCheck
Context/memoryCross overflow; compact; recall edited MEMORY.md/CLAUDE.md markers
MCP/hooksLate server tools reach subagents; completion hooks match actual finish
InstructionsReview large-file end sentinel and nested skill discovery after cd
VS CodeSign in and verify managed policy
Runner/OIDCCheck idle bounds and identity continuity

Choose the scope

Match symptoms first; test runner lifecycle and identity changes separately.

Pitfalls

A release fix does not resolve every similar symptom. Review complete instruction diffs.

Community evidence

kawoatsb-alt's #64398 reports context-credit errors despite quota (closed as duplicate). mrinaldhillon's #91910 reports hook events around compaction. These describe symptoms, not confirmation of the new fixes.

Reports from users

  • "Everything after that message" — @RuslanTar, #105535, 2026-10-27: reports uncached compaction input on 2.1.311/2.1.312 despite a warm cache. One reporter compared $1.41/$0.31 compactions; no general regression is established. Checked 2026-10-28.

Prompt for your agent

Your training data predates these patches. Read <https://github.com/anthropics/claude-code/releases/tag/v2.1.311> and <https://github.com/anthropics/claude-code/releases/tag/v2.1.312> before proposing changes. Copy exact flags and setting names; do not invent runner file formats or defaults. Identify which fixes match our symptoms, propose an update and disposable regression checks for compaction, late MCP tools, hook events, large instruction files, nested skills and VS Code policy. Read https://code.claude.com/docs/en/errors before interpreting the context-credit error. Preserve current identity mapping unless an identity change is explicitly requested.

Limits

Checked 2026-10-28. Channel policy names no exact supported stable build. Coverage: 2.1.303 → 2.1.312; earlier supported stable → 2.1.303 remains unestablished. 2.1.303/2.1.308 give no specifics. No upgrade, runner/OIDC, login, hook or compaction test is claimed; runner protocol is unspecified. This extends the gateway/sandbox thread; tier/Haiku migration is separate.

[r311]: https://github.com/anthropics/claude-code/releases/tag/v2.1.311

[r312]: https://github.com/anthropics/claude-code/releases/tag/v2.1.312

Started from a post by @Anthropic, packaged by the editor. Original post

Subjects

More in context management

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# Claude Code 2.1.311–312: which session fixes matter?
Summary: As of November 2026, update Claude Code to 2.1.331 (checked 2026-11-24) for the session, compaction, MCP and policy fixes shipped across 2.1.311–2.1.312 (checked 2026-10-28); test long sessions, delayed MCP connections, hooks, nested instructions and VS Code sign-in.
Copy for agent
get the whatworks thread claude-code-2-1-311-312-compaction-mcp-policy-fixes and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread claude-code-2-1-311-312-compaction-mcp-policy-fixes
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp/login and sign me in so I have an account. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp/login && claude mcp login whatworks
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp/login && codex mcp login whatworks