Track and review files changed by Claude Code — fzf-powered interactive diff viewer
Claude Code edits files, but you can't easily see what changed. cc-diff hooks into Claude Code's PostToolUse event, logs every file edit, and gives you an fzf-powered browser with live diff preview.
Zero dependencies beyond bash, git, and fzf. Single file. Works on macOS and Linux.
git clone https://github.com/saadnvd1/cc-diff && cd cc-diff && ./install.shThis links cc-diff to ~/.local/bin and adds the PostToolUse hook to Claude Code settings.
Requires fzf. Optional: delta for prettier diffs.
cc-diff # Interactive browser with diff preview
cc-diff list # List changed files
cc-diff diff # Show full diff of all changes
cc-diff clear # Clear log (start fresh before new task)From within Claude Code, prefix with !:
!cc-diff
- A PostToolUse hook calls
cc-diff logafter every Edit/Write - File paths are logged to
/tmp/cc-diff.log cc-diffreads the log and shows files in fzf with live diff preview
That's it. ~230 lines of bash.
| Key | Action |
|---|---|
| ↑ / ↓ | Navigate files |
| Enter | View full diff in pager |
| Ctrl+Y | Copy file path |
| Esc | Exit |
| Variable | Description | Default |
|---|---|---|
CC_DIFF_LOG |
Log file path | /tmp/cc-diff.log |
CC_DIFF_CMD |
Diff command | git diff |
The hook is specific to Claude Code's PostToolUse event, but you could adapt the log mechanism for any tool that edits files.
No. It works with plain git diff. Delta just makes it prettier.
Add the hook manually to ~/.claude/settings.json:
{
"hooks": {
"PostToolUse": [
{
"matcher": "Edit|Write",
"hooks": [
{
"type": "command",
"command": "cc-diff log"
}
]
}
]
}
}- cc-remote - Launch Claude Code sessions on a remote VM
- cc-deploy - One-command deployment for Claude Code
- hydra - Never stop coding when your AI CLI hits a rate limit
MIT
