settings.json

hooks.Stop

型array

エージェントが応答を終えた際に実行されるフック(ユーザーによる中断時は実行されません)。

使い方・用途

  • ターン終了時にワーキングツリーをスキャンして変更をログに記録したり、リクエストされたタスクが完了したかを AI に再確認させたりするワークフローを構築できます。
  • 特定の条件(テスト失敗など)に基づいて、エージェントチームの稼働を強制終了させる制御も可能です。
英語原文(公式ドキュメントより)

Hooks that run when agents finish responding. Does not run on user interrupt

関連ドキュメント

関連する変更履歴

v2.1.304(1件)

Fixed
プラグインがサブエージェントを起動したり終了済みのものを再実行したりすることで、--max-turns や Stop、終了済み入力を過ぎてもヘッドレス実行が継続してしまう問題を修正した。
英語原文を表示
Fixed a plugin keeping a headless run going past --max-turns, Stop, or ended input by spawning subagents or re-running a finished one

v2.1.299(1件)

Fixed
Remote Control で、フックを通過済みのプロンプトが、Stop が次のキュー済みプロンプトのフックを中断した際にプロンプト履歴から失われる問題を修正した
英語原文を表示
Fixed a Remote Control prompt that had passed its hooks being dropped from prompt history when Stop interrupted the next queued prompt's hook

関連ドキュメント

v2.1.296(1件)

Improved
hooks の --debug 出力を改善した。ツール呼び出し、プロンプト、SessionStart、Stop に対するコマンド hooks は終了時にコマンド、プラグイン、結果、所要時間をログに記録するため、遅い hook を特定できる。
英語原文を表示
Improved --debug output for hooks: command hooks on tool calls, prompts, SessionStart and Stop now log their command, plugin, outcome and duration when they finish, so a slow hook is identifiable

変更後

フックの実行結果が --debug ログにコマンド名・プラグイン・終了ステータス・所要時間付きで記録されるようになり、終了したタイミングでどのフックが遅いのかをログから特定できるようになる。

関連ドキュメント

v2.1.295(1件)

Fixed
セッション再開時に、未完了のバックグラウンドワークフローが TaskStop によって停止された可能性があると Claude に伝えられる問題を修正した(実際にその原因になることは決してない)
英語原文を表示
Fixed Claude being told on resume that an unfinished background workflow may have been stopped by TaskStop, which can never be the cause

v2.1.294(1件)

Improved
Stop および SubagentStop で「Carry on if the build is broken」のように指示として書かれた prompt フックの判定方法を改善し、Claude が早めに停止しにくくなった
英語原文を表示
Improved how prompt hooks on Stop and SubagentStop written as instructions (such as "Carry on if the build is broken") are judged, so Claude is less likely to stop early

変更後

「ビルドが壊れていたら作業を続ける」のような指示文として書かれた prompt フックを、Claude が正確に判定できるようになり、作業が未完了なのに早く止まってしまうのを防げる。

v2.1.290(1件)

Fixed
プラグインの非同期 Stop フックが Application Support のようなスペースを含むフォルダ配下の引用符で囲まれていないスクリプトパスを渡すと、Claude が無限ループで応答する問題を修正した。
英語原文を表示
Fixed Claude replying in an endless loop when a plugin's async Stop hook passes an unquoted script path under a folder with a space, such as Application Support

v2.1.288(2件)

Fixed
Bedrock の認証情報参照中の Stop が、リクエストを終了させる代わりにセッションをフォールバックモデルへ移すことがある問題を修正した
英語原文を表示
Fixed a Stop during Bedrock credential lookup sometimes moving the session to a fallback model instead of ending the request

関連ドキュメント

Fixed
[クラウドセッション] セルフホストランナーの起動中に Stop を押してもキューに入ったメッセージがキャンセルされず、ランナー起動後に実行される可能性がある問題を修正した
英語原文を表示
[Cloud sessions] Fixed pressing Stop while a self-hosted runner was still starting not cancelling the queued message, which could then run once the runner was up

