Chat doesn't show what a Bash command changed: the CLI's bashEditDiff is never rendered
What happens
When an agent changes files through a Bash command (sed -i, a heredoc, a formatter, git apply), the chat shows the command and its output and nothing else. The terminal CLI shows a diff of what the command changed underneath it. In auto mode this covers most edits, because that mode routes file changes through Bash, so the web UI misses most of what an auto-mode agent actually changed.
The data is already there
In auto and bypassPermissions permission modes, Claude Code snapshots the repository around each Bash call and records the change on the tool result as bashEditDiff: unified hunks, the same shape an Edit carries:
// toolUseResult (transcript) / tool_use_result (live SDK frame)
{
"stdout": "", "stderr": "", "interrupted": false, "isImage": false, "noOutputExpected": true,
"bashEditDiff": {
"changedFiles": ["/repo/f.txt"],
"moreFiles": 0, // files the CLI left out (binary, mode-only, too large)
"files": [{
"filePath": "/repo/f.txt",
"hunks": [{ "oldStart": 1, "oldLines": 2, "newStart": 1, "newLines": 2,
"lines": [" alpha", "-beta", "+gamma"] }]
}]
}
}It is computed when the permission mode is auto or bypassPermissions, or when the bashEditDiffEnabled setting or the CLAUDE_CODE_BASH_EDIT_DIFF env var turns it on. Verified live through @anthropic-ai/claude-agent-sdk with permissionMode: 'auto': the streamed user frame carries tool_use_result.bashEditDiff, and the transcript line carries toolUseResult.bashEditDiff.
On main the server already forwards it live: claude-sessions.provider.ts:1219 reads raw.toolUseResult ?? raw.tool_use_result. So this is frontend-only now. (1.37.3 predates that line, so on the current release live turns lose the field until the session is reloaded from disk.)
Where it would go
src/modules/chat/tools/ToolRenderer.tsx:120: the toolName === 'Bash' && mode === 'input' branch renders BashCommandDisplay from the input and the result's content and ignores toolResult.toolUseResult. Drawing toolUseResult.bashEditDiff below the command, one block per file with the existing red/green diff styling, would cover it. A header like "N more files changed" would account for moreFiles. When there's no bashEditDiff (no files changed, or a mode that doesn't compute it), nothing is drawn.
I've been running this as a local patch on 1.37.3 (one collapsible block per file, open by default, class strings reused from the existing Edit diff viewer) and can turn it into a PR if the approach sounds right.
Source: siteboon/claudecodeui