---
title: Introduction
description: Review a Git diff one file at a time with context beside the code.
sidebar:
  order: 1
---

Diffsplain opens a local review page for a checkout, branch, pull request,
worktree, or exact Git range. It shows one changed file at a time, with the
patch on the left and a short coding agent note on the right.

## Start a review

You need Node.js 22.13 or newer and Git. For agent notes, you also need a
signed-in coding agent CLI. Set a default with `diffsplain config agent NAME`
or choose one run with `--agent NAME`. With neither set, an interactive
terminal lists usable agents in this order: Codex, Claude, Copilot, Cursor,
then OpenCode. You choose one; Diffsplain does not switch agents if it fails.
In scripts, set a default, pass `--agent NAME`, or use `--no-agent` for a plain review.

Cursor Agent must be version 2026.08.11 or newer. It uses the signed-in Cursor
CLI in the user's home. Cursor still contacts its service.

```sh
npx diffsplain
```

The command opens a local page showing staged, unstaged, and untracked changes
against `HEAD`, the same as `--worktree`. It starts at port `2299` and uses the
next free port when needed.

For a pull request:

```sh
npx diffsplain --pr 198
```

Pull request reviews also need the GitHub CLI. Run `gh auth login` first if
needed.

## What the command changes

Diffsplain reads the selected Git data and writes its own cache. It does
not switch branches or change the target checkout, index, local refs, or
`FETCH_HEAD`.

Use the arrow buttons or the left and right arrow keys to move through files.
Press `Cmd+K` or `Ctrl+K` to search the file list.

See [CLI usage](/cli) for every target and option.
