---
title: 保持された思考
url: https://code.saschaberens.de/_h/platform.claude.com/docs/ja/build-with-claude/preserved-thinking
description: プレフィックスチェックを実行するClaudeモデルでは、保持された思考により、以前のターンから送り返した思考ブロックをモデルが使用できるかどうかが決まります。
featureMetadata:
  status: stable
  supportedModels:
    - claude-fable-5-2
    - claude-mythos-5-2
    - claude-fable-5-1
    - claude-mythos-5-1
    - claude-opus-5-5
    - claude-sonnet-5-5
    - claude-haiku-5-5
  supportedPlatforms:
    Claude API: stable
    Amazon Bedrock: stable
    Amazon Bedrock (bedrock-runtime): stable
    Claude Platform on AWS: stable
    Claude Models on Google Cloud (Anthropic managed): stable
    Claude Models on Google Cloud (Google managed): stable
    Microsoft Foundry: stable
---

コードが思考ブロックを送り返すと、Claudeは以前のターンの推論に基づいて作業を進めることができます。*「preserved thinking」（保持された思考）*&#x306F;、それらのブロックのうちどれをClaudeが使用できるかを決定します。[保持された思考を持つモデル](https://code.saschaberens.de/_h/platform.claude.com/docs/ja/build-with-claude/preserved-thinking/prefix-checks#outcomes)では、使用可能なブロックはコンテキストに残り、入力として課金されます。APIが返したとおりの形で、[アシスタントのターンを正確にそのまま送り返す](https://code.saschaberens.de/_h/platform.claude.com/docs/ja/build-with-claude/preserved-thinking/change-tools-or-instructions#append-assistant-turns-exactly-as-returned)ようにしてください。

