Track and view files changed by Claude Code with an fzf-powered diff viewer. Like Cursor, but for your terminal.
See what Claude changed without leaving your terminal. No more guessing what changed!
git clone https://github.com/saadnvd1/cc-diff
cd cc-diff
./install.shThis will:
- Link
cc-diffto~/.local/bin - Add a PostToolUse hook to Claude Code settings
Make sure ~/.local/bin is in your PATH. Add to your shell config (~/.zshrc or ~/.bashrc):
export PATH="$HOME/.local/bin:$PATH"fzf- Interactive file pickergit- For diffs- Optional:
deltafor prettier diffs - Optional:
xcliporxselfor clipboard support on Linux
macOS:
brew install fzf git-deltaLinux (Debian/Ubuntu):
sudo apt install fzf xclipcc-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)While Claude is waiting for input, prefix with !:
!cc-diff
- Hook: When Claude Code edits/writes a file, a hook logs the file path to
/tmp/cc-diff.log - Viewer:
cc-diffreads this log and shows files in an fzf picker with live diff preview
If the installer couldn't update your settings, add this to ~/.claude/settings.json:
{
"hooks": {
"PostToolUse": [
{
"matcher": "Edit|Write",
"hooks": [
{
"type": "command",
"command": "cc-diff log"
}
]
}
]
}
}| Key | Action |
|---|---|
↑/↓ |
Navigate files |
Enter |
View full diff in pager |
Ctrl-Y |
Copy file path |
Esc |
Exit |
Environment variables:
CC_DIFF_LOG- Log file path (default:/tmp/cc-diff.log)CC_DIFF_CMD- Diff command (default:git diff)
- Start a Claude Code session
- Run
!cc-diff clearto start fresh - Work with Claude...
- Run
!cc-diffanytime to see what changed - Browse files, preview diffs, review changes