Claude Code 2.1.312: a large CLAUDE.md no longer risks silent overwrite
2.1.312 fixes a bug that could overwrite an oversized CLAUDE.md or rules file after only a partial read, plus a hook concurrency cap and two reliability fixes.
Claude Code 2.1.312, released on October 27, 2026, won't change how you work day to day, but it fixes a bug that could quietly drop part of your project instructions. Of the rest, three things stand out: a new cap on how many hooks can run at once, a command with an invalid name that no longer takes every other command down with it, and a duplicate avoided in cloud sessions.
An oversized CLAUDE.md risked silent overwrite
The memory docs set a precise per-file limit for any subdirectory CLAUDE.md, rules file, or @path import that loads on demand rather than at launch: 40,000 characters on a 200K context window, 200,000 characters on a 1M context window for Opus 4.6 and Sonnet 4.6, 150,000 for newer models. Past that limit, Claude only gets the start of the file, with a note telling it to read the rest itself with the Read tool. Before 2.1.312, if Claude had only seen that start and then rewrote the file, the write could keep only the part it had actually seen and silently drop the rest. 2.1.312 fixes this: when Claude has seen only part of a large CLAUDE.md, rules file, or import, the Write tool now asks it to read the whole file or edit it in place. If one of your subdirectory files is getting close to these thresholds, check its size with wc -m, as the docs recommend.
The rest: hooks, commands, and cloud sessions
The hooks docs already noted that when an event fires, at most twelve prompt or agent hooks run in parallel for that event, with the rest waiting their turn as the first ones finish. 2.1.312 adds a second cap, this time across the whole session, subagents included: at most twenty-four prompt or agent hooks run at once in total, plus twelve more for hooks that have already waited past their event's timeout without starting, with any timeout under one second counting as one second. If you stack a lot of subagents that each run their own prompt or agent hooks, some will now wait longer before they get to start. Two more fixes are worth a line. A command with an invalid name no longer stops every other command from loading, a bug that could leave claude -p with no output at all. And in cloud sessions, resending an unchanged message after a failed send no longer sometimes runs it twice. Two changes target narrower cases. On Bedrock, Vertex, Foundry, and Mantle, a model name Claude Code doesn't recognize, such as a custom deployment name or an inference profile ARN, now gets the shorter system prompt even when it fronts Sonnet or Haiku: set CLAUDE_CODE_SIMPLE_SYSTEM_PROMPT=0 to keep the full prompt. And per-directory skills and skills scoped with paths: are found again after a cd deeper into a git repository. The rest of the release, an OIDC claim for the Claude apps gateway, a colored Bash editor for the setup script in cloud environment settings, and wording tweaks around usage limits, is mostly cosmetic or limited to enterprise administration.
Pierre Rondeau
Developer and indie builder. I build products and automations with AI. Creator of Claude Hub.
LinkedIn