AI code review for AI agents

Double-check the code your agent just wrote.

nitpick sends the diff, the changed files, and the code around them to a different model, and prints findings the agent fixes before opening the PR. One command. Exit code 1 when it matters.

Paste this into your agent.

It installs the CLI and the nitpick skill, checks for an OpenRouter key, and tells the agent to review before every pull request. Works in Claude Code, Codex, Cursor, OpenClaw, OpenCode, and anything that reads Agent Skills.

prompt
Set up nitpick, an AI code reviewer, on this machine and in this repo.

1. Install the CLI if `nitpick --version` fails:
   brew install LVTD-LLC/tap/nitpick
   Without Homebrew (needs Rust 1.98+): cargo install --git https://github.com/LVTD-LLC/nitpick
2. Install the nitpick skill for the harness you are running in:
   Claude Code: claude plugin marketplace add LVTD-LLC/nitpick-skills && claude plugin install nitpick@nitpick-skills
   Codex: codex plugin marketplace add LVTD-LLC/nitpick-skills && codex plugin add nitpick@nitpick-skills
   OpenClaw: openclaw plugins install git:github.com/LVTD-LLC/nitpick-skills@main
   Cursor, OpenCode, or anything else: git clone https://github.com/LVTD-LLC/nitpick-skills ~/.local/share/nitpick-skills && ~/.local/share/nitpick-skills/install.sh
3. Check that NITPICK_OPENROUTER_API_KEY is exported. If it is not, ask me for an OpenRouter key and tell me how to export it in my shell. Never write the key into a file.
4. From the repo root, run `nitpick init` if there is no .nitpick.toml and fill in its `instructions` with this project's conventions. Then run `nitpick context` to confirm it works, and tell me what you did.
5. From now on, run `nitpick` before opening a pull request. Fix every finding at severity high or blocker and run it again until it exits 0.

Rather do it yourself?then read the README

How it works

  1. 01

    It packs the change, not just the diff.

    The unified diff, the full post-change files, and unchanged code chosen for a reason: definitions the diff uses, call sites of what it changed, the modules it imports, and matching tests. Ranked and trimmed to a token budget in milliseconds.

  2. 02

    It asks a different model, through OpenRouter.

    OpenRouter is the default provider, so one key gives nitpick every model there. Pick one with -m, or several at once; findings that agree are merged and marked (2/2 models). Point it at Ollama or llama.cpp instead and nothing leaves your machine.

  3. 03

    It returns findings with an exit code.

    Each finding cites path:line in the post-change file with a severity, a category, and a suggestion. Exit 1 when anything is at or above --fail-on (high by default), so the agent fixes, reruns, and only opens the PR at exit 0.

export NITPICK_OPENROUTER_API_KEY=sk-or-…is the whole setup. Get a key at openrouter.ai; models are billed per token, and several are free.

What it looks like

Real recordings against a branch of nitpick's own repo, with two one-line bugs planted in it. Scrub the timelines or just read the final screens.

Review the working tree

The default. Progress on stderr, the review on stdout. This repo's .nitpick.toml names two models, so both run and their findings are merged.

$ nitpick

See what would be sent

No model call. The stats show what the payload costs in tokens; the tags list every file and snippet with the reason it was included.

$ nitpick context --json | jq .stats$ nitpick context | grep -E "^<(file|snippet|importers) "

Get it as JSON

The same review as one object: verdict, findings with file and line, per-model summaries, token counts and cost. Built for the agent, not the human.

$ nitpick --json -m stealth/space-bunny-alpha | jq "{verdict, findings: [.findings[] | {file, line, severity, title}]}"

More commands

nitpick --staged
only what is staged
nitpick --base develop
diff against another branch
nitpick src/api/
limit the review to some paths
nitpick -m openai/gpt-5.5 -m anthropic/claude-opus-5-5
two models in parallel, findings merged
nitpick -f "Focus on the SQL."
extra instructions for this run
nitpick --fail-on medium
stricter exit code
nitpick --provider ollama -m qwen3-coder:30b
local model, no key
nitpick init
write a starter .nitpick.toml
Every flag, in the README