Skip to content

saadnvd1/cc-diff

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cc-diff

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.

Install

git clone https://github.com/saadnvd1/cc-diff && cd cc-diff && ./install.sh

This links cc-diff to ~/.local/bin and adds the PostToolUse hook to Claude Code settings.

Requires fzf. Optional: delta for prettier diffs.

Usage

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

How it works

  1. A PostToolUse hook calls cc-diff log after every Edit/Write
  2. File paths are logged to /tmp/cc-diff.log
  3. cc-diff reads the log and shows files in fzf with live diff preview

That's it. ~230 lines of bash.

Keybindings

Key Action
/ Navigate files
Enter View full diff in pager
Ctrl+Y Copy file path
Esc Exit

Configuration

Variable Description Default
CC_DIFF_LOG Log file path /tmp/cc-diff.log
CC_DIFF_CMD Diff command git diff

FAQ

Can I use this with other AI coding tools?

The hook is specific to Claude Code's PostToolUse event, but you could adapt the log mechanism for any tool that edits files.

Do I need delta?

No. It works with plain git diff. Delta just makes it prettier.

What if the installer can't update my settings?

Add the hook manually to ~/.claude/settings.json:

{
  "hooks": {
    "PostToolUse": [
      {
        "matcher": "Edit|Write",
        "hooks": [
          {
            "type": "command",
            "command": "cc-diff log"
          }
        ]
      }
    ]
  }
}

Related

  • 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

License

MIT

About

Track and review files changed by Claude Code. fzf-powered interactive diff viewer.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors