The Claude Code Changelog
All Episodes
Custom Deployment Prompts and Guardrails in Claude Code 2.1.312

Custom Deployment Prompts and Guardrails in Claude Code 2.1.312

0:00|0:00

Learn about changes in Claude Code 2.1.312 that alter default system prompts and refusal fallback behaviors for custom model deployment names on Bedrock, Vertex, Foundry, and Mantle. We also cover crucial updates to hook concurrency limits, subagent compaction settings, and a fix preventing accidental overwrites of large CLAUDE.md files.


Chapter 1

Custom Models Now Get a Shorter System Prompt

Lachlan Reed

G'day, this is The Claude Code Changelog, brought to you by Jellypod AI. Quick one for anyone running Claude Code through Bedrock, Vertex, Foundry or Mantle. Version 2.1.312 landed on October 27th, and it changes what prompt your custom model names get without you touching anything.

James Turner

Right. Before 2.1.312, a custom deployment name or an inference profile ARN was something Claude Code couldn't identify. Now, for model names it doesn't recognize, those four providers use the shorter system prompt. The changelog is explicit that this applies even when the deployment fronts Sonnet or Haiku. So if your team aliases a model behind a gateway name, your sessions may have quietly switched to the short prompt after the update.

Lachlan Reed

And that's the bit worth checking, because nothing on screen shouts about it. A bigger prompt is more tokens on every request, so I'd guess the shorter one is cheaper and quicker. But that's my read, not something the changelog claims. What the changelog does give you is the escape hatch.

James Turner

Set CLAUDE_CODE_SIMPLE_SYSTEM_PROMPT to zero and you keep the full prompt. You can export it in your shell, or put it under the env key in your settings dot json. Something like env, then CLAUDE_CODE_SIMPLE_SYSTEM_PROMPT with the string zero. If you want it for the whole team, put it in the project's dot claude settings file so it's checked in.

Lachlan Reed

Practical test. If your agent behaved well last week and feels a bit off this week on a custom deployment name, run one session each way with the variable set to zero and not set. Same task, same repo. If the full prompt fixes it, you've got your answer. If you don't notice a difference, leave the short one and enjoy the lighter load.

James Turner

Second change in the same area. Claude Code can automatically switch models after a message gets flagged. In 2.1.312 that behavior now also covers model names it doesn't recognize, same custom deployment names. To turn it off, set CLAUDE_CODE_DISABLE_REFUSAL_FALLBACK to one.

Lachlan Reed

Why would you want that off? Say you've pointed Claude Code at a specific deployment on purpose, maybe for data handling reasons. A silent switch to a different model is the last thing you'd want. Flip the variable and the switch doesn't happen. The changelog doesn't say exactly what you'll see instead, so try it on a throwaway session first and see how a flagged turn behaves before you roll it out.

James Turner

Now the guardrails. Prompt and agent hooks are capped at 24 running at a time per session, and that count includes subagents. On top of that, at most 12 hooks that have waited longer than their event's timeout. And a hook timeout under one second now counts as one second. So if you've got a swarm of subagents each firing prompt hooks, audit them. Anything relying on a sub second timeout is now getting a full second.

Lachlan Reed

There's also a subagent compaction tweak. A subagent's autoCompactWindow now lowers the window set by CLAUDE_CODE_AUTO_COMPACT_WINDOW, where before it had no effect. It still never raises it. So you can make a chatty subagent compact earlier without touching the session setting.

James Turner

And a callback for anyone who followed our earlier episode on setting up the claude_code.safety_event OpenTelemetry metric. In 2.1.312, Claude Code has stopped sending that event. If you built a dashboard or an alert on it, expect it to go quiet, and that's the version, not your collector. Worth checking before someone reads silence as all clear.

Lachlan Reed

Few smaller wins. In fullscreen, you can click the "to send now" hint under a queued message and it sends right away, same as the key. There's a new oidc.user_id_claim on the Claude apps gateway, so you can identify people by a claim other than sub, like Microsoft Entra ID's oid.

James Turner

The one I'd flag is the CLAUDE.md fix. Claude could overwrite a very large CLAUDE.md, rules file, or at included file in a subdirectory after seeing only the start of it. Now the Write tool asks Claude to read the whole file or edit in place. If you've got a giant rules file, that's a real save. Also, usage limit messages now say "five hour limit" instead of "session limit", and in VS Code you get a reset clock time, like resets at 3:10 PM.

Lachlan Reed

So the takeaway: if you're on a custom deployment name, check which prompt you're getting and which fallback behavior you want, then set those two variables on purpose. Update to 2.1.312 and run claude dash dash version to confirm.