v2.1.286(1件)

Changed
[VSCode] Stop と Escape を現在のターンだけを終了する動作に変更した。バックグラウンドエージェントは実行を続け、エージェントマップから個別に停止できる
英語原文を表示
[VSCode] Changed Stop and Escape to end only the current turn; background agents keep running and can be stopped one by one from the agent map

変更後

Stop や Esc を押したときに現在のターンだけが終了し、バックグラウンドのエージェントは動き続けるため、作業を止めたくないサブエージェントを誤って中断しなくなる。個々のエージェントはエージェントマップから個別に停止できる。

関連ドキュメント

v2.1.281(4件)

Fixed
ダイアログが開いている間にリモートコントロールの Stop が届いた後、/feedback、/bug、/share で毎回送信に失敗して「フィードバックを送信できませんでした」と表示される問題を修正した
英語原文を表示
Fixed /feedback, /bug and /share failing every send with "Couldn't send feedback" after a Remote Control Stop arrived while the dialog was open

関連ドキュメント

Added
[VSCode] 自動モードが課金対象の分類器リクエストにフォールバックした際、VS Code と JetBrains のパネルに Continue/Stop のプロンプトを表示するようにした。以前の、答えられない警告行を置き換えるもの。
英語原文を表示
[VSCode] Added a Continue/Stop prompt in the VS Code and JetBrains panels when auto mode falls back to billed classifier requests, replacing the unanswerable warning line

変更後

オートモードが従量課金の分類器リクエストにフォールバックした際、続行するか停止するかをパネル上で選択できるようになる。以前は回答できない警告行が表示されるだけだったため、意図せず課金対象のリクエストが実行される前に判断できるようになり、コストを管理しやすくなる。

Added
[Claude Tag] 誰かが Stop を押した後、Slack スレッドに短い行を追加した。Claude の応答を停止した人物の名前を示し、続けるには @Claude をメンションするよう伝える。
英語原文を表示
[Claude Tag] Added a short line in the Slack thread after someone presses Stop, naming who stopped Claude's response and saying to mention @Claude to continue

変更後

Slack スレッドで応答が停止された際に、誰が停止したのかがすぐわかるようになり、続きを依頼したいときに @Claude でメンションすれば再開できることが一目で把握できる。

関連ドキュメント

Fixed
[Claude Tag] Slack で Stop を押した後に Claude が停止済みのリクエストを再開する問題を修正した。たとえばチェックインが発火した場合やバックグラウンドタスクが終了した場合。応答中に送信されたメッセージは読み込まれるようになった。
英語原文を表示
[Claude Tag] Fixed Claude resuming a stopped request after you press Stop in Slack, for example when a check-in fired or a background task ended; messages sent mid-response are now read

関連ドキュメント

v2.1.280(1件)

Added
[Claude Tag] チャンネル内の Claude のスレッドに、Slack ネイティブの Working 表示、Stop ボタン、スレッドタイトルを追加した。Working 表示は Claude の完了まで表示され続け、Stop はタスクに割り込んで中断する
英語原文を表示
[Claude Tag] Added Slack's native Working indicator, Stop button and thread title to Claude's threads in channels; the indicator stays up until Claude finishes, and Stop interrupts the task

変更後

Claude が Slack チャンネルでタスクに取り組んでいる間、作業中インジケーターやスレッドタイトルで進行状況がひと目でわかり、必要に応じて Stop ボタンで中断できるようになる。

v2.1.277(1件)

Added
[VSCode] バックグラウンドシェルやその他の実行中タスクをエージェントマップに追加した。それぞれに Stop が付き、開くための入力コマンド /tasks も用意した
英語原文を表示
[VSCode] Added background shells and other running tasks to the agent map, each with a Stop, and a typed /tasks that opens it

変更後

エージェントマップからバックグラウンドシェルなどの実行中タスクを確認・停止できるようになり、Claudeが裏で動かしているタスクを一目で把握して管理できる。サブエージェントがない場合でも /tasks と入力すればマップを開ける。

