-
Notifications
You must be signed in to change notification settings - Fork 107
Open
Description
Problem
When Claude Code modifies files via the Bash tool (e.g. cp, mv, code generators, build scripts), those changes are not attributed to AI. They silently appear as human-authored lines in git-ai blame and stats.
Root cause
The Claude Code hook installer (claude_code.rs) sets the PostToolUse matcher to Write|Edit|MultiEdit only. The Bash tool is not included, so no checkpoint is triggered when Bash modifies files.
Reproduction
- In a Claude Code session, ask Claude to copy or generate a file using Bash (e.g. cp foo.rs bar.rs)
- Commit the result
- Run git-ai show — prompts is empty {}
- Run git-ai blame — all lines show as human-authored
Expected behavior
File changes caused by the Bash tool should be attributed to AI, same as Write/Edit.
Suggested fix
- Add Bash to the PostToolUse matcher in claude_code.rs
- In ClaudePreset::run (agent_presets.rs), handle tool_name == "Bash" by setting edited_filepaths to None so the checkpoint falls back to scanning dirty files via git status, rather than relying on tool_input.file_path (which Bash doesn't provide)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels