Introduction
miu-cr (MIU Code Review) is a fast, pure-Go AI code-review tool with a deterministic + agent engine. Review your own changes locally before you open a PR — from the terminal, in CI, or driven by any MCP-capable agent host (Claude Code, Codex, …).
Diff-only review misses cross-file bugs; bare-agent review drifts and burns tokens. miu-cr keeps the correctness-critical parts deterministic — file selection, context assembly, line-anchoring, severity gating, dedupe — and uses the LLM only where judgment helps: finding bugs and proposing fixes.
Start here
Section titled “Start here” Install install.sh, Homebrew, go install, or a Windows zip.
Usage Review modes, flags, the severity gate, output formats, and exit codes.
Providers Anthropic, GLM via z.ai, and OpenAI — env and flags for each.
MCP integration Run review_run / review_get as first-class tools in Claude Code or Codex.
How it works The deterministic engine and drift-reject line-anchoring.
Credentials Bring your own key — passed in memory, never persisted.
What you get (M1)
Section titled “What you get (M1)”miucr reviewover local diffs —--staged,--from/--to,--commit;--output json|pretty; non-zero exit at/above--gateseverity (CI-friendly).- Line-anchoring with drift-reject — every finding is re-anchored to the reviewed revision from its quoted code; findings whose quote no longer matches are dropped, killing position drift. Staged reviews read the index, not
HEAD. - Single structured LLM pass with
file_read/greptool-use → JSON findings (file,line,severity,category,rationale,suggested_patch). - MCP server (
miucr mcp) exposingreview_run/review_get— drive reviews as a first-class tool from any MCP runtime. - SQLite-persisted review history — pure-Go (
modernc.org/sqlite), no cgo; credentials are never stored. - Providers: Anthropic and Anthropic-compatible endpoints (e.g. GLM via z.ai), plus OpenAI and OpenAI-compatible endpoints.
A 30-second tour
Section titled “A 30-second tour”export ANTHROPIC_API_KEY=... # bring your own keymiucr review --staged # review staged changesmiucr review --from main --to HEAD -o pretty # review a range, human-readablemiucr review --commit HEAD~1 --gate high # exit 2 if a high+ finding landsmiucr mcp # serve the engine over MCP (stdio)The CLI emits a stable JSON envelope by default (-o pretty for a human table). It is Apache-2.0 licensed; the source of truth is the repository.