Skip to content

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.

  • miucr review over local diffs — --staged, --from/--to, --commit; --output json|pretty; non-zero exit at/above --gate severity (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 / grep tool-use → JSON findings (file, line, severity, category, rationale, suggested_patch).
  • MCP server (miucr mcp) exposing review_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.
Terminal window
export ANTHROPIC_API_KEY=... # bring your own key
miucr review --staged # review staged changes
miucr review --from main --to HEAD -o pretty # review a range, human-readable
miucr review --commit HEAD~1 --gate high # exit 2 if a high+ finding lands
miucr 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.