Skip to content

Encryptioner/branchdiff

Repository files navigation

branchdiff

Visual git diff in your browser — local, no cloud, no telemetry.

npm license

Install

npm install -g @encryptioner/branchdiff

Requires Node.js 18+ and git on your PATH. Tab-completion installs automatically — restart your terminal after install.

Also works without installing: npx @encryptioner/branchdiff main..feature

Common tasks

I want to… Command
See my uncommitted changes branchdiff
Compare with main branchdiff main
Compare two branches branchdiff main feat
View a GitHub PR branchdiff https://github.com/owner/repo/pull/123
Browse repo files branchdiff tree
View last commit branchdiff HEAD~1
Dark mode / unified view branchdiff main --dark --unified

Any ref works: branch name, commit SHA, tag, HEAD~N, origin/<branch>.

AI review

branchdiff main feat    # 1. Start branchdiff (leave running)

Claude Code — install skills once, then use slash commands:

branchdiff review skill   # creates .claude/skills/branchdiff-{review,resolve}.md

Then in Claude Code chat:

  • /branchdiff-review → AI reviews the diff and posts inline comments
  • /branchdiff-resolve → AI fixes all open comments

Any other AI — copy-paste one of these prompts:

Review:

You are reviewing code using branchdiff agent commands (not any other tool).
Run `branchdiff review guide` first to load the full reference, then:
1. Run `branchdiff agent diff` to read the full diff.
2. Post comments: branchdiff agent comment --file <path> --line <n> --body "[tag] message"
   Tags: [must-fix] bugs/security · [suggestion] improvements · [nit] style · [question] unclear
3. Confirm: branchdiff agent list --status open
Start: branchdiff review guide

Resolve:

You are resolving open review comments using branchdiff agent commands.
Run `branchdiff review guide` first to load the full reference, then:
1. Run `branchdiff agent list --status open --json` to get open threads.
2. Fix the code, then: branchdiff agent resolve <id> --summary "what you did"
   Or dismiss: branchdiff agent dismiss <id> --reason "why"
Start: branchdiff review guide

Or pipe to a CLI AI tool:

branchdiff review context | claude -p "review for security"
branchdiff review run --exec "claude" --mode review

Full guide with 8 AI workflows: AI-REVIEW.md

Keyboard shortcuts (in the browser)

Key Action
j / k Next / previous file
n / p Next / previous hunk
Shift+X Collapse / expand all
? Show all shortcuts

Docs

Guide What it covers
USAGE.md All commands, modes, options, troubleshooting
AI-REVIEW.md AI review, resolve, tour, security audit workflows
DEVELOPMENT.md Contributor setup, build, releasing

Why branchdiff?

Standard git diff compares commit ancestry — it can show a "change" when both branches actually contain identical content (just via different commits). branchdiff's file mode compares actual file content at each branch tip:

main:  A → B → C → D   (file.js = "hello world")
feat:  A → X → Y       (file.js = "hello world")

git diff main..feat  →  shows diff  (different commit paths)
branchdiff main feat →  no diff     (same content)

Switch between modes in the browser toolbar, or use --mode file / --mode git.

Features

  • Syntax highlighting (150+ languages), split and unified views
  • Inline comments with severity tags ([must-fix], [suggestion], [nit], [question])
  • Full view mode — VS Code-style side-by-side full file view
  • Delta mode (Δ) — highlights what each diff mode reports differently
  • GitHub PR integration — push/pull review comments
  • Multiple repos open simultaneously on different ports
  • 100% local — no telemetry, no cloud, no API key

Contributing

Bug reports and PRs welcome: https://github.com/Encryptioner/branchdiff/issues

See DEVELOPMENT.md for setup.

License

MIT — see LICENSE.md

Support

SupportKori

Inspired by Diffity

About

Visual file-level git branch diff in your browser.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors