bashEditDiffEnabled

settings.json型boolean記述場所ユーザー設定または管理者設定

Bash コマンドの実行中に Git リポジトリ内でどのファイルが変更されたかを Claude Code が記録するかどうかを選ぶ。記録する場合、コマンド実行後にターミナルでその差分が表示され、PostToolUse Bash フックに変更ファイルのリストが渡される。

既定値未設定であるため、auto モードおよび bypassPermissions モードで、Claude に Bash 経由でファイル編集を指示したときに変更を記録する。

記述例

{
  "bashEditDiffEnabled": true
}

使い方・用途

  • Bash コマンド経由で行われたファイル編集の差分をターミナル上で確認したい場合に使う
  • Bash コマンドが Git リポジトリ内で変更したファイルの一覧を PostToolUse Bash hooks に渡し、自動化処理につなげたい場合に使う
  • Bash ツールによるファイル編集の結果として、変更差分を Bash ツールの実行結果に表示したい場合に使う
英語原文

Choose whether Claude Code records which files changed in a Git repository while a Bash command runs. When it records them, you see their diff in the terminal after the command, and your PostToolUse Bash hooks receive the changed-file list.

関連する変更履歴

v2.1.269(1件)

Bash ツールがファイル編集を処理する際、Bash ツールの結果にコマンドが変更したファイルの差分を含めるようにした(設定キー bashEditDiffEnabled)
英語原文を表示
Added a diff of the files a Bash command changed to the Bash tool result when the Bash tool handles file edits (setting bashEditDiffEnabled)

変更後

Bash コマンド経由でファイル編集が行われた場合でも、その変更内容の diff を Bash ツールの結果内で確認できるようになる。sed やスクリプト実行などでファイルが書き換えられた際に、どの部分がどう変わったのかをすぐに把握できる。