Key Updates in Claude Code v2.1.312 - Using Shorter System Prompts with Inference Profile ARNs and More

Key Updates in Claude Code v2.1.312 - Using Shorter System Prompts with Inference Profile ARNs and More

Claude Code v2.1.312 is released. A detailed look at the key points and impact of its 39 updates, including important changes to model name recognition, the system prompt, and OpenTelemetry.
2026.10.29

This page has been translated by machine translation. View original

I'm Ishikawa from the Cloud Business Division. Claude Code v2.1.312 (released October 27, 2026) is out. This article introduces the update, focusing on the notable changes.

The previous update article is here.

https://dev.classmethod.jp/articles/20261027-cc-updates-v2-1-311/

Update Summary

v2.1.312 includes 39 changes. By this article's classification, there are 21 fixes, 6 improvements, 4 new features, 4 breaking changes, 3 developer experience changes, and 1 security change.

The CHANGELOG does not explicitly label any item as a breaking change or deprecation, but 4 changes affect existing behavior and monitoring settings, so they are covered in the "Breaking Changes and Deprecations" section. There are also changes to the VS Code extension, Cloud sessions, Remote Control, Claude Tag, and Code Review.

Notable Updates

Short system prompt used for unrecognized model names on Bedrock, Vertex, Foundry, and Mantle

On Bedrock, Vertex, Foundry, and Mantle, Claude Code now uses a short system prompt when you use a model name it does not recognize. The CHANGELOG gives custom deployment names and inference profile ARNs as examples of such model names, and the short prompt is used even if the name points to Sonnet or Haiku. To keep the previous full prompt, set CLAUDE_CODE_SIMPLE_SYSTEM_PROMPT=0.

As of this writing (October 28, 2026), the official documentation (Environment variables) describes CLAUDE_CODE_SIMPLE_SYSTEM_PROMPT as a variable that selects between the full system prompt and a short prompt that omits tool descriptions. When unset, Haiku 4.5, Sonnet 5, Opus 4.7 and earlier models of the same lines use the full prompt, and newer models use the short prompt. The documentation also explains that with either prompt, the toolset, hooks, MCP servers, and CLAUDE.md discovery are preserved.

Regarding "model names Claude Code does not recognize," the official documentation (Model configuration) explains recognized and unrecognized IDs as follows.

Category Examples
Recognized Anthropic API IDs such as claude-sonnet-4-5. Provider IDs that contain an Anthropic API ID, such as us.anthropic.claude-sonnet-4-5-20250929-v1:0
Not recognized ARNs of application inference profiles, model versions Claude Code does not know, and proprietary gateway names (e.g., my-gateway-opus). In every case, except when mapped to a known model with modelOverrides

Note that the official documentation describes the scope of "recognition" per feature, such as the display in the /model picker and context window detection, and as of this writing it does not state which determination is used for selecting the system prompt.

The v2.1.154 CHANGELOG states that the short system prompt became the default for all models other than Haiku, Sonnet, and Opus 4.7 and earlier. With the v2.1.312 change, when you use a name that is not recognized on Bedrock, Vertex, Foundry, or Mantle, the short prompt is used even if the model behind the name is Haiku 4.5, Sonnet 5, or earlier. As a result, even for the same model, specifying it with a recognized ID gives the full prompt, while specifying it with an unrecognized name gives the short prompt, so the prompt used depends on how you specify it. On the other hand, if the model behind the name is a newer one such as Haiku 5.5, the short prompt is the default even with a recognized ID, so this change makes no difference.

The differences from before the change are summarized in "Breaking Changes and Deprecations."

If you specify custom deployment names or inference profile ARNs on Bedrock, Vertex, Foundry, or Mantle, I think it is a good idea to explicitly set which prompt to use with CLAUDE_CODE_SIMPLE_SYSTEM_PROMPT after updating.

Stopped sending OpenTelemetry claude_code.safety_event

Claude Code no longer sends the OpenTelemetry event claude_code.safety_event.

As of this writing, the official documentation (Monitoring) explains that claude_code.safety_event is an event recorded when a check denies a tool call or asks for permission confirmation, and that it requires v2.1.307 or later. What the CHANGELOG describes is the stop of event sending; it does not mention any change to the checks that deny tool calls themselves.

If you used claude_code.safety_event in dashboards or alert conditions, the event will no longer arrive after the update, so I think you need to review your monitoring settings.

Fixed an issue where large CLAUDE.md files in subdirectories were overwritten after only viewing the beginning

Fixed an issue where Claude would overwrite very large CLAUDE.md files, rule files, and files included with @ in subdirectories after seeing only the beginning. In v2.1.312, the Write tool asks Claude to read the whole file or edit it in place.

For repositories that keep large CLAUDE.md or rule files in subdirectories, there is less risk of losing content through an overwrite based on only the beginning, so I think this is a fix worth updating for.

Fixed an issue where managed settings were not fetched after signing in from the VS Code extension