関連ドキュメント

v2.1.275(1件)

Fixed
agent type が空の終了中サブエージェントに対して、特定の matcher を持つ SubagentStop フックがすべて発火する問題を修正した。
英語原文を表示
Fixed SubagentStop hooks with a specific matcher firing for every stopping subagent whose agent type was empty

関連ドキュメント

v2.1.274(1件)

Fixed
Stop プロンプトフックが会話内のすべてのブロックに対してプロンプト全体を再送する問題を修正した。繰り返しのブロックには 500 文字のラベルで条件名が示されるようになった
英語原文を表示
Fixed Stop prompt hooks re-sending their whole prompt on every block in a conversation; repeat blocks now name the condition with a 500-character label

関連ドキュメント

v2.1.269(2件)

Added
[VSCode] エージェントマップを追加した。「N agents」のフッターピルから、セッションのサブエージェント一覧をエージェントごとのカード、エージェントの停止ボタン、読み取り専用のトランスクリプト付きで開けるようにした
英語原文を表示
[VSCode] Added an agent map: an "N agents" footer pill opens a map of the session's sub-agents with per-agent cards, Stop agent, and read-only transcripts

変更後

セッションで実行中のサブエージェントを一覧表示するマップを開けるようになり、各エージェントの状況を確認したり、読み取り専用のトランスクリプトを見たり、必要に応じて停止したりできる。

関連ドキュメント

Improved
[VSCode] スラッシュコマンドメニュー、@-メンションメニュー、出力スタイルピッカー、Send/Stop ボタン、権限カードや質問カード、オンボーディングチェックリストにおいて、スクリーンリーダーとキーボードのアクセシビリティを改善した
英語原文を表示
[VSCode] Improved screen reader and keyboard accessibility in the slash-command menu, @-mention menu, output-style picker, Send/Stop button, permission and question cards, and onboarding checklist

変更後

VSCode 拡張機能で、スクリーンリーダー利用者やキーボード操作のみの利用者も、スラッシュコマンドメニューなどの各UI要素を快適に操作できるようになる。

v2.1.261(2件)

Fixed
接続中のスマートフォンやブラウザからターンを停止した後、または /clear などのローカルスラッシュコマンド実行後に、Remote Control セッションが動作中のまま表示される(スピナーと停止ボタンが固まる)問題を修正した。
英語原文を表示
Fixed Remote Control sessions showing as still working (stuck spinner and Stop button) after stopping a turn from a connected phone or browser, or after a local slash command like /clear

関連ドキュメント

Fixed
SDK セッションやクラウドセッションで、最初のプロンプト送信直後・ターン開始前に Stop や割り込みを送っても無視される問題を修正した。現在はターンが停止するようになっている。
英語原文を表示
Fixed SDK and cloud sessions ignoring a Stop or interrupt sent just after the first prompt, before the turn had started; the turn now stops instead of running to completion

v2.1.259(2件)

Fixed
リモートコントロールセッションで Stop がバックグラウンドのエージェントやワークフローを実際には停止しない問題を修正。停止されたタスクはプロセスが終了するまで表示されたまま再停止可能になった
英語原文を表示
Fixed Stop not actually stopping background agents and workflows in remote-control sessions: killed tasks now stay visible and re-stoppable until their processes exit
Fixed
ブロックを返す Stop フックがあると、ブロック後のターンでそのターンのモデルの推論が失われ、一部のモデルではプロンプトキャッシュもヒットしなくなる問題を修正
英語原文を表示
Fixed blocking Stop hooks causing the turn after a block to lose the model's reasoning from that turn and, on some models, miss the prompt cache

関連ドキュメント

v2.1.238(1件)

Fixed
Remote Control のタスクパネルからのタスク単位の停止が、CLI ホストのセッションで機能しない問題を修正する
英語原文を表示
Fixed per-task Stop from the Remote Control tasks panel doing nothing on CLI-hosted sessions

v2.1.203(1件)