リクエストがすでに`The block is bound to a different conversation`で失敗している場合は、[別の会話にバインドされた思考ブロックを修正する](https://code.saschaberens.de/_h/platform.claude.com/docs/ja/build-with-claude/preserved-thinking/fix-bound-to-a-different-conversation)から始めてください。

## 思考ブロックが紐付けられているもの

これらのモデルでは、思考ブロックは次のものに紐付けられています。

* **それより前にあったもの：** `system`、`tools`、およびそれより前のすべてのメッセージ。いずれかが変わると、そのブロックは[「prefix check」（プレフィックスチェック）](https://code.saschaberens.de/_h/platform.claude.com/docs/ja/build-with-claude/preserved-thinking/prefix-checks#prefix-check)に失敗し、リクエストが400エラーを受け取る可能性があります。そのため、会話には追加のみを行ってください（[プレフィックスチェックに失敗せずにツールや指示を変更する](https://code.saschaberens.de/_h/platform.claude.com/docs/ja/build-with-claude/preserved-thinking/change-tools-or-instructions)を参照）。
* **モデル：** モデルは、一部の他のモデルの思考ブロックしか読み取りません（[Claude APIで推論を保持するモデル切り替え](https://code.saschaberens.de/_h/platform.claude.com/docs/ja/build-with-claude/preserved-thinking#which-model-switches-keep-reasoning)を参照）。
* **アカウント：** 一部のモデルのブロックはアカウントに紐付けられています（[アカウントとクラウドプラットフォーム](https://code.saschaberens.de/_h/platform.claude.com/docs/ja/build-with-claude/preserved-thinking#account-bound-thinking)を参照）。

[`prefix_mismatch_behavior`](https://code.saschaberens.de/_h/platform.claude.com/docs/ja/build-with-claude/preserved-thinking/prefix-checks#preserved-thinking-controls)は、プレフィックスチェックに失敗したリクエストが400エラーを受け取るか、APIがプレフィックスチェックに失敗したブロックを除外するかを選択します。レスポンスの[`input_transformations`](https://code.saschaberens.de/_h/platform.claude.com/docs/ja/build-with-claude/preserved-thinking/fix-bound-to-a-different-conversation#input-transformations)には、APIが除外した思考ブロック、または通過させた思考ブロックが一覧表示されます。思考の除外にはコストが伴います（[思考の除外によるコスト](https://code.saschaberens.de/_h/platform.claude.com/docs/ja/build-with-claude/preserved-thinking/fix-bound-to-a-different-conversation#drop-block-cost)を参照）。

## モデルを切り替えて元に戻す

`model`を変更し、会話全体を送信し続けてください。新しいモデルまたはアカウントが使用できない思考ブロックが、エラーを引き起こすことはありません。APIはそのリクエストについてそのブロックを除外して課金せず、Claudeはその推論なしで回答します。

[保持された思考を持つモデル](https://code.saschaberens.de/_h/platform.claude.com/docs/ja/build-with-claude/preserved-thinking/prefix-checks#outcomes)では、[`thinking: {"type": "enabled"}`](https://code.saschaberens.de/_h/platform.claude.com/docs/ja/build-with-claude/preserved-thinking#thinking-type-on-switch)は400エラーになり、[プレフィックスチェック](https://code.saschaberens.de/_h/platform.claude.com/docs/ja/build-with-claude/preserved-thinking/prefix-checks#prefix-check)に失敗したリクエストも400エラーを受け取る可能性があります。

<Frame>
  ![1つの履歴をClaude Fable 5.1、Claude Opus 5.5、そして再びClaude Fable 5.1に送信：そのブロックは一度除外され、その後再び読み取られる](https://code.saschaberens.de/_h/platform.claude.com/docs/ja/images/preserved-thinking-switch-and-back.svg)
</Frame>

Claude Opus 5.5はClaude Fable 5.1のブロックを読み取れないため、APIはClaude Opus 5.5へのリクエストについてそれらを除外します。Claude Fable 5.1に戻ると、それらは再び読み取られます。APIが`messages`を変更することはないためです。切り替え時に推論が永久に失われるのは、コードがそれを削除した場合のみです。そのため、思考を削除せず、モデルごとに別々の履歴を保持しないでください。

除外されたブロックは会話への変更とはみなされないため、両方のモデルのブロックが有効なままです。

## コードが行わない切り替え

ルーター、[拒否後のフォールバック](https://code.saschaberens.de/_h/platform.claude.com/docs/ja/build-with-claude/preserved-thinking#after-a-refusal)、またはサーバー側フォールバックがモデルを切り替えることがあり、また[他のプロバイダーのモデルがターンを担当することもあります](https://code.saschaberens.de/_h/platform.claude.com/docs/ja/build-with-claude/preserved-thinking#other-provider-turns)。会話全体を送信し続けてください。`fallback`ブロックを含むターンには独自のルールがあります。どのブロックを除外するかについては、[会話の継続](https://code.saschaberens.de/_h/platform.claude.com/docs/ja/build-with-claude/refusals-and-fallback#continuing-the-conversation)を参照してください。

どの切り替えでも、システムメッセージを受け付けないモデルが選ばれる可能性があります。[モデルがシステムメッセージを受け付けない場合](https://code.saschaberens.de/_h/platform.claude.com/docs/ja/build-with-claude/preserved-thinking#unchosen-switches-details)を参照してください。

## アカウントとクラウドプラットフォーム

別のアカウントやクラウドプラットフォームへの移行も同じように機能します。完全な履歴を送信し続けてください。

Claude Fable 5.2、Claude Mythos 5.2、Claude Sonnet 5.5、およびClaude Haiku 5.5の思考ブロックは、それを生成したアカウント、またはそれにリンクされたアカウントでのみ機能します。それ以外のアカウントでは、APIはエラーを出さずにそれらを除外します。

[アカウントとみなされるもの](https://code.saschaberens.de/_h/platform.claude.com/docs/ja/build-with-claude/preserved-thinking#accounts-by-platform)はプラットフォームによって異なります。

## シークレットと信頼できないテキスト

[Claudeが信頼するとはユーザーが想定しないファイル](https://code.saschaberens.de/_h/platform.claude.com/docs/ja/build-with-claude/preserved-thinking/change-tools-or-instructions#untrusted-text)は、`tool_result`ブロック内でのみ送信してください。履歴から[シークレット、個人データ、または注入されたテキストを削除する](https://code.saschaberens.de/_h/platform.claude.com/docs/ja/build-with-claude/preserved-thinking/change-tools-or-instructions#remove-sensitive-content)ときは、それらが最初に現れる箇所より後にあるすべての思考ブロックも削除してください。その後、Claudeはその推論なしで作業します。

## エージェントにコードを確認させる

Claude Codeで`claude update`を実行し、その後、リクエストを構築するリポジトリで次のプロンプトを実行してください。

Claude Codeにコードを確認させる

```text
/claude-api preserved-thinking-migration
```

別のエージェントを使う場合は、[プレフィックスチェックに失敗せずにツールや指示を変更する](https://code.saschaberens.de/_h/platform.claude.com/docs/ja/build-with-claude/preserved-thinking/change-tools-or-instructions)を渡し、リクエスト間でコードが`system`、`tools`、または以前のメッセージを変更しているすべての箇所を修正するよう依頼してください。

## 技術的な詳細

### Claude APIで推論を保持するモデル切り替え

ダッシュは、移行先のモデルがブロックを読み取れないことを意味します。複数回切り替えた後は、履歴内の各モデルについて1行ずつ確認してください。

| 移行元のモデル | Claude Fable 5.2またはClaude Mythos 5.2へ | Claude Fable 5.1またはClaude Mythos 5.1へ | Claude Opus 5.5へ | Claude Sonnet 5.5へ | Claude Haiku 5.5へ |
| ----- | ----- | ----- | ----- | ----- | ----- |
| Claude Haiku 5.5 | ✅ | — | ✅ | ✅ | ✅ |
| Claude Sonnet 5.5 | ✅ | — | ✅ | ✅ | — |
| Claude Opus 5 | ✅ | ✅ | ✅ | — | — |
| Claude Opus 5.5 | ✅ | ✅ | ✅ | — | — |
| Claude Fable 5またはClaude Mythos 5 | ✅ | ✅ | — | — | — |
| Claude Fable 5.1またはClaude Mythos 5.1 | ✅ | ✅ | — | — | — |
| Claude Fable 5.2またはClaude Mythos 5.2 | ✅ | — | — | — | — |

モデルに行または列がない場合は、[以前のモデル](https://code.saschaberens.de/_h/platform.claude.com/docs/ja/build-with-claude/preserved-thinking#earlier-models)を参照してください。

### Claude Opus 5やClaude Sonnet 5などの以前のモデル

すべてのClaudeモデルは、Claude Opus 4.8、Claude Sonnet 5、Claude Haiku 4.5、およびそれ以前のClaude Opus、Claude Sonnet、Claude Haikuモデルのブロックを読み取ります。

| 移行先のモデル | 次のモデルのブロックのみを読み取る |
| ----- | ----- |
| Claude Opus 4.8、Claude Sonnet 5、Claude Haiku 4.5、およびそれ以前のClaude Opus、Claude Sonnet、Claude Haikuモデル | 互いのモデル |
| Claude Opus 5 | 自身、および1行目のモデル |
| Claude Fable 5およびClaude Mythos 5 | 互いのモデル、Claude Mythos Preview、Claude Opus 5、および1行目のモデル |

### 新しいモデルでの思考設定

[保持された思考を持つモデル](https://code.saschaberens.de/_h/platform.claude.com/docs/ja/build-with-claude/preserved-thinking/prefix-checks#outcomes)は、`thinking: {"type": "enabled"}`を400エラーで拒否します。リクエストで`"enabled"`を設定しているモデルからこれらのモデルのいずれかに会話を移行する場合は、代わりに`"adaptive"`を送信してください。これらのモデルでは、`thinking`を省略した場合も「adaptive thinking」（適応型思考）になります。

### モデルがシステムメッセージを受け付けない場合

モデルが[システムメッセージを受け付けるモデルの一覧](https://code.saschaberens.de/_h/platform.claude.com/docs/ja/build-with-claude/mid-conversation-system-messages)にない場合は、そのモデルへのリクエストからのみシステムメッセージを除外してください。保存している履歴にはそれらを残しておきます。それらを受け付けるモデルに戻ったら、保存している完全な履歴を再び送信してください。それらなしで戻ることは変更にあたり、リクエストが400エラーを受け取る可能性があります。

### 拒否の後

[許可されたフォールバックモデル](https://code.saschaberens.de/_h/platform.claude.com/docs/ja/build-with-claude/refusals-and-fallback#naming-your-own-fallback-models)はいずれも、拒否したモデルの思考を読み取れないため、フォールバックモデルはその思考なしで回答します。リクエストしたモデルに戻ると、Claudeは両方のモデルの思考を読み取ります。

### 他のプロバイダーのモデルによるターン

他のプロバイダーのモデルによるターンは、`text`および`tool_use`のコンテンツとして末尾に追加します。Claudeのそれまでの思考は有効なままです。

### 各プラットフォームでアカウントとみなされるもの

| Claudeを呼び出す場所 | アカウント |
| ----- | ----- |
| Claude API、Claude Platform on AWS、Claude Models on Google Cloud (Anthropic managed)、またはMicrosoft Foundry | 組織 |
| Amazon Bedrock | AWSアカウント |
| Claude Models on Google Cloud (Google managed) | Google Cloudプロジェクト |

また、別のアカウントが生成した思考ブロックについて、そのアカウントがもはや良好な状態にない場合、APIはそのブロックを除外することがあります。これは、Claude FableおよびClaude Mythosモデル、Claude Opus 5、Claude Opus 5.5、Claude Sonnet 5.5、Claude Haiku 5.5へのリクエストに適用されます。リクエストは引き続き成功し、モデルはそのブロックの推論なしで回答します。

## 利用可能状況

保持された思考は一部のモデルで利用可能です。

### APIサポート

保持された思考を持つモデルは、[プレフィックスチェックが失敗したときに各モデルが行うこと](https://code.saschaberens.de/_h/platform.claude.com/docs/ja/build-with-claude/preserved-thinking/prefix-checks#outcomes)に記載されています。

#### [Messages API](https://code.saschaberens.de/_h/platform.claude.com/docs/ja/build-with-claude/working-with-messages)

* 利用可能状況：常時有効

| ステータス | クラウドプラットフォーム | モデル |
| ----- | ----- | ----- |
| 利用可能 | Claude API, [Claude Platform on AWS](https://code.saschaberens.de/_h/platform.claude.com/docs/ja/build-with-claude/claude-platform-on-aws), [Claude Models on Google Cloud (Anthropic managed)](https://code.saschaberens.de/_h/platform.claude.com/docs/ja/build-with-claude/claude-models-on-google-cloud/anthropic-managed), [Claude Models on Google Cloud (Google managed)](https://code.saschaberens.de/_h/platform.claude.com/docs/ja/build-with-claude/claude-models-on-google-cloud/google-managed), [Microsoft Foundry](https://code.saschaberens.de/_h/platform.claude.com/docs/ja/build-with-claude/claude-in-microsoft-foundry) | [Claude Fable 5.2](https://code.saschaberens.de/_h/platform.claude.com/docs/ja/models/fable-5-2/overview), [Claude Mythos 5.2](https://code.saschaberens.de/_h/platform.claude.com/docs/ja/models/mythos-5-2/overview), [Claude Fable 5.1](https://code.saschaberens.de/_h/platform.claude.com/docs/ja/models/fable-5-1/overview), [Claude Mythos 5.1](https://code.saschaberens.de/_h/platform.claude.com/docs/ja/models/mythos-5-1/overview), [Claude Opus 5.5](https://code.saschaberens.de/_h/platform.claude.com/docs/ja/models/opus-5-5/overview), [Claude Sonnet 5.5](https://code.saschaberens.de/_h/platform.claude.com/docs/ja/models/sonnet-5-5/overview), [Claude Haiku 5.5](https://code.saschaberens.de/_h/platform.claude.com/docs/ja/models/haiku-5-5/overview) |
| 利用可能 | [Amazon Bedrock](https://code.saschaberens.de/_h/platform.claude.com/docs/ja/build-with-claude/claude-in-amazon-bedrock) | [Claude Fable 5.1](https://code.saschaberens.de/_h/platform.claude.com/docs/ja/models/fable-5-1/overview), [Claude Opus 5.5](https://code.saschaberens.de/_h/platform.claude.com/docs/ja/models/opus-5-5/overview), [Claude Sonnet 5.5](https://code.saschaberens.de/_h/platform.claude.com/docs/ja/models/sonnet-5-5/overview), [Claude Haiku 5.5](https://code.saschaberens.de/_h/platform.claude.com/docs/ja/models/haiku-5-5/overview) |
| 利用可能 | [Amazon Bedrock (bedrock-runtime)](https://code.saschaberens.de/_h/platform.claude.com/docs/ja/build-with-claude/claude-on-amazon-bedrock-legacy) | [Claude Fable 5.2](https://code.saschaberens.de/_h/platform.claude.com/docs/ja/models/fable-5-2/overview), [Claude Mythos 5.2](https://code.saschaberens.de/_h/platform.claude.com/docs/ja/models/mythos-5-2/overview) |

#### [Managed Agents](https://code.saschaberens.de/_h/platform.claude.com/docs/ja/managed-agents/overview)

* 利用可能状況：常時有効

| ステータス | クラウドプラットフォーム | モデル |
| ----- | ----- | ----- |
| 利用可能 | Claude API, [Claude Platform on AWS](https://code.saschaberens.de/_h/platform.claude.com/docs/ja/build-with-claude/claude-platform-on-aws), [Claude Models on Google Cloud (Anthropic managed)](https://code.saschaberens.de/_h/platform.claude.com/docs/ja/build-with-claude/claude-models-on-google-cloud/anthropic-managed) | [Claude Fable 5.2](https://code.saschaberens.de/_h/platform.claude.com/docs/ja/models/fable-5-2/overview), [Claude Mythos 5.2](https://code.saschaberens.de/_h/platform.claude.com/docs/ja/models/mythos-5-2/overview), [Claude Fable 5.1](https://code.saschaberens.de/_h/platform.claude.com/docs/ja/models/fable-5-1/overview), [Claude Mythos 5.1](https://code.saschaberens.de/_h/platform.claude.com/docs/ja/models/mythos-5-1/overview), [Claude Opus 5.5](https://code.saschaberens.de/_h/platform.claude.com/docs/ja/models/opus-5-5/overview), [Claude Sonnet 5.5](https://code.saschaberens.de/_h/platform.claude.com/docs/ja/models/sonnet-5-5/overview), [Claude Haiku 5.5](https://code.saschaberens.de/_h/platform.claude.com/docs/ja/models/haiku-5-5/overview) |

## 次のステップ

<CardGroup cols={2}>
  <Card title="思考ブロックのプレフィックスチェック" icon="shield" href="https://code.saschaberens.de/_h/platform.claude.com/docs/ja/build-with-claude/preserved-thinking/prefix-checks">
    プレフィックスチェックが何を比較するか、リクエストがプレフィックスチェックに失敗したときに何が起こるか、および両方のケースの扱い方。
  </Card>

  <Card title="プレフィックスチェックに失敗せずにツールや指示を変更する" icon="edit" href="https://code.saschaberens.de/_h/platform.claude.com/docs/ja/build-with-claude/preserved-thinking/change-tools-or-instructions">
    コードが会話に加える各変更の代わりに送信するもの。
  </Card>

  <Card title="別の会話にバインドされた思考ブロックを修正する" icon="wrench" href="https://code.saschaberens.de/_h/platform.claude.com/docs/ja/build-with-claude/preserved-thinking/fix-bound-to-a-different-conversation">
    失敗している会話を復旧し、思考の除外によるコストを確認します。
  </Card>
</CardGroup>
