Skip to content

Claude Code

Claude Code 2.1.312 stops overwriting big CLAUDE.md files

3 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.312 stops Claude from overwriting a very large CLAUDE.md, rules file or @-included file in a subdirectory after it has seen only the start of that file, according to the October 27 release notes on GitHub. In projects that keep long instruction files below the repository root, the Write tool now tells Claude to read such a file in full or edit it in place before changing it.

Those subdirectory files are the ones Claude meets mid-task. A src/api/CLAUDE.md loads the first time Claude reads a file in src/api/, while CLAUDE.md files in directories above the working directory load in full at launch. The same release fixes a related gap: per-directory and paths: skills went missing after a Bash cd deeper into a git repository.

Bedrock, Vertex, Foundry and Mantle

On these four providers, Claude Code now sends the shorter system prompt whenever it doesn’t recognize the model name. That covers custom deployment names and inference profile ARNs, even when they front Sonnet or Haiku. Setting CLAUDE_CODE_SIMPLE_SYSTEM_PROMPT=0 keeps the full prompt.

Unrecognized names are also now covered by the automatic model switch after a flagged message. A session that runs through a custom deployment name can therefore move to another model after a flagged message, unless CLAUDE_CODE_DISABLE_REFUSAL_FALLBACK=1 is set.

Telemetry, hooks and subagents

Claude Code stops sending the claude_code.safety_event OpenTelemetry event. That event arrived in 2.1.307, firing for each tool call that a permission rule, auto mode, a safety check, a hook or the sandbox stopped, prompted or sent back, and alerts built on it since then are already reading nothing. Two other OpenTelemetry fields change. Effort values now report the level in force; before, they could name a newly picked level before the model had applied it. And mcp_server.name gives the real name of fixed-URL remote MCP servers declared by plugins from the official Anthropic marketplace, where it used to report custom.

Prompt and agent hooks now run at most 24 at a time per session, sub-agents included, plus at most 12 that have waited longer than their event’s timeout. Any hook timeout under 1 second counts as 1 second.

A subagent’s autoCompactWindow now lowers the window set by CLAUDE_CODE_AUTO_COMPACT_WINDOW. Before this release it had no effect on it, and it still never raises it.

For admins and VS Code users

The Claude apps gateway gets oidc.user_id_claim, which identifies people by an id_token claim other than sub, such as Microsoft Entra ID’s oid. In the VS Code extension, managed settings and organization policy were not fetched for the rest of the session after signing in from the extension. That is fixed. Sessions that ended on a bare exit code when organization settings couldn’t load, or were refused at startup, now show the reason in the tab with Retry or Sign in again.

Usage limit messages now call the 5-hour window the “5-hour limit” instead of the “session limit”. In VS Code the reset shows as a clock time, such as “Resets at 3:10 PM”.

Scripts, cloud sessions and reviews

A command with an invalid name used to stop every command from loading, and that could leave claude -p with no output. Pipelines that call it get output again after updating. In cloud sessions, resending an unchanged message after a failed send could sometimes run it twice. That is fixed too, and a WebFetch host that does not resolve is now explained as possibly outside the allowed network domains, so Claude names the host to allow.

Code Review had its own fix. When GitHub delivered a push event late, it could review an outdated commit or none at all. It now reviews the pull request’s current commit.

No comments yet. Be the first.

Join the conversation

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