Claude Code Adds Diffs for Bash Tool File Edits

Claude CodeView original changelog

Claude Code 2.1.269 added a new bashEditDiffEnabled setting that shows a diff of the files a Bash command changed, directly in the Bash tool's result. Until now, a file edited through a shell command such as sed or a Python heredoc gave a user no equivalent of the diff view that the dedicated Edit and Write tools already show, making it harder to review exactly what a Bash-driven edit had done. With the setting on, Claude Code surfaces that diff automatically whenever the Bash tool is used to modify a file.

Key Takeaways

  • A new bashEditDiffEnabled setting adds a diff to the Bash tool's result whenever a Bash command modifies a file.
  • The change closes a long-standing visibility gap between the Edit/Write tools, which always showed diffs, and Bash-driven file edits, which did not.
  • It matters most for edits Claude makes through commands like sed or Python heredocs, patterns commonly used for multi-line or bulk changes that don't fit Edit's exact-match model.
  • The feature gives users a consistent review experience regardless of which tool performed a file edit.
  • It ships in version 2.1.269, released September 11, 2026, alongside a batch of VS Code and permission-related changes.
  • The setting is opt-in, meaning existing workflows are unaffected unless a user or administrator turns it on.

Closing a Visibility Gap

Claude Code's Edit and Write tools have always shown a diff of what they changed, giving a user a clear before-and-after view to review before or after approving an action. The Bash tool never had an equivalent: when Claude used a shell command like sed -i or a Python one-liner to modify a file instead of calling Edit directly, the change happened without the same visual review, even though the practical effect on the file was identical.

That gap mattered because Claude routinely reaches for Bash to make text edits, particularly for patterns that are awkward to express through the Edit tool's exact-match replacement, such as multi-line regex substitutions or bulk renames. A user reviewing a session's history had no easy way to see what those Bash-driven edits actually did to a file without opening it separately.

What Changed

With the new bashEditDiffEnabled setting, Claude Code now detects when a Bash command has modified a file and attaches a diff of that change to the Bash tool's result, the same kind of view already familiar from the Edit and Write tools. This gives users consistent visibility into file changes regardless of which tool Claude used to make them.