Claude Opus 4.7とClaude Codeを使用するためのベストプラクティス
AnthropicはClaude CodeにおけるOpus 4.7モデルの最適化のため、インタラクティブセッションの構造化方法とデフォルトの努力度設定(xhigh)の変更について具体的な運用ガイドラインを提示した。
キーポイント
セッション構造とプロンプト設計の最適化
対話型セッションでは初期ターンでタスクの意図、制約、受け入れ基準を明確に指定し、逐次的な指示出しを避けることでトークン効率と出力品質を向上させる。
努力度設定のデフォルト変更とトークン消費
Opus 4.7のデフォルト努力度は「xhigh」に引き上げられ、長いセッション後半でより多くの推論を行う傾向があるため、移行時にはプロンプトとハッチの調整が必要。
オートモードと完了通知の活用
安全が担保されたバッチタスクにはShift+Tabでオートモードを有効化し、完了音を設定することで非同期作業のサイクル時間を大幅に短縮する。
エフォートレベルの調整とアダプティブ思考
デフォルトはxhighに設定されているが、タスク中にレベルを切り替えてトークン使用量と推論を最適化できる。固定予算の代わりにアダプティブ思考が導入され、モデルが文脈に応じて思考の有無を自動判断し、高速化と過剰な推論を防ぐ。
プロンプトによる思考量と応答長のカスタマイズ
明示的な指示により思考の深さや応答速度を制御可能。また、単純なクエリには短く複雑な分析には長い応答など、タスクの複雑さに応じて応答長が自動調整されるようになった。
ツール呼び出しとサブエージェントのデフォルト動作変更
モデルはより多くの直接推論を優先し、ツール呼び出しやサブエージェントの生成がデフォルトで減少した。並列処理や積極的なファイル読み取りが必要な場合は、具体的な使用条件をプロンプトで明示する必要がある。
長時間タスクへの最適化
Opus 4.7は従来モデルより長時間実行タスクで性能が向上しており、複数ファイルの変更や複雑なデバッグ、サービス全体のコードレビューなど、人間の監視がボトルネックとなっていた作業に特に適している。
影響分析・編集コメントを表示
影響分析
このガイドラインは、エンタープライズ開発者がClaude Codeをより効率的に運用するための実務基準を示すものであり、モデルの出力品質向上とトークンコスト管理のバランスを取る上で重要な指針となる。特に「xhigh」デフォルト化とオートモードの導入は、AIエージェントの自律性を高める方向性を示しており、開発現場のプロンプトエンジニアリングやワークフロー設計に影響を与える可能性がある。
編集コメント
公式ブログの運用ガイドラインであり、新モデルの特性を踏まえた実務的な最適化案が提示されている。開発者はトークンコストと推論品質のトレードオフを考慮し、タスクの性質に応じて努力度やモードを柔軟に切り替える運用が求められる。
Claude CodeでClaude Opus 4.7を使用するためのベストプラクティス
再調整されたエフォートレベル、適応型思考、新しいデフォルト設定を活用して、Opus 4.7でのClaude Code環境を最適化する方法をご覧ください。
カテゴリ:Claude Code
製品:Claude Code
日付:2026年4月16日
読了時間:5分
共有リンクコピー https://claude.com/blog/best-practices-for-using-claude-opus-4-7-with-claude-code
Opus 4.7は、コーディング、エンタープライズワークフロー、長時間実行型のエージェントタスク(agentic tasks)において、これまで公開してきたモデルの中で最も強力な一般提供モデルです。Opus 4.6よりも曖昧さへの対応が優れており、バグの発見やコードレビューの能力が大幅に向上し、セッションをまたいでコンテキストをより確実に保持します。さらに、指示が少なくても曖昧なタスクを論理的に推論して処理できます。
発売時のアナウンスで、2つの変更(更新されたトークナイザー(tokenizer)と、より高いエフォートレベルでの思考傾向、特に長時間セッションの後半ターン(user turns)におけるその傾向)がトークン使用量に影響することに言及しました。その結果、Opus 4.6からOpus 4.7へ置き換える場合、最高のパフォーマンスを得るためにはある程度の調整が必要です。プロンプトやハルネス(harnesses)を少し変更するだけで、大きな違いを生むことができます。
この記事では、何が変わったか、そしてClaude CodeでOpus 4.7を最も効果的に使用する方法について解説します。
インタラクティブなコーディングセッションの構成
Opus 4.7のトークン使用量と動作は、単一のユーザーターン(user turns)でより自律的な非同期型コーディングエージェント(asynchronous coding agents)を展開するか、複数のユーザーターンでよりインタラクティブな同期型コーディングエージェント(synchronous coding agents)を展開するかによって異なります。インタラクティブな環境では、ユーザーのターン後により多くの推論を行います。これにより長時間セッションにおける一貫性、指示の遵守、コーディング品質が向上しますが、その分トークン使用量が増える傾向があります。
Claude CodeでOpus 4.7の性能を最大限に引き出すために、私たちはClaudeを1行ずつ指示するペアプログラマーではなく、任せることができる有能なエンジニアとして扱うことが有効だと見出しました:
最初のターンでタスクを事前に明確に指定する。意図、制約条件、受入基準、関連するファイルの場所を組み込んだ詳細なタスク記述は、Opus 4.7がより優れた出力を提供するために必要なコンテキストを与えます。複数のターンにわたって段階的に伝えられる曖昧なプロンプトは、トークン効率を低下させ、場合によっては全体の品質も下げる傾向があります。
必要なユーザーインタラクションの数を減らす。すべてのユーザーターンには推論オーバーヘッドが追加されます。質問をバッチ処理し、モデルが進むために必要なコンテキストを提供してください。
適切な場合にオートモード(auto mode)を使用する。頻繁な確認なしで安全に実行できるとモデルを信頼できるタスクには、オートモードがサイクルタイムを短縮します。事前に完全なコンテキストを提供した長時間実行タスクには特に適しています。オートモードは現在、Claude Code Maxユーザー向けにリサーチプレビュー(research preview)として利用可能になっており、Shift+Tabキーでオン/オフを切り替えることができます。
完了タスクの通知を設定する。タスク完了時に音を鳴らすようClaudeに依頼すると、フックベースの通知(hook-based notifications)を自身で作成できます。
Opus 4.7の推奨エフォート設定
Claude CodeにおけるOpus 4.7のデフォルトエフォートレベルは、現在xhighです。
各エフォートレベル(effort level)ごとに、いくつか追加のガイダンスをご紹介します。
新しいモデルへのアップグレードをお考えの場合、古い設定をそのまま移行するのではなく、エフォート(effort)の値を実験的に変更することをお勧めします。同じタスクの中でエフォートレベルを切り替えることで、トークン使用量(token usage)と推論(reasoning)の管理をより効果的に行えます。
ほとんどのコーディングタスクにとって最適な設定だと考えているため、Opus 4.7 のデフォルトのエフォートレベルを xhigh に設定しています。既存の Claude Code ユーザーで、手動でエフォートレベルを設定していない場合は、自動的に xhigh にアップグレードされます。
アダプティブ・シンキング(adaptive thinking)との連携
固定された思考予算(thinking budget)を持つ拡張思考(Extended Thinking)は Opus 4.7 ではサポートされていません。代わりに、Opus 4.7 はアダプティブ・シンキング(adaptive thinking)を提供します。これにより、各ステップで思考がオプションとなり、モデルはコンテキストに基づいていつより多くの思考を使用するかを判断できます。単純なクエリには迅速に応答し、ステップに思考が役立たない場合はそれをスキップし、最も有用性が期待できる場所に思考トークン(thinking tokens)を投資できます。エージェント実行(agentic run)全体を通じて、これにより応答速度の向上とユーザー体験の改善につながります。
今回のリリースではアダプティブ・シンキングが大幅に改善されており、特に Opus 4.7 は過度な思考(overthinking)を起こしにくくなっています。
思考の速度(thinking rate)についてより細かく制御したい場合は、プロンプトで直接指定してください:
より多くの思考を求めている場合は、以下のようなプロンプトを試してください。「回答する前に慎重に、かつ段階的に考えてください。この問題は見た目よりも難しいです。」
思考を少なくしたい場合は、以下のようなプロンプトを試してください。「深く考えるよりも迅速な回答を優先してください。迷った場合は直接回答してください。」トークンを節約できますが、複雑なステップでは精度が少し低下する可能性があります。
知っておくべき動作の変更
Opus 4.6 と 4.7 の間でいくつかのデフォルト動作が変更されており、古いモデル向けにプロンプトやハッチ(harnesses)を慎重に調整している場合は、これらの変更を知っておく価値があります。
応答の長さはタスクの複雑さに合わせて調整されます。Opus 4.7 は Opus 4.6 に比べてデフォルトで冗長ではありません。単純な検索では短い回答、オープンエンドの分析では長い回答が期待できます。特定の長さやスタイルを必要とするユースケースの場合、プロンプトでそれを明示的に指定してください。私たちは、求めるトーン(voice)のポジティブな例が、「これをしないでください」というネガティブな指示よりも効果的に機能することを確認しています。
モデルはツール呼び出しの頻度を減らし、推論(reasoning)をより多く行うようになりました。これにより多くのケースで結果が改善されます。より多くのツール使用(例えば、エージェント作業中の積極的な検索やファイル読み取り)を希望する場合は、ツールを使用すべきタイミングと理由を明示的に記述したガイダンスを提供してください。
デフォルトではサブエージェント(subagents)の生成数が減っています。Opus 4.7 は、サブエージェントに作業を委任するタイミングについてより慎重になる傾向があります。並列のサブエージェント(例えば、ファイルや独立した項目への展開)がユースケースに有益な場合、それを明示的に記述することをお勧めします。例えば:
単一の応答で直接完了できる作業(例:既に確認済みの関数のリファクタリング)に対してはサブエージェントを生成しないでください。項目への展開や複数のファイルの読み取りを行う場合は、同じターンで複数のサブエージェントを生成してください。
次に試すべきこと
Opus 4.7は、以前のモデルと比較して長時間実行されるタスク(long-running tasks)でより優れたパフォーマンスを発揮します。これにより、複雑な複数ファイルの変更(multi-file changes)、曖昧なデバッグ(debugging)、サービス全体のコードレビュー(code review)、マルチステップのエージェントワーク(agentic work)など、以前は監督(supervision)がボトルネックとなっていたタスクに最適です。
作業レベル(effort)は「xhigh」に設定することを推奨します。
詳細は、Opus 4.7のプロンプティングガイド(prompting guide)およびClaude Codeにおけるコンテキスト(context)とセッション管理(session management)に関する記事をご覧ください。
前へ前へ0/5次へ次へ電子書籍(eBook)
curl -fsSL https://claude.ai/install.sh | bashコマンドをクリップボードにコピーirm https://claude.ai/install.ps1 | iexコマンドをクリップボードにコピーまたはドキュメント(documentation)を読むClaude Codeを試すClaude Codeを試すClaude Codeを試す開発者向けドキュメント(Developer docs)開発者向けドキュメント(Developer docs)開発者向けドキュメント(Developer docs)関連記事(Related posts)
Claudeを活用して構築するチーム向けの、より多くの製品ニュースとベストプラクティスをご覧ください。
Claude Codeの使用:セッション管理(session management)と1Mコンテキスト\nClaude CodeClaude Codeの使用:セッション管理(session management)と1MコンテキストClaude Codeの使用:セッション管理(session management)と1MコンテキストClaude Codeの使用:セッション管理(session management)と1MコンテキストClaude Codeの使用:セッション管理(session management)と1Mコンテキスト 2026年4月14日デスクトップ版Claude Codeの並列エージェント(parallel agents)向け redesign
Claude Codeデスクトップ版Claude Codeの並列エージェント(parallel agents)向け redesignデスクトップ版Claude Codeの並列エージェント(parallel agents)向け redesignデスクトップ版Claude Codeの並列エージェント(parallel agents)向け redesignデスクトップ版Claude Codeの並列エージェント(parallel agents)向け redesign 2026年4月10日エージェント視点で見る:Claude Codeにおけるツールの設計方法
Claude Codeエージェント視点で見る:Claude Codeにおけるツールの設計方法エージェント視点で見る:Claude Codeにおけるツールの設計方法エージェント視点で見る:Claude Codeにおけるツールの設計方法エージェント視点で見る:Claude Codeにおけるツールの設計方法 2026年4月7日Claude Codeにおけるサブエージェント(subagents)の使用方法と使用時期
Claude CodeClaude Codeにおけるサブエージェント(subagents)の使用方法と使用時期Claude Codeにおけるサブエージェント(subagents)の使用方法と使用時期Claude Codeにおけるサブエージェント(subagents)の使用方法と使用時期Claude Codeにおけるサブエージェント(subagents)の使用方法と使用時期組織の運用をClaudeで変革する
開発者向けニュースレター(developer newsletter)を購読する\n製品アップデート、ハウツー、コミュニティ特集など。毎月あなたのメールボックスにお届けします。\n購読する購読する月次開発者ニュースレターを受け取りたい場合は、メールアドレスをご入力ください。いつでも購読を解除できます。

