Local-first AI code review

AI organizes the review.
You approve the code.

Diffthing transforms AI-generated code into a deterministic, prioritized review walkthrough. Every approval remains yours.

Agent writes codeAI organizes the reviewHumans approve
local.diffthing.dev28 hunks
Diffthing review UI: a split diff with an AI-organized walkthrough of scopes and steps in the sidebar.
The problem

Git diffs were built for humans, not agents.

A person edits a few files with intent. An agent rewrites twelve at once — fast, wide, and flat. The unified patch that served hand-written commits collapses under that volume, and review quietly becomes skimming.

01

Volume outruns attention

Dozens of unrelated hunks land in one patch. Nothing tells you which three actually carry risk, so every line gets the same tired glance.

02

No structure, no priority

A flat file-ordered list has no notion of what belongs together or what matters most. Related changes scatter; the important ones hide among the trivial.

03

State resets on every edit

The agent keeps editing while you review. Line numbers shift, your place is lost, and “already looked at that” evaporates. So the change ships half-read.

How it works

A deterministic pipeline, not a black box.

The LLM only proposes structure. Code decides what’s risky, verifies the walkthrough covers every hunk exactly once, and falls back to file order if the model misbehaves.

01

Git Diff

Working-tree changes parsed into hunks, keyed by content hash.

02

Deterministic Scoring

Impact scored by code — never the model. Risk stays reproducible.

03

LLM Walkthrough

Your installed agent groups hunks into named scopes and ordered.

04

Validator

Every hunk covered once, only real hunks referenced — or retry, then fallback.

05

Review UI

Streamed to your browser over a token-gated, loopback-only WebSocket.

AI organizes.
Humans judge.

The product boundary never moves. AI organizes and executes explicit requests. It never approves, rejects, or scores correctness. Every judgment on the page is yours.

The product

Built for the way agents actually change code.

Review focus

Start with what matters.

Every session opens with an AI-written focus note and a live progress meter — so you know where the risk sits before you read a single line.

  • Narrative framing of the whole change
  • Unviewed count and staged progress at a glance
review focus
Review focus Review order tracks the release path from publish to consumption: the npm workflow first, then the install scripts users run, then the web highlighter tweaks.
Progress 18 of 28 hunks viewed · 4 files staged
Prioritized walkthrough

Scopes and steps, ordered by impact.

Related hunks group into named scopes and numbered steps. Deterministic impact chips tell you which step to read first — and which you can skim.

  • Keyboard-driven: j/k steps, n/p hunks
  • Impact never set by the model
walkthrough
Web rendering
02 Fix diff highlighting under CSP high
highlighter.ts +8
Command palette
03 Cmd+P file quick-open low
App.tsx +24 −2
Split & unified diffs

Read it the way you think.

Toggle split or unified, syntax-highlighted, with one-sided rows marked by a diagonal hatch so an empty cell never reads as real, aligned code.

  • Per-line comment anchors, GitHub-style
  • Highlighting works fully offline under a strict CSP
DiffPane.tsx · split
27if (at > from)
28<mark className=
29 "rounded-[2px]">
30{text.slice(at)}
27if (at > from)
28<mark className=
29{text.slice(at)}
Command palette

Jump anywhere with ⌘P.

Fuzzy-open any changed file by name or path, with format-aware icons, live keyword highlighting, and change counts. Enter navigates straight to the owning step.

  • Ranked basename → path matching
  • Full keyboard control, no mouse required
⌘P
Command palette open over the review UI, listing changed files with format icons, highlighted matches, change counts, and status letters.
Threaded comments

Ask the agent, in place.

Anchor a question or a change request to any hunk and send it to your active CLI. The agent’s reply lands as a thread entry — it never resolves anything on its own.

  • Questions get answers with no edits unless you ask
  • Out-of-scope edits are rolled back and reported
CommandPalette.tsx · thread
A threaded comment on a hunk: the reviewer asks the agent to remove a comment, the agent replies and reports what it changed, and the human still resolves the thread.
Approval tracking

The Git index is your approval ledger.

Review state is keyed by content hash, so it survives edits and line shifts. A file stages only when all its hunks are viewed and no comment is open.

  • Viewed, changed-since-viewed, commented, resolved
  • Persists across restarts and sessions
approval
install.sh +114
release-npm.yml +68
DiffPane.tsx +8 −3
App.tsx +24 −2
✓✓ Mark all reviewed (28)
Security & trust

Everything stays on your machine.

No account, no cloud, no telemetry. Diffthing binds to loopback, gates its WebSocket with an ephemeral token, and drives the agents you already trust.

Local-first

A Rust daemon bound to 127.0.0.1 with the review UI embedded. Nothing leaves the host.

No cloud dependency

No sign-in, no server round-trip, no telemetry. Works fully offline with --offline.

Uses installed AI CLIs

Drives the agent already authenticated on your machine. Diffthing never stores a provider key.

Deterministic validation

The model’s walkthrough must pass code checks — cover every hunk once, reference only real ones.

Git index as ledger

Approval is a real Git action: fully reviewed files move to staged. Your VCS is the source of truth.

Human approval required

Agent claims become thread entries, never approvals. Nothing merges on silence.

Comparison

Flat patch vs. organized review.

Capability
Traditional Git diff
Diffthing
Structure
Flat, file-ordered hunks
Named scopes, ordered steps
Prioritization
None — every line equal
Deterministic impact scoring
Review state
Lost on every re-edit
Reconciled by content hash
Agent dialogue
Copy-paste to a chat window
Anchored, in-context threads
Approval
Manual, informal
Git index as approval ledger
Developer experience

Running in one line.

Ship it however you like — npm, a raw binary, or Windows. Then diffthing drives the AI CLI you already have.

copy
# no install — run in any Git repo
$ npx diffthing
reviewing . against HEAD · llm claude
✓ ready — open https://local.diffthing.dev
Supported AI CLIs
Claude
Codex
Gemini
Kimi
Qwen
OpenCode

Auto-selected from your active session, config, or the first CLI on your PATH. Force one with --llm. Falls back to deterministic file order if none is present.

Roadmap

Shipped, and what’s next.

Shipped

v0.1–0.2

Deterministic review core

Scoring, validation, reconciliation, generated wire protocol.

v0.2

npm distribution & prebuilt binaries

npx diffthing across macOS, Linux, Windows.

v0.2

Trusted local HTTPS & persistence

Zero-prompt local.diffthing.dev; review state across restarts.

v0.3

One-line shell installer

Release-asset binaries, checksum-verified install.sh / .ps1.

v0.3

Command palette

⌘P quick-open with icons and keyword highlighting.

Upcoming

next

VS Code extension

Open a review from the palette, jump to file:line, comment inline.

next

Commit & PR workflow

Generate the message from approved walkthrough content — what you signed off on.

next

Stop-time review gate

When the agent claims done, surface what’s unreviewed — opt-in blocking.

later

OS-level sandboxing

Repo-only filesystem, network off by default for every dispatch runner.

later

Repository memory

Learn repo conventions and prior decisions — local, under your control.

Review AI-generated code with confidence.

Your agent writes the code. Diffthing organizes the review. You still own every approval.