A local web app for intelligently reviewing large git diffs — built for the age of AI-generated code.
DiffDragon transforms overwhelming git diffs into prioritized, summarized, and semantically grouped review sessions. Instead of scrolling through hundreds of changed files line-by-line, you get an intelligent triage system that surfaces what matters most.
Files are automatically scored and sorted by review priority based on heuristics:
- Security-sensitive paths (auth, crypto, permissions)
- Database/migration changes
- Public API surface modifications
- Error handling removals
- Configuration changes
- Size and complexity of changes
Each file and diff hunk gets a concise natural language summary explaining what changed and why it matters. Supports two AI backends:
- Anthropic Claude API — high-quality summaries via the Claude API
- Ollama (local) — fully offline summaries using any local model
Files are grouped by intent rather than directory structure:
feature— new functionalityrefactor— restructuring without behavior changebugfix— bug fixestest— test additions/modificationsconfig— configuration and build changesdocs— documentation updatesstyle— formatting, whitespace, naming
AI generates context-aware review checklists per file based on the actual changes:
- SQL injection checks for database code
- Auth middleware verification for new endpoints
- Error handling coverage
- Input validation reminders
- Go 1.21+ — Install Go
- Node.js 18+ and pnpm — for building the frontend
- Git — must be available on your PATH
- Anthropic API Key (optional) — for Claude-powered summaries. Get one at console.anthropic.com
- Ollama (optional) — for local AI summaries. Install from ollama.com
# Clone the repository
git clone <your-repo-url>
cd diffdragon
# Build (frontend + Go binary)
make buildThis builds the React frontend into static/, then compiles a single Go binary with everything embedded. No runtime dependencies needed — the binary is fully self-contained.
./diffdragon --repo /path/to/your/repo --base mainThen open http://127.0.0.1:8384 in your browser.
export ANTHROPIC_API_KEY=sk-ant-...
./diffdragon --repo /path/to/your/repo --base main --ai claude# Make sure Ollama is running with a model pulled
ollama pull llama3.1
./diffdragon --repo /path/to/your/repo --base main --ai ollama --ollama-model llama3.1./diffdragon --repo /path/to/your/repo --base main --head feature/my-branch./diffdragon --repo /path/to/your/repo --staged./diffdragon --repo /path/to/your/repo --unstaged./diffdragon --repo /path/to/your/repo --base main --port 9090Yes, this is possible.
DiffDragon builds to a single self-contained binary, so you can:
- clone and build once,
- move/copy the binary to a folder on your
PATH, - run it from any terminal, and
- optionally register it as a background service so it keeps running without an open terminal.
git clone <your-repo-url>
cd diffdragon
make buildThis produces a diffdragon binary in the repo root.
sudo install -m 755 ./diffdragon /usr/local/bin/diffdragonNow you can run:
diffdragon- Build
diffdragon.exe - Copy it to a stable folder, for example
C:\Tools\diffdragon\diffdragon.exe - Add
C:\Tools\diffdragonto your User PATH
Then open a new terminal and run:
diffdragon.exeYou can host DiffDragon as a local service on any PC.
Create ~/Library/LaunchAgents/com.diffdragon.app.plist pointing to:
- executable:
/usr/local/bin/diffdragon - args:
--port 8384(and any other flags you want)
Load it:
launchctl load ~/Library/LaunchAgents/com.diffdragon.app.plistCreate ~/.config/systemd/user/diffdragon.service with:
[Unit]
Description=DiffDragon local service
[Service]
ExecStart=/usr/local/bin/diffdragon --port 8384
Restart=on-failure
[Install]
WantedBy=default.targetEnable and start:
systemctl --user daemon-reload
systemctl --user enable --now diffdragonUpdate an already running local service (rebuild + reinstall + restart):
make release-service-updateIf your service name differs, override it:
make release-service-update SERVICE=diffdragonUse Task Scheduler to create a task that starts diffdragon.exe at login.
Run whether user is logged in or not if you want it always available.
After setup, open http://127.0.0.1:8384 in your browser.
| Flag | Default | Description |
|---|---|---|
--repo |
(empty) | Optional initial git repository path |
--base |
main |
Base ref to diff against |
--head |
HEAD |
Head ref to diff |
--staged |
false |
Review staged changes only |
--unstaged |
false |
Review unstaged (working dir) changes |
--port |
8384 |
Port for the local web server |
--ai |
none |
AI provider: none, claude, ollama |
--ollama-model |
llama3.1 |
Ollama model to use |
--ollama-url |
http://localhost:11434 |
Ollama API endpoint |
--dev |
false |
Dev mode: proxy static files to Vite dev server |
--vite-url |
http://localhost:5173 |
Vite dev server URL (used with --dev) |
| Variable | Description |
|---|---|
ANTHROPIC_API_KEY |
API key for Claude-powered summaries |
OLLAMA_URL |
Override Ollama endpoint (default: http://localhost:11434) |
| Key | Action |
|---|---|
j / ArrowDown |
Next file |
k / ArrowUp |
Previous file |
r |
Toggle file as reviewed |
/ |
Focus search input |
Run the frontend dev server and Go backend in two separate terminals:
# Terminal 1: Frontend with hot reload (proxies /api to Go backend)
make dev-frontend
# Terminal 2: Go backend
make dev-backendThe frontend dev server runs on http://localhost:5173 with HMR and proxies all /api requests to the Go backend on :8384.
Other useful commands:
# Full production build
make build
# Run Go tests
go test ./...
# Clean build artifacts
make cleandiffdragon/
├── main.go # Entry point, CLI flags, server startup
├── git.go # Git diff parsing and file extraction
├── analysis.go # Risk scoring and semantic grouping
├── ai.go # AI provider abstraction (Claude + Ollama)
├── handlers.go # HTTP API handlers + SPA fallback
├── go.mod # Go module definition
├── Makefile # Build automation
├── frontend/ # React + TypeScript frontend (Vite)
│ ├── src/
│ │ ├── components/ # React components (shadcn/ui)
│ │ ├── stores/ # Zustand state management
│ │ ├── hooks/ # Custom React hooks
│ │ ├── lib/ # API client and utilities
│ │ └── types/ # TypeScript interfaces
│ ├── package.json
│ └── vite.config.ts
├── static/ # Built frontend output (embedded in binary)
└── README.md
- Parse — Runs
git diffon your repo and parses it into structured file/hunk data - Analyze — Each file is risk-scored (0-100) and semantically categorized using pattern matching heuristics
- Serve — Starts a local HTTP server with the React SPA and JSON API endpoints
- Review — The frontend renders files in a prioritized, collapsible interface with diff viewer
- Summarize — If an AI provider is configured, files can be summarized on-demand via the UI
- Backend: Go standard library only (zero external Go dependencies)
- Frontend: React + TypeScript, Vite, shadcn/ui, Tailwind CSS, Zustand, Lucide icons
- Fonts: DM Sans (UI) and JetBrains Mono (code), bundled via
@fontsourcefor offline use - Distribution: Single binary with embedded frontend via
embed.FS
| Method | Path | Description |
|---|---|---|
GET |
/ |
Serves the React SPA |
GET |
/api/diff |
Returns the full parsed, analyzed diff |
POST |
/api/summarize |
AI summarization for a specific file or hunk |
POST |
/api/checklist |
Generates review checklist for a specific file |
POST |
/api/summarize-all |
Batch AI summarization for all files |
Thanks for your interest in improving DiffDragon. Contributions are welcome.
- Fork the repository and create a feature branch.
- Keep changes focused and add context in the PR description.
- Run
go test ./...before opening a PR. - If you update the frontend, run the relevant frontend build/dev commands and mention any UI changes.
MIT. See LICENSE.