原文を表示
Best practices for using Claude Opus 4.7 with Claude Code
Learn how to use recalibrated effort levels, adaptive thinking, and new defaults to optimize your Claude Code setup with Opus 4.7.
CategoryClaude Code
ProductClaude Code
DateApril 16, 2026
Reading time5min
ShareCopy linkhttps://claude.com/blog/best-practices-for-using-claude-opus-4-7-with-claude-code
Opus 4.7 is our strongest generally available model to date for coding, enterprise workflows, and long-running agentic tasks. It handles ambiguity better than Opus 4.6, is much more capable at finding bugs and reviewing code, carries context across sessions more reliably, and can reason through ambiguous tasks with less direction.
In our launch announcement, we noted that two changes—an updated tokenizer and a proclivity to think more at higher effort levels, especially on later turns in longer sessions—impact token usage. As a result, when replacing Opus 4.6 with Opus 4.7, it can take some tuning to achieve the best performance. A few tweaks to prompts and harnesses can make a big difference.
This post walks through what’s changed and how to most effectively use Opus 4.7 in Claude Code.
Structuring interactive coding sessions
Opus 4.7’s token usage and behavior can differ depending on whether you’re deploying more autonomous, asynchronous coding agents with a single user turn or more interactive, synchronous coding agents with multiple user turns. In interactive settings, it reasons more after user turns: this improves its coherence, instruction following, and coding quality over long sessions, but it also tends to use more tokens.
To get the most out of Opus 4.7 in Claude Code, we’ve found it’s helpful to treat Claude more like a capable engineer you’re delegating to than a pair programmer you’re guiding line by line:
Specify the task up front, in the first turn. Well-specified task descriptions that incorporate intent, constraints, acceptance criteria, and relevant file locations give Opus 4.7 the context it needs to deliver stronger outputs. Ambiguous prompts conveyed progressively across many turns tend to reduce both token efficiency and, sometimes, overall quality.
Reduce the number of required user interactions. Every user turn adds reasoning overhead. Batch your questions and give the model the context it needs to keep moving.
Use auto mode when appropriate. For tasks where you trust the model to execute safely without frequent check-ins, auto mode cuts cycle time. It’s an especially good fit for long-running tasks where you’ve provided full context up front. Auto mode is now available in research preview for Claude Code Max users—you can toggle it on using Shift+Tab.
Set up notifications for completed tasks. Ask Claude to play a sound when it’s done with a task, and it can create its own hook-based notifications.
Recommended effort settings for Opus 4.7
The default effort level for Opus 4.7 in Claude Code is now xhigh
Here’s some additional guidance for each effort level:
If you’re upgrading to the new model, we recommend experimenting with effort rather than just porting over an old setting. You can toggle between effort levels during the same task to more effectively manage token usage and reasoning.
We’ve set the default effort level for Opus 4.7 to xhigh because we believe it’s the best setting for most coding tasks. If you’re an existing Claude Code user but you haven’t manually set your effort level, you’ll be upgraded to xhigh
Working with adaptive thinking
Extended Thinking with a fixed thinking budget is not supported in Opus 4.7. Instead, Opus 4.7 offers adaptive thinking. This makes thinking optional at each step and allows the model to decide when to use more thinking based on context. It can respond to simple queries quickly, skip thinking when a step doesn’t benefit from it, and invest its thinking tokens where they’re most likely to be useful. Over an agentic run, this can add up to faster responses and a better user experience.
Adaptive thinking has improved meaningfully in this release—in particular, Opus 4.7 is less prone to overthinking.
If you want more control over the thinking rate, prompt for it directly:
If you want more thinking, try something like, “Think carefully and step-by-step before responding; this problem is harder than it looks.”
If you want less thinking, try something like, “Prioritize responding quickly rather than thinking deeply. When in doubt, respond directly.” You’ll save tokens but may lose some accuracy on harder steps.
Behavior changes worth knowing
A handful of default behaviors have changed between Opus 4.6 and 4.7 and are worth knowing about if you’ve carefully tuned your prompts or harnesses for the older model.
Response length is calibrated to task complexity. Opus 4.7 isn’t as default-verbose as Opus 4.6. You can expect shorter answers on simple lookups and longer ones on open-ended analysis. If your use case relies on a specific length or style, state that explicitly in your prompt. We find that positive examples of the voice you want work better than negative “Don’t do this” instructions.
The model calls tools less often and reasons more. This produces better results in many cases. If you want more tool use (say, more aggressive search or file reading during agentic work), provide guidance that explicitly describes when and why the tool should be used.
It spawns fewer subagents by default. Opus 4.7 tends to be more judicious about when to delegate work to subagents. If your use case benefits from parallel subagents (for example, fanning out across files or independent items), we recommend spelling that out. For example:
Do not spawn a subagent for work you can complete directly in a single response (e.g., refactoring a function you can already see). Spawn multiple subagents in the same turn when fanning out across items or reading multiple files.
What to try next
Opus 4.7 performs better on long-running tasks than prior models. This makes it a good fit for tasks where supervision used to be the bottleneck, like complex multi-file changes, ambiguous debugging, code review across a service, and multi-step agentic work.
We recommend keeping effort at xhigh
Learn more in our Opus 4.7 prompting guide and our article on context and session management in Claude Code.
PrevPrev0/5NextNexteBook
curl -fsSL https://claude.ai/install.sh | bashCopy command to clipboardirm https://claude.ai/install.ps1 | iexCopy command to clipboardOr read the documentationTry Claude CodeTry Claude CodeTry Claude CodeDeveloper docsDeveloper docsDeveloper docsRelated posts
Explore more product news and best practices for teams building with Claude.
Using Claude Code: session management and 1M context
Claude CodeUsing Claude Code: session management and 1M contextUsing Claude Code: session management and 1M contextUsing Claude Code: session management and 1M contextUsing Claude Code: session management and 1M context Apr 14, 2026Redesigning Claude Code on desktop for parallel agents
Claude CodeRedesigning Claude Code on desktop for parallel agentsRedesigning Claude Code on desktop for parallel agentsRedesigning Claude Code on desktop for parallel agentsRedesigning Claude Code on desktop for parallel agents Apr 10, 2026Seeing like an agent: how we design tools in Claude Code
Claude CodeSeeing like an agent: how we design tools in Claude CodeSeeing like an agent: how we design tools in Claude CodeSeeing like an agent: how we design tools in Claude CodeSeeing like an agent: how we design tools in Claude Code Apr 7, 2026How and when to use subagents in Claude Code
Claude CodeHow and when to use subagents in Claude CodeHow and when to use subagents in Claude CodeHow and when to use subagents in Claude CodeHow and when to use subagents in Claude CodeTransform how your organization operates with Claude
Get the developer newsletter
Product updates, how-tos, community spotlights, and more. Delivered monthly to your inbox.
SubscribeSubscribePlease provide your email address if you'd like to receive our monthly developer newsletter. You can unsubscribe at any time.

関連記事
2026年3月6日 Frontier Red TeamによるClaudeのCVE-2026-2796エクスプロイトのリバースエンジニアリング
Frontier Red Teamが、Claudeの脆弱性CVE-2026-2796を悪用するエクスプロイトをリバースエンジニアリングした。
フロンティア・レッドチーム、Firefoxのセキュリティ向上のためにMozillaと提携
フロンティア・レッドチームは、Firefoxのセキュリティを向上させるため、Mozillaと提携した。
59%のユーザーがより安価なモデルを選択:Sonnet 4.6の詳細解説
Anthropic社がClaude Sonnet 4.6をリリースし、Claude Codeテストで70%のユーザーが前世代モデルより好み、59%がフラッグシップモデルOpus 4.5よりも選択した。コーディング、コンピュータ利用、100万トークンコンテキストなど6次元で全面アップグレードされ、価格は据え置き。