nitpicker
Multi-model adversarial code review for your terminal and CI.
Supported by Archestra
Free Web Version for open source projects
Most LLM code reviews suffer from two failure modes: lazy rubber-stamping ("Looks good! 🎉") or hallucinated pedantry (inventing fake bugs because the model lacks repo context).
nitpicker fixes this by pitching models against each other in an adversarial debate:
- Actor-Critic dynamics: The Reviewer (Actor) explores the codebase to maximize recall (finding plausible bugs and edge cases). The Validator (Critic) aggressively attempts to falsify those claims using actual repo evidence. Disputed claims are debated; only surviving findings make it to the report. The report preserves material limits on what the evidence supports.
- Deep repo exploration: Reviewers don't just stare at a 40-line
git diff. They run tools (read_file,grep,glob,git) and spawn concurrent subagents to trace call graphs, check types, and verify assumptions before claiming an issue exists. - Model diversity & economics: Pit different model families against each other (Claude vs. GPT vs. Gemini), or pair frontier models with fast, inexpensive models via OpenRouter (Qwen, DeepSeek, Kimi). Burn 1M tokens reviewing a complex PR without burning your monthly budget.
- Production & CI ready: Regularly used across several engineering orgs, including CI pipelines. Features deterministic exit codes (
0,1,3), headless--jsonoutput, and OpenTelemetry tracing.
- Quick Start
- Common Workflows
- Review Lenses (Presets)
- Configuration
- Providers & Authentication
- Production & CI Integration
- Advanced Features
Quick Start
Building from source with cargo install requires Rust 1.97.1 or newer.
Set an API key for your preferred provider:
# or: export OPENROUTER_API_KEY="your-api-key"
# or: export OPENAI_API_KEY="your-api-key"
Run a review:
# Review your current branch / uncommitted changes
# Review an open GitHub pull request and post the verdict as a comment
# Ask a technical or architectural question about the repo
Common Workflows
1. Review Local Diffs
By default, nitpicker compares your current branch against its base branch using an adversarial debate:
2. GitHub PR Reviews & CI
Review PRs locally or in automated CI workflows (requires GitHub CLI gh):
# Review current branch's PR and comment on GitHub
# Review any remote PR by URL (clones into temp dir, reviews, cleans up)
# Review without posting a comment to GitHub
# Machine-readable output for CI pipelines (single JSON object on stdout)
3. Ask Architecture & Design Questions
Debate design choices or sanity-check logic across your codebase:
4. Audit Existing Code (Static Analysis)
Audit existing codebases without needing an active diff:
5. Second Opinion from Your Coding Agent
The second-opinion skill lets Claude Code (and other skill-aware agents) hand a diff, PR, plan, or contested claim to nitpicker for an independent review. If nitpicker isn't installed, it falls back to codex or opencode.
Review Lenses (Presets)
Instead of generic feedback, review against targeted rubrics. Presets control what to investigate, while debate or parallel modes control how.
Built-in Presets
| Preset | Focus Area |
|---|---|
correctness |
Logic bugs, race conditions, edge cases, error handling, off-by-one errors. (Default) |
security |
Injection, auth boundaries, input validation, secret leaks, SSRF. (Default) |
performance |
Unnecessary allocations, N+1 queries, async blocking, algorithmic complexity. (Default) |
simplicity |
Over-engineering, dead code, redundant abstractions, readability. (Default) |
ai-systems |
Agent tool schemas, prompt injection vectors, context truncation, deterministic fallbacks. (Opt-in) |
ml-rigor |
Training/validation leakage, metric gaming, distribution shift, silent failures. (Opt-in) |
tone |
Clarity, audience fit, terminology consistency, documentation voice. (Opt-in) |
general |
Broad standalone review for unconventional targets. Cannot be combined with other presets. |
You can also define custom presets in nitpicker.toml:
[]
= """
Review API trust boundaries, JWT verification, and rate-limiting.
Require a concrete attacker-controlled call path for every finding.
"""
Configuration
Initialize a configuration file:
Configuration resolution order: --config <path> > ./nitpicker.toml > ~/.nitpicker/config.toml.
Example nitpicker.toml
[]
= true # use Actor-Critic debate (default: true)
= true # failover to next reviewer if a provider rate-limits (default: false)
= 100 # tool-use loop limit per agent
# presets = ["correctness", "security"] # default includes performance and simplicity
# Model that synthesizes the final report from surviving debate findings
[]
= "claude-sonnet-5-5"
= "anthropic"
= 16384
# Reviewer 1 (Actor / Discovery)
[[]]
= "claude"
= "claude-sonnet-5-5"
= "anthropic"
# Reviewer 2 (Critic / Validator)
[[]]
= "gpt"
= "gpt-6.1-sol"
= "openai"
# Reviewer 3 (Fast / Inexpensive via OpenRouter)
[[]]
= "qwen"
= "qwen/qwen3.5-35b-a3b"
= "openrouter"
Tip: Pair different model families to avoid shared blind spots.
Providers & Authentication
| Provider | Authentication | Notes |
|---|---|---|
anthropic |
ANTHROPIC_API_KEY |
Automatic 5-minute prompt caching enabled by default. |
openai |
OPENAI_API_KEY |
Compatible with OpenAI models and custom OpenAI gateways. |
codex (OpenAI) |
Reuses ~/.codex/auth.json |
Uses your existing ChatGPT Plus/Pro subscription token from OpenAI Codex CLI. No API key needed. Details below. |
grok (xAI) |
Reuses ~/.grok/auth.json |
Uses your Grok Build CLI OAuth token (grok login). No API key needed. Details below. |
openrouter |
OPENROUTER_API_KEY |
Access open-weights & Chinese frontier models (Qwen, DeepSeek, Kimi, GLM). |
opencode |
OPENCODE_API_KEY |
OpenCode Console (formerly Zen), pay-as-you-go. |
opencode-go |
OPENCODE_API_KEY |
OpenCode Go subscription; preserves a session ID across each agent's turns. |
gemini |
GEMINI_API_KEY |
Google Gemini models via official API. |
azure (Entra ID) |
auth = "azure-ad" |
Azure AI Foundry models with auto-refreshing tokens (requires --features azure). |
ChatGPT / Codex Subscription
If you have a ChatGPT Plus or Pro subscription and the OpenAI Codex CLI installed, nitpicker can authenticate through your subscription without a separate paid API key:
# 1. Log in once via the official Codex CLI
# 2. Configure nitpicker to reuse the token (read-only)
[[]]
= "codex"
= "gpt-6.1-sol"
= "openai"
= "codex"
Grok CLI Subscription
If you have logged in with the Grok Build CLI (grok login), nitpicker can reuse the OAuth token from ~/.grok/auth.json (read-only) without a separate XAI_API_KEY (research only):
# 1. Log in once via the Grok Build CLI
# 2. Configure nitpicker to reuse the token (read-only)
[[]]
= "grok"
= "grok-4.7"
= "openai"
= "grok"
OpenRouter & Model Economics
For high-volume reviews, OpenRouter gives you access to cost-effective models with large context windows:
[[]]
= "deepseek"
= "deepseek/deepseek-v4.1-flash-1017"
= "openrouter"
# Or experimental auto-selection of currently available free models:
[[]]
= "free"
= "openrouter"
OpenCode Console & Go
Use an API key from OpenCode Console and set
provider = "opencode" for pay-as-you-go or provider = "opencode-go" for Go.
Use the model ID without the provider prefix. Console's free chat models are
restricted to the OpenCode client.
[[]]
= "opencode-go"
= "opencode-go"
= "glm-5.3"
Production & CI Integration
Deterministic Exit Codes
nitpicker uses standard exit codes designed for automated pipelines and scripts:
| Code | Meaning | CI Recommendation |
|---|---|---|
0 |
Clean verdict | Pass pipeline |
1 |
Hard failure (network error, bad config, missing keys) | Fail pipeline / Alert |
2 |
CLI usage error (invalid flags) | Fix CI script |
3 |
Degraded verdict (report printed, but a reviewer/turn failed) | Warning / Soft alert |
A degraded preset review also starts with a one-line ⚠️ Partial review note naming the angles that were not reviewed, so a PR comment reading "No findings" is never mistaken for full coverage.
Headless JSON Output
With nitpicker pr <url> --json, nitpicker emits exactly one JSON object on stdout with structured findings, token metrics, and coverage data. All progress bars, logs, and diagnostic traces are strictly sent to stderr:
OUTPUT=
STATUS=
DEGRADED=
OpenTelemetry Tracing
Export every run as an OpenTelemetry trace (requires --features otel):
Traces adhere to standard GenAI semantic conventions (gen_ai.*), recording token usage, model failovers, tool latencies, and retry attempts. Sensitive prompt text and proprietary repository source code are never exported.
Advanced Features
External Design Docs (--context-file)
Reviewers are sandboxed inside the git repository. If your review needs external context (e.g. an RFC, architecture doc, or migration plan located elsewhere on disk), inject it safely:
Automatic Fallback Rings (--fallback)
Avoid losing 10 minutes of deep review to transient 429 rate-limits. When --fallback is enabled, any reviewer that exhausts retries automatically hands its history and completed tool outputs to the next configured model in the ring.
Self-Reflection (nitpicker reflect)
Analyze past review sessions to diagnose recurring false positives, agent friction, and tool loops:
# Enable trajectory logging in your config:
# [defaults]
# log_trajectories = true
From Claude Code, the reflect workflow (.claude/workflows/reflect.js) runs the same pipeline on a Claude subscription: it builds dossiers with --dump, analyzes each session, and then writes a synthesis that has been checked against the repo. It reads the same prompts/reflect/ instructions as the CLI.
Rust Library (nitpicker-agent)
The underlying agentic loop and file/git tools are published as a standalone crate nitpicker-agent:
use *;
use Path;
async
[!CAUTION] Research only. AG2 is Google's internal agentic IDE backend.
auth = "agy-keyring"reads theagyCLI OAuth token from the system keyring to evaluategemini-3.xmodels. Google actively monitors and suspends accounts using third-party OAuth bridges. For standard Gemini access, useGEMINI_API_KEY.
Build with --features antigravity. The default model for this auth path is
gemini-3.8-flash-tiered; use that exact backend ID rather than the agy CLI's
gemini-3.8-flash-low alias.
For contributors, the binary keeps argument parsing in src/cli.rs, config loading and
routing settings in src/settings.rs, and config generation in src/init.rs.
Command dispatch remains in src/main.rs; PR-specific config trust and output handling
live in src/pr.rs. See CLAUDE.md for the full architecture.
Changelog
See CHANGELOG.md for version release notes.