Field noteOct 28, 20266 min read1 source

Claude Code 2.1.312 adds an OIDC user-id claim for the Claude apps gateway and stops overwriting large CLAUDE.md files

In one minute

Anthropic released Claude Code v2.1.312 with an OIDC user-identifier claim setting for the Claude apps gateway and a fix for overwrites of very large repository instruction files. For teams building with coding agents, the important change is operational reliability: identity mapping, policy loading, file instructions, and directory-scoped skills are all part of the harness around the model.

What changed: Claude Code 2.1.312 adds an OIDC user-id claim for the apps gateway and stops overwriting large CLAUDE.md files, beyond v2.1.310’s monitoring and enterprise-control changes.

What happened

Anthropic published Claude Code v2.1.312 on GitHub on October 27. The release adds oidc.user_id_claim to the Claude apps gateway. The setting lets an organization identify a person with an id_token claim other than sub; the release notes give Microsoft Entra ID’s oid claim as an example. The notes do not describe a new authentication protocol or a change to access pricing. They describe a configuration option for deployments that need a different identity claim as their user key.

The release also changes how Claude Code handles large instruction and rule files. Anthropic says Claude could overwrite a very large CLAUDE.md, rules file, or @-included file in a subdirectory after seeing only its beginning. The Write behavior now asks Claude either to read the full file or edit it in place. This is a narrow fix, but it concerns a common control surface: repository-local instructions that shape an agent’s behavior. A separate fix restores discovery of per-directory and paths: skills after a Bash cd deeper into a Git repository.

Several fixes address managed or automated use. Managed settings and organization policy previously might not be fetched for the remainder of a session after sign-in from the VS Code extension. An invalid command name could stop every command from loading, potentially leaving claude -p with no output. The release also fixes a rare resume case in which a terminal session’s first reply could be absent when that session was later resumed. In VS Code, sessions that ended with a bare exit code when organizational settings could not load or were refused now explain the problem and offer Retry or Sign in again.

For cloud-backed model deployments, Bedrock, Vertex, Foundry, and Mantle now use the shorter system prompt when Claude Code sees a model name it does not recognize, including custom deployment names and inference-profile ARNs, even if those front Sonnet or Haiku. Teams can retain the full prompt through CLAUDE_CODE_SIMPLE_SYSTEM_PROMPT=0. Automatic model switches after a flagged message now also cover unrecognized model names; CLAUDE_CODE_DISABLE_REFUSAL_FALLBACK=1 disables that behavior. The release further caps prompt and agent hooks at 24 concurrent runs per session, including sub-agents, plus at most 12 that have exceeded their event timeout.

Other changes include click-to-send in fullscreen for queued messages, more accurate OpenTelemetry naming for fixed-URL remote MCP servers declared by official Anthropic Marketplace plugins, and removal of the claude_code.safety_event OpenTelemetry event. Cloud-session routines gain an effort level in the model picker and a Bash editor for cloud environment setup scripts.

What the archive adds

This is a new release on a known Claude Code thread. Claude Code v2.1.310 previously added Monitor parity across Bedrock, Vertex, and Foundry, gateway retry, and Enterprise role controls. Version 2.1.312 continues that operational surface, but its new facts are identity-claim configuration and reliability fixes around policies, file context, and skills.

Trend signal

The release supports Harness architecture outlives model choice. Its consequential details are not a model capability claim: they are identity mapping, organization-policy retrieval, repository instruction handling, skill discovery, hook concurrency, and behavior for custom deployment names. Those components determine what a coding agent can consistently access and do across a real team environment.

It also modestly supports Agent-ready software exposes capabilities: the gateway’s explicit user-claim setting makes one identity boundary configurable rather than implicit.

Connections to other events

The earlier v2.1.310 note covered Monitor availability across Bedrock, Vertex, and Foundry. This release again touches those deployment environments, now by changing system-prompt behavior for custom model names and inference-profile ARNs. The common thread is support for organizations running Claude Code through managed cloud model endpoints rather than only a default model path.

Why it matters

A coding agent’s useful context is more than a model and a prompt. Large CLAUDE.md and rules files frequently contain the local conventions, commands, and constraints that keep changes reviewable. If an agent can overwrite such a file after reading only part of it, the result can be lost governance context precisely when a repository is complex enough to require it. The new read-or-edit-in-place behavior is therefore more relevant than a routine interface fix.

The OIDC setting matters to teams that operate a Claude apps gateway with an identity provider whose durable internal identifier is not sub. The policy-loading and VS Code fixes likewise matter because centrally managed settings are only controls when a signed-in session reliably receives them. The release does not claim to solve authorization design; it removes specific failure modes in the path where those controls meet developer workflows.

What happens next

  • More Claude Code releases will address enterprise deployment and control-plane edge cases rather than only model features. (3 months, 70%). Watch for: gateway, policy, identity, telemetry, or managed-settings release notes.
  • Teams using large repository instruction files will formalize checks for agent edits to those files. (6 months, 60%). Watch for: protected paths, review rules, or explicit agent instructions around CLAUDE.md.

Limits and uncertainty

The release notes identify the defects and intended changes, but do not quantify how often they occurred, which versions were affected, or whether any repository instruction file was actually overwritten in production. They do not specify which OIDC providers or claim formats have been tested beyond the Microsoft Entra ID example. Nor do they establish whether the shortened system prompt improves or degrades behavior for custom deployment names. The notes also provide no benchmark, pricing information, compatibility matrix, or migration procedure. Teams should test the version in their own identity, policy, and repository setup before treating the fixes as assurance of correct governance.

Skill to build now

Create a small regression repository for the controls your agent depends on. Include a large CLAUDE.md, an @-included rules file in a subdirectory, a directory-scoped skill, and a command that changes directories before invoking the skill. In a managed environment, sign in through the VS Code extension and verify that organization settings are visible for the rest of the session. If you use a Claude apps gateway, document which id_token claim is your stable person identifier and test it with a non-production identity. This converts release-note claims into observable behavior in your harness.

Reader takeaway

Claude Code 2.1.312 is a maintenance release with practical control-plane value. Its key contribution is not a new coding capability; it makes identity attribution and repository-level agent context less fragile in several defined cases. Update and test it where large instruction files, managed policies, or cloud deployments are part of daily use.

Open question

Will Anthropic publish clearer compatibility and observability guidance for organizations that use custom model deployment names, gateway identity claims, and centrally managed Claude Code policies?

Evidence / sources

  1. 1github.com/anthropics/claude-code/releases/tag/v2.1.312
All Field Notes

Next reads

Read next

Open the graph
  1. 01topicClaudeExplore the claude topic hub.
  2. 02topicClaude CodeExplore the claude-code topic hub.
  3. 03topicAnthropicExplore the anthropic topic hub.
  4. 04archiveField NotesOpen the latest editorial analysis.
  5. 05source ledgerSource LedgerInspect the public source evidence graph.
Who read this page?Machine requests, hidden until opened

Loading the privacy-safe route aggregate...

Open the JSON contract