{"version":"2.1.335","anchor":"failed-bash-edit-diff-field","canonical_anchor":"failed-bash-edit-diff-field","heading":"Failed Bash commands can now report the file changes they made","tier":"internal","area":"SDK","scope":"individual","heads_up":false,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.335\/e\/failed-bash-edit-diff-field","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.335","markdown":"### Failed Bash commands can now report the file changes they made\n\nWhen a Bash command fails, its result can now include the files it changed, sent only to hosts that ask for it at start\n\n**What**\n\nWhen Claude runs a shell command through the Bash tool and the command fails, Claude Code can now pass along the files that command changed. A host is the program that embeds Claude Code and draws its screen, such as an IDE extension or an app built on the SDK (the kit for building programs on top of Claude Code). Here is how the change is passed along:\n\n- `bash_edit_diff` is a new internal field in the SDK message format that holds the files a failed Bash command changed.\n\n- `setHostDrawsBashEditDiff` is a new host option. The field is sent only when the host asks for it at start.\n\n- `editDiff` is now carried on the Bash tool's result.\n\n- `bashEditDiff` is now added to errored tool results that have an `editDiff`. A new check decides this, and by default it always allows it.\n\nThe same release also changes how tools run. A running tool now holds a cleanup stack (`AsyncDisposableStack`), and `untilHooksEnd` is passed into the tool's context. A hook is a user-defined script that Claude Code runs at set points, and this lets a tool stay open until the hooks running alongside it have finished.\n\n**Why**\n\nA command that fails partway can still have edited files. Hosts that opt in can now show those edits instead of only the error. Hook timing around tool runs may also differ slightly.\n\n- Area: SDK\n- Names: `setHostDrawsBashEditDiff`\n- Tier: Under the hood\n- Useful: 3\/5\n- Signal: 3\/5\n- Scope: individual\n- Heads-up: no"}