Claude Code

Claude Code 2.1.312: Write No Longer Overwrites a Large CLAUDE.md Blind

3 min read AI-generated

Per-directory skills stopped being found after a change into a deeper folder of the repo. And the usage limit is now called the 5-hour limit instead of the session limit.

Featured image for "Claude Code 2.1.312: Write No Longer Overwrites a Large CLAUDE.md Blind"

Claude Code 2.1.312 landed in the npm registry on October 27 at 18:36 UTC. The changelog is long, and one entry in it matters to anyone who keeps instructions inside a repository.

The bug that overwrote instructions

Until now, Claude could overwrite a very large CLAUDE.md, a rules file or an @-included file in a subdirectory after seeing only its start. Write now asks Claude to read the whole thing or edit it in place.

If you maintain an instruction file several hundred lines long, that is exactly the failure mode: Claude reads the top, treats it as the file, and writes a new, shorter one. The loss often shows up days later, and by then it is in the git history.

Identity and managed settings

The Claude apps gateway now understands oidc.user_id_claim. It lets you identify people by a claim in the ID token other than sub, such as oid on Microsoft Entra ID. For organizations whose directory issues a fresh sub per application, that was previously an annoyance with no way around it.

Also fixed: after signing in from the VS Code extension, managed settings and organization policy were not fetched for the rest of the session. And in VS Code, sessions ended on a bare exit code when organization settings could not be loaded; the tab now says why and offers Retry or Sign in again.

What else stands out

  • Per-directory and paths: skills were not found after a Bash cd deeper into a git repository.
  • A command with an invalid name stopped all commands from loading, which could leave claude -p with no output at all.
  • 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. A timeout under one second counts as one.
  • A sub-agent’s autoCompactWindow now also lowers a window set through CLAUDE_CODE_AUTO_COMPACT_WINDOW. It still cannot raise it.
  • WebFetch errors in cloud sessions explain an unresolvable host as possibly outside the allowed network domains, and name the host you need to allow.
  • On Bedrock, Vertex, Foundry and Mantle, model names Claude Code does not recognize, such as custom deployment names or inference profile ARNs, now get the shorter system prompt. Revert with CLAUDE_CODE_SIMPLE_SYSTEM_PROMPT=0.
  • Automatic model switches after a flagged message now cover those names too. Turn them off with CLAUDE_CODE_DISABLE_REFUSAL_FALLBACK=1.
  • The claude_code.safety_event OpenTelemetry event is no longer sent.
  • Limit messages call the 5-hour window the 5-hour limit instead of the session limit, with a clock time in VS Code.
  • In cloud sessions, the model picker gains an effort level when you create or edit a routine, and the setup script box is a Bash editor with colors, line numbers and a Copy button.
  • Code Review reviewed an outdated commit, or none at all, when GitHub delivered a push event late.

If you keep a long instruction file, update today

I wrote about 2.1.311 yesterday, with the 200K stop and the double-firing hooks. This release has no feature of that size, but the Write fix is the most expensive class of bug: one that quietly deletes work. On top of that, the hook cap makes any automation with many parallel sub-agents behave differently than it did yesterday. Both belong in place before your next long run.

Sources

Claude CodeReleaseHooksOpenTelemetry