{"version":"2.1.269","anchor":"new-basheditdiff-snapshotdiff-tracking-system-for-the-bas","canonical_anchor":"bash-tool-can-now-show-a-diff-of-files-it-edited","heading":"Bash tool can show a diff of files it changed","tier":"use","area":"Bash Tool","scope":null,"heads_up":null,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.269\/e\/new-basheditdiff-snapshotdiff-tracking-system-for-the-bas","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.269","markdown":"### Bash tool can show a diff of files it changed\n\nA new bashEditDiffEnabled setting lets the Bash tool surface a diff of files a shell command changed, passed to PostToolUse hooks too\n\n**Unclear.** The finding doesn't say what this diff information is used for once computed, or what the default behavior is.\n\n**What**\n\n- 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.\n\n- 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.\n\n- 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.\n\n- 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).\n\n- 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.\n\n**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.\n\n- Area: Bash Tool\n- Names: `CLAUDE_CODE_BASH_EDIT_DIFF`\n- Tier: Use it now\n- Useful: 5\/5\n- Signal: 4\/5\n- Present in the build but not switched on"}