Fixed
TaskStopおよびTaskOutputツールが、他のエージェントから起動されたエージェントを検出できるように修正しました。
英語原文を表示
Fixed TaskStop and TaskOutput failing to find background agents spawned by another agent — errors now list running agents by id and description

変更後

複雑なサブエージェント構成でもタスク管理ツールが意図通りに動作します。

v2.1.172(1件)

Changed
リモートセッションにおいて、コンテナを維持できない /loop コマンドの推奨を停止。
英語原文を表示
Stopped promoting /loop in remote sessions, where pending loops don't keep the container alive

変更後

環境に応じた最適なコマンドやワークフローが提案されるようになり、意図せずタスクが中断されるような事故を防げます。

v2.1.163(2件)

Added
フック:Stop および SubagentStop フックが hookSpecificOutput.additionalContext を返せるよう改善。エラー扱いせずに Claude へフィードバックを返し、ターンを継続可能
英語原文を表示
Hooks: Stop and SubagentStop hooks can now return hookSpecificOutput.additionalContext to give Claude feedback and keep the turn going without being labeled a hook error

変更後

特定のタスク終了時にカスタムの指示やフィードバックを自動で挿入できるため、より高度な自動化ワークフローが実現します。

関連ドキュメント

Fixed
デスクトップアプリでバックグラウンドタスクの「Stop」をクリックした際、プロセスが既に終了している場合にチップが消えない問題を修正。
英語原文を表示
Fixed clicking Stop on a background-task chip in the desktop app not clearing the chip when the underlying process was already gone

v2.1.157(1件)

Fixed
[IDE] バックグラウンドでサブエージェントが動作中に「停止」をクリックしても、実際には停止しない問題を修正しました
英語原文を表示
[IDE] Fixed clicking Stop while a background subagent is running not actually stopping it

v2.1.145(1件)

Added
Stop および SubagentStop フックの入力データに background_tasks と session_crons フィールドを追加
英語原文を表示
Stop and SubagentStop hook input now includes background_tasks and session_crons fields

変更後

セッション終了時に未完了のタスクを確認して通知を送ったり、クリーンアップ処理を自動化したりするなど、より高度な自動化スクリプトが作成可能になります。

v2.1.143(1件)

Fixed
ループを繰り返してブロックし続けるStopフックの修正:8回連続でブロックされた場合、警告を表示してターンを終了するようになりました
英語原文を表示
Fixed stop hooks that block repeatedly looping forever — the turn now ends with a warning after 8 consecutive blocks (override via CLAUDE_CODE_STOP_HOOK_BLOCK_CAP)

変更後

バグのあるフックスクリプトによる意図しない課金の発生を防ぎ、安全に自動化を運用できます。

関連ドキュメント

v2.1.136(1件)

Fixed
キャッシュクリーンアップによって使用中のバージョンが削除された際、プラグインの Stop や UserPromptSubmit フックが失敗する問題を修正しました。
英語原文を表示
Fixed plugin Stop/UserPromptSubmit hooks failing when cache cleanup deletes a version still in use by a running session

変更後

バックグラウンドのメンテナンス処理を気にすることなく、安定してプラグインや自動化フックを利用し続けることができます。

関連ドキュメント

v2.1.118(1件)

Fixed
エージェント型フックが Stop 等の特定のイベント以外で「メッセージが必要」というエラーで失敗する問題を修正
英語原文を表示
Fixed agent-type hooks failing with "Messages are required for agent hooks" when configured for events other than Stop or SubagentStop

変更後

特定のライフサイクルイベントにおいて、エージェントによる高度な自動検証を柔軟に組み込めるようになります。

関連ドキュメント

v2.1.98(1件)

Fixed
長時間セッションでのプロンプト型 Stop/SubagentStop フックの失敗、およびフック評価時の API エラーが不正確に表示される問題を修正しました。
英語原文を表示
Fixed prompt-type Stop/SubagentStop hooks failing on long sessions, and hook evaluator API errors showing "JSON validation failed" instead of the real message

変更後

ワークフローの自動化や検証をフックで行っている場合、その信頼性とメンテナンス性が大幅に向上します。

関連ドキュメント

v2.1.97(1件)

Fixed
長いセッションでプロンプトタイプのStop/SubagentStopフックが失敗する問題、およびフック評価時のAPIエラーが具体的なメッセージではなく「JSON validation failed」と表示される問題を修正しました。
英語原文を表示
Fixed prompt-type Stop/SubagentStop hooks failing on long sessions, and hook evaluator API errors displaying "JSON validation failed" instead of the actual message

変更後

自動化された後処理や通知が確実に実行されるようになり、開発ワークフローの信頼性が向上します。

関連ドキュメント

v2.1.92(1件)

Fixed
Stopイベントのプロンプト型フックが特定の応答で誤って失敗する問題を修正し、継続防止セマンティクスを復元。
英語原文を表示
Fixed prompt-type Stop hooks incorrectly failing when the small fast model returns ok:false, and restored preventContinuation:true semantics for non-Stop prompt-type hooks

変更後

フックを利用した自動化プロセスの信頼性が向上し、特定の条件下で処理を確実に停止させることが可能になります。

関連ドキュメント

v2.1.78(1件)

Added
APIエラー(レート制限、認証失敗など)によりターンが終了した際に発火する StopFailure フックイベントを追加
英語原文を表示
Added StopFailure hook event that fires when the turn ends due to an API error (rate limit, auth failure, etc.)

変更後

エラー発生時の後処理を自動化し、モニタリングやトラブルシューティングの効率を向上させることができます。

関連ドキュメント

v2.1.69(2件)

Fixed
Fixed TeammateIdle and TaskCompleted hooks to support {"continue": false, "stopReason": "..."} to stop the teammate, matching Stop hook behavior

関連ドキュメント

v2.1.64(1件)

Fixed
TeammateIdle および TaskCompleted フックにおいて、Stop フックと同様の {"continue": false, "stopReason": "..."} 形式によるチームメイトの停止をサポートしました。
英語原文を表示
Fixed TeammateIdle and TaskCompleted hooks to support {"continue": false, "stopReason": "..."} to stop the teammate, matching Stop hook behavior

変更後

チームメイトの無駄な待機時間を削減し、特定の状況下での自動化フローの制御がより正確に行えるようになります。

関連ドキュメント

v2.1.47(1件)

Added
StopおよびSubagentStopフック入力に last_assistant_message フィールドを追加しました。これにより、フックはトランスクリプトファイルを解析することなく、最終的なアシスタントの応答テキストにアクセスできるようになります。
英語原文を表示
Added last_assistant_message field to Stop and SubagentStop hook inputs, providing the final assistant response text so hooks can access it without parsing transcript files.

変更後

フック開発者がアシスタントの最終応答に簡単にアクセスできるようになり、より効率的で堅牢なフックの作成が可能になりました。

関連ドキュメント

v2.1.30(1件)

Improved
TaskStopツールを改善し、結果行に汎用的な「Task stopped」メッセージの代わりに、停止したコマンド/タスクの説明を表示するようにしました。
英語原文を表示
Improved TaskStop tool to display the stopped command/task description in the result line instead of a generic "Task stopped" message

変更後

どのタスクが停止されたのかを明確に把握できるようになり、デバッグや進捗管理が容易になりました。

v2.1.0(1件)

Added
エージェントのフロントマターでフック設定が可能になり、エージェントの生存期間に限定したフックを定義できるようになりました。
英語原文を表示
Added hooks support to agent frontmatter, allowing agents to define PreToolUse, PostToolUse, and Stop hooks scoped to the agent's lifecycle

v2.0.42(1件)

v2.0.28(1件)

v1.0.45(1件)

Changed
Stop Hooks: Fixed transcript path after /clear and fixed triggering when loop ends with tool call

v1.0.41(1件)

Changed
Hooks: Split Stop hook triggering into Stop and SubagentStop