Claude Code v2.1.312: Write reads large files fully before overwriting, skills found after a deeper cd#
Published by Alex Sorokoletov
Part of the Claude Code Version Tracker series. | Official Env Vars | Official Changelog
Claude Code v2.1.312, the release after v2.1.311, guards large files from data loss: before replacing a very large CLAUDE.md, rules file, or @-included file that Claude saw only the start of, Write now asks Claude to read it in full or edit it in place.[1] Skills under per-directory and paths: rules are found again after a Bash cd deeper into a git repository.[1]
Write reads a large file before replacing it#
Write now asks Claude to read a very large CLAUDE.md, rules file, or @-included file in a subdirectory in full, or edit it in place, before replacing it; previously it could overwrite the file after Claude had seen only its start.[1] For projects whose instruction files run to thousands of lines, that closes a path where the tail of a file could be discarded.
Skill discovery picks up the working directory again: per-directory and paths:-scoped skills are found after a Bash cd into a deeper directory of a git repository, where they could go missing before.[1]
The effort level shown is the one in force#
Three fixes land on effort-level reporting. The spinner, OpenTelemetry effort values, and transcripts name the effort level in force during a task; they could previously show a level that had just been picked but not yet applied by the model.[1] The prompt's effort indicator now says a mid-task change may wait for your next message, and clears that note once it no longer applies.[1] The /model and /effort cache warning now allows that a change made while Claude is working can trigger the re-read sooner than your next message.[1]
Prompt and refusal controls for unrecognized model names#
On Bedrock, Vertex, Foundry, and Mantle, model names Claude Code doesn't recognize, such as custom deployment names and inference profile ARNs, now get the shorter system prompt even when they front Sonnet or Haiku, and the automatic model switch after a flagged message covers those names too.[1] Two environment variables are the opt-outs:
| Variable | What It Does |
|---|---|
CLAUDE_CODE_SIMPLE_SYSTEM_PROMPT | On Bedrock, Vertex, Foundry, and Mantle, Claude Code uses the shorter system prompt for model names it doesn't recognize, such as custom deployment names and inference profile ARNs. Set it to 0 to keep the full prompt. |
CLAUDE_CODE_DISABLE_REFUSAL_FALLBACK | After a flagged message, Claude Code switches models automatically, now including model names it doesn't recognize such as custom deployment names. Set it to 1 to turn the switches off. |
More in this release#
- Prompt and agent hooks run at most 24 at a time per session, sub-agents included, plus at most 12 that have waited past their event's timeout; a
timeoutunder 1 second counts as 1 second.[1] - A subagent's
autoCompactWindowcan lower the window set byCLAUDE_CODE_AUTO_COMPACT_WINDOW, where it had no effect before; it still never raises it.[1] - The Claude apps gateway gains
oidc.user_id_claim, to identify people by an id_token claim other thansub, such as Microsoft Entra ID'soid.[1] - In fullscreen, clicking the "to send now" hint under a queued message sends it immediately, as its key does.[1]
- A command with an invalid name no longer stops all commands from loading, which had left
claude -pwith no output.[1] - Usage messages call the 5-hour window the "5-hour limit," and the VS Code extension shows a clock time for its reset.[1]
Unrecognized model names decide the prompt and the fallback#
Two of this release's gateway changes key off the same test: whether Claude Code recognizes the model name. An enterprise that fronts Sonnet or Haiku behind a custom deployment name or an inference profile ARN now gets the shorter system prompt and the post-flag model switch by default, because the ARN or alias reads as an unknown model rather than the model behind it.[1] The two environment variables above are the way to pin either behavior back to the full prompt or to no switch.
This analysis is conducted for educational and research purposes under fair use principles. All trademarks and software referenced belong to their respective owners.
Sources#
- Claude Code Official Changelog, v2.1.312 release notes
Related Versions#
- Claude Code v2.1.310: a Monitor tool for background work, retries that drop a rejected beta
- Claude Code v2.1.309: sandbox and permission-boundary fixes, ultrareview workspace trust
- Claude Code v2.1.307: safety-event telemetry, MCP calls stop double-firing
- Claude Code v2.1.306: MCP-heavy session errors, cloud headless logins
- Claude Code v2.1.305: Vertex and Bedrock requests retry without tool search, Linux sandbox namespaces
Previous Claude Code analysis: v2.1.311 (October 29, 2026)
All 82 Claude Code analyses: Claude Code Version Tracker · Official Claude Code changelog