Fixed an issue where, after signing in from the VS Code extension, managed settings and organization policies were not fetched for the rest of the session. In this article, this is classified as security because it concerns settings distributed by administrators.

For organizations that distribute managed settings or organization policies and whose members sign in from the VS Code extension, I think it is a good idea to announce the update early.

Added oidc.user_id_claim to Claude apps gateway

oidc.user_id_claim was added to Claude apps gateway, so users can now be identified by an id_token claim other than sub. The CHANGELOG gives Microsoft Entra ID's oid as an example.

As of this writing, the official documentation (Claude apps gateway configuration) does not yet mention oidc.user_id_claim.

If you operate Claude apps gateway and want to use a claim other than sub to identify users, I think you should consider using oidc.user_id_claim.

Update Details

New Features

  • Added oidc.user_id_claim to Claude apps gateway (see Notable Updates).
  • In fullscreen mode, clicking the "to send now" hint shown below a queued message now sends that message immediately. This behaves the same as pressing the key corresponding to the hint.
  • [Cloud sessions] Added an effort level to the model picker when creating and editing routines that run in the cloud.
  • [Cloud sessions] Added a Bash editor with syntax coloring, line numbers, and a Copy button to the setup script field in the cloud environment settings.

Improvements and Developer Experience

  • The prompt effort indicator now shows a note that an effort changed in the middle of a task may wait until the next message to take effect. The note disappears when it no longer applies.
  • In cloud session WebFetch, errors for hosts that cannot be resolved now explain that the host may be outside the allowed network domains. This lets Claude indicate which hostnames should be allowed.
  • In usage limit messages, the 5-hour window is now called "5-hour limit" instead of "session limit."
  • The session name and branch name of cloud sessions started from the CLI are now fetched from the server.
  • A subagent's autoCompactWindow now works in the direction of lowering the window set with CLAUDE_CODE_AUTO_COMPACT_WINDOW. Previously it had no effect. It still does not work in the direction of raising it. As of this writing, the official documentation (Create custom subagents) still has the pre-change content, explaining that this field has no effect when CLAUDE_CODE_AUTO_COMPACT_WINDOW is set.
  • For remote MCP servers with fixed URLs declared by plugins from the official Anthropic marketplace, OpenTelemetry's mcp_server.name now reports the actual server name instead of custom.
  • [VS Code] Usage limit resets are now shown as a time such as "Resets at 3:10 PM" and labeled "5-hour limit."
  • [Cloud sessions] Opening the step where Claude adds a repository to a cloud session now shows a short table summarizing the result instead of raw JSON.
  • [Claude Tag] Claude Tag retry notifications in Slack now show the name of the model in use, or that the rate limit was reached, instead of a generic API error.

Security

  • Fixed an issue where managed settings and organization policies were not fetched after signing in from the VS Code extension (see Notable Updates).

Fixes

  • Fixed an issue where large CLAUDE.md files in subdirectories were overwritten after only viewing the beginning: See Notable Updates
  • Fixed an issue where directory-scoped skills could not be found after cd: After using cd in Bash to move deeper into a git repository, directory-scoped skills and skills with paths: specified could no longer be found
  • [VS Code] Fixed an issue where the session ended with only an exit code when organization settings could not be loaded: When organization settings could not be loaded or were rejected at startup, the session ended leaving only an exit code. The reason is now shown in the tab, and you can choose Retry or Sign in again
  • [Cloud sessions] Fixed an issue where resending after a send failure caused a message to run twice: Resending the same message after a send failure could cause it to run twice
  • [Claude Tag] Fixed an issue where settings reverted to defaults when a channel became public: When an old private Slack channel became public and was assigned a new ID, the Claude Tag channel on/off switch and agent settings reverted to the workspace defaults
  • [Claude Tag] Fixed an issue where files were posted to a different thread: While answering in another thread of the same channel, Claude in Slack sometimes posted files to the wrong thread
  • [Code Review] Fixed an issue where old commits were reviewed: When GitHub push event delivery was delayed, Code Review sometimes reviewed an old commit or did not review at all. It now reviews the pull request's current commit
  • A quietly welcome fix: Fixed an issue where a single command with an invalid name could stop all commands from loading and cause claude -p to output nothing. Because it is hard to notice that the cause lies in a command name, I feel this is a quietly welcome fix for those who use claude -p in scripts.
  • In addition, many small bugs have been fixed, including session resumption, PDF reading with the Read tool, effort level display, agent view, vim mode, the /verify description, Cloud sessions, Remote Control, and Claude Tag.

Breaking Changes and Deprecations

The CHANGELOG does not explicitly label any item as a breaking change or deprecation. Here we cover 4 changes that affect existing behavior, settings, and monitoring.

Short system prompt used for unrecognized model names

On Bedrock, Vertex, Foundry, and Mantle, when you use a model name that Claude Code does not recognize, the short system prompt is now used even if it points to Sonnet or Haiku. From the CHANGELOG wording "even when they front Sonnet or Haiku," it can be read that before the change, the full prompt could be used for names pointing to Sonnet or Haiku (speculation).

Below is a configuration example. Following the official documentation (Claude Code on Amazon Bedrock), it assumes the ARN of an application inference profile is specified in ANTHROPIC_MODEL.

Before the change (through v2.1.311):

export CLAUDE_CODE_USE_BEDROCK=1
export ANTHROPIC_MODEL='arn:aws:bedrock:us-east-2:your-account-id:application-inference-profile/your-model-id'
# Sonnet や Haiku を指す ARN では、完全なプロンプトが使われる場合があった(推測)

After the change (v2.1.312 onward):

# Claude Code がこの ARN からモデルを認識できない場合は、短いシステムプロンプトを使う
# 完全なプロンプトを維持するには、次を追加する
export CLAUDE_CODE_SIMPLE_SYSTEM_PROMPT=0

Automatic model switching after a flagged message now applies to unrecognized model names

The automatic model switching that occurs after a flagged message now also applies to model names that Claude Code does not recognize (such as custom deployment names). As of this writing, the official documentation (Environment variables) explains this automatic switching as the model switch that happens when a safety classifier flags a request, a behavior controlled by the switchModelsOnFlag setting.

Before the change (through v2.1.311):

Unrecognized model names (such as custom deployment names) were not subject to automatic model switching
(inferred from the CHANGELOG wording "also cover")

After the change (v2.1.312 onward):

Unrecognized model names are also subject to automatic model switching
To disable: export CLAUDE_CODE_DISABLE_REFUSAL_FALLBACK=1

Concurrency limit and minimum timeout for prompt hooks and agent hooks

The concurrency of prompt hooks and agent hooks is now limited to a maximum of 24 per session including subagents, plus a maximum of 12 that have been waiting longer than the event timeout. Also, a timeout of less than 1 second is now treated as 1 second. For hooks other than prompt and agent hooks, such as command hooks, the CHANGELOG has no mention.

As of this writing, the official documentation (Hooks reference) still has the pre-change content, explaining that if more than 12 prompt and agent hooks match a single event, 12 run at the same time and the rest start as running hooks finish.

Below is a configuration example. It assumes the prompt hook example from the official documentation (Hooks reference) with a timeout of less than 1 second specified.

{
  "hooks": {
    "Stop": [
      {
        "hooks": [
          {
            "type": "prompt",
            "prompt": "Evaluate if Claude should stop: $ARGUMENTS. Check if all tasks are complete.",
            "timeout": 0.5
          }
        ]
      }
    ]
  }
}

Before the change (through v2.1.311):

Concurrency: up to 12 prompt and agent hooks run at the same time per event (as described in the official documentation at the time of writing)
timeout: 0.5 was treated as 0.5 seconds (speculation)

After the change (v2.1.312 onward):

Concurrency: up to 24 per session including subagents
+ up to 12 that have been waiting longer than the event timeout
timeout: 0.5 is treated as 1 second

Stopped sending OpenTelemetry claude_code.safety_event

Claude Code no longer sends claude_code.safety_event. As of this writing, the official documentation (Monitoring) describes it as an event recorded in v2.1.307 and later.

Before the change (v2.1.307 to v2.1.311):

claude_code.safety_event (event.name: "safety_event") is sent to OpenTelemetry logs

After the change (v2.1.312 onward):

claude_code.safety_event is not sent

Dashboards and alerts conditioned on this event will no longer receive the corresponding events from v2.1.312 onward.

Conclusion

I feel v2.1.312 is a release centered on how Claude Code handles unrecognized model names on Bedrock, Vertex, Foundry, and Mantle, and on behavior changes around hooks and OpenTelemetry. Of the 4 items treated as breaking changes in this article, the system prompt can be set to the full prompt with CLAUDE_CODE_SIMPLE_SYSTEM_PROMPT=0, and automatic model switching can be disabled with CLAUDE_CODE_DISABLE_REFUSAL_FALLBACK=1.

If you specify models on Bedrock or elsewhere using custom deployment names or ARNs, or you monitor Claude Code with OpenTelemetry, why not check the "Breaking Changes and Deprecations" section, then update and try it out?

References

https://github.com/anthropics/claude-code/blob/main/CHANGELOG.md

https://code.claude.com/docs/en/changelog

https://code.claude.com/docs/en/env-vars

https://code.claude.com/docs/en/model-config

https://code.claude.com/docs/en/amazon-bedrock

https://code.claude.com/docs/en/hooks

https://code.claude.com/docs/en/monitoring-usage

https://code.claude.com/docs/en/sub-agents

https://code.claude.com/docs/en/claude-apps-gateway-config

https://dev.classmethod.jp/articles/20261027-cc-updates-v2-1-311/


Claudeならクラスメソッドにお任せください

クラスメソッドは、Anthropic社とリセラー契約を締結しています。各種製品ガイドから、業種別の活用法、フェーズごとのお悩み解決などサービス支援ページにまとめております。まずはご覧いただき、お気軽にご相談ください。

サービス詳細を見る

Share this article

AI白書