Sweep 19 Sep 2026 · 02:36Z Build v2.1.278 500 read Stable v2.1.267 Latest v2.1.278 Next v2.1.278 Feeds RSS JSON llms.txt Unofficial
Claude Code v2.1.269 ·

Bash tool can show a diff of files it changed

A new bashEditDiffEnabled setting lets the Bash tool surface a diff of files a shell command changed, passed to PostToolUse hooks too

TierUse it nowhow much it should matter to you
Useful5my rating, 1 to 5
Signal3worth watching, 1 to 5
AreaBash Toolwhat it touches
KindNew Featuresin v2.1.269,
Group of 4 Use it now Notable

A new bashEditDiffEnabled setting lets the Bash tool surface a diff of files a shell command changed, passed to PostToolUse hooks too

What

  • A new bashEditDiffEnabled settings.json key (and CLAUDE_CODE_BASH_EDIT_DIFF environment variable override) controls whether the Bash tool computes and shows a diff of files changed by a shell command.
  • Under the hood, this is backed by git-based snapshots taken before and after a Bash command (via a sandboxed git wrapper), with filesystem watchers (inotify on Linux, fs.watch elsewhere) to catch changes made outside the tracked diff.
  • The result appears as bashEditDiff on the Bash tool's result, and PostToolUse hooks for Bash now receive the list of changed files in tool_response too.
  • It's skipped for destructive git operations run via Bash (checkout, switch, stash, pull, merge, rebase, reset, restore, clean, cherry-pick, revert), and reports status through telemetry (bash_edit_diff, and unavailable/interrupted variants).
  • Outside auto or bypassPermissions modes, only a user, flag, or policy setting can turn this on; the docs describe it as on by default when the Bash tool handles file edits.

Why This lets Claude Code (and hooks watching its actions) see exactly what a shell command changed on disk, without having to separately diff the repo, making Bash tool calls more transparent and auditable.

Read from
Names in the bundlebashEditDiffEnabledCLAUDE_CODE_BASH_EDIT_DIFF
What the documentation says
Since it was published

The entry above is what we published on the day. These lines were added later, as Anthropic's own pages caught up, and they sit beside the original rather than replacing it.

Confirmed since Anthropic's documentation has since written up CLAUDE_CODE_BASH_EDIT_DIFF, on All settings. * **Per-session overrides**: [`CLAUDE_CODE_BASH_EDIT_DIFF`](/docs/en/env-vars) takes precedence over this key for one session settings-reference see the edit
Confirmed since Anthropic's documentation has since written up bashEditDiffEnabled, on Hooks reference. When a Bash command changes files in a Git repository, Claude Code can record what changed. It records the changes in every permission mode when the [`bashEditDiffEnabled`](/docs/en/settings-reference#basheditdiffenabled) setting turns rec… hooks see the edit
Added since A small documentation edit on Environment variables touched a line naming bashEditDiffEnabled after this was published. | `CLAUDE_CODE_BASH_EDIT_DIFF` | Set to `0` to turn off the [diff of the files a Bash command changed](/docs/en/hooks#bash), or `1` to record it in every permission mode. Takes precedence over the [`bashEditDiffEnabled`](/docs/en/settings-… env-vars see the edit
Added since A small documentation edit on Environment variables touched a line naming CLAUDE_CODE_BASH_EDIT_DIFF after this was published. | `CLAUDE_CODE_BASH_EDIT_DIFF` | Set to `0` to turn off the [diff of the files a Bash command changed](/docs/en/hooks#bash), or `1` to record it in every permission mode. Takes precedence over the [`bashEditDiffEnabled`](/docs/en/settings-… env-vars see the edit
How sure we are
Two sources agreeTwo things we can check say the same as this entry.
Anthropic's documentation agreesA small documentation edit on Environment variables touched a line naming CLAUDE_CODE_BASH_EDIT_DIFF after this was published.
Anthropic's release notes agreeAdded a diff of the files a Bash command changed to the Bash tool result when the Bash tool handles file edits (setting bashEditDiffEnabled)
The name it cites is new in this buildNew in this build: CLAUDE_CODE_BASH_EDIT_DIFF

See this entry in the whole of v2.1.269 →