Skip to content
samestrinPublic

About

Agent Team Code Review

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

atcr — Agent Team Code Review

A review panel, not a reviewer.

Website: atcr.dev

atcr fans a code change out to a panel of heterogeneous LLM reviewer personas — different models, different providers, different lenses — then deterministically reconciles their findings into a single deduplicated, confidence-scored report. Cross-model agreement drives the confidence signal: a finding two independent models both caught is worth more than either model's opinion alone.

One Go binary, three faces: a CLI, an MCP server (atcr serve) over the same engine, and a companion Agent Skill that contributes a host-model review as the "+1" reviewer so even a single API key yields 2+ sources and a working confidence signal.

Why

Existing LLM review tools are single-model, single-vendor, mostly SaaS. Anyone who manually fans a diff out to N models gets N walls of prose and no way to merge them. atcr is local-first and BYO-keys, and the merge is the product: cluster by location, dedupe by similarity, score confidence by reviewer agreement, preserve disagreements instead of flattening them.

The deterministic Go reconciler — cluster → dedupe → merge → confidence — is the core value-add. Prompts orchestrate; the binary does everything that must be reproducible. Every cross-stage handoff is a machine-parseable file on disk.

How it works

                 ┌──────────────────────────────────────────────┐
                 │   atcr review                                │
                 │   range → payload → fan-out to persona pool  │
                 │   (parallel/serial lanes, fallbacks, budgets)│
                 └──────────────────┬───────────────────────────┘
                                    v
   .atcr/reviews/<id>/sources/{pool,host,...}/findings.{toon,txt}
                                    v
                 ┌──────────────────────────────────────────────┐
                 │   atcr reconcile                             │
                 │   discover → cluster → dedupe → confidence   │
                 └──────────────────┬───────────────────────────┘
                                    v
       reconciled/{findings.txt, findings.json, report.md}

Quickstart

New to atcr? Run atcr quickstart first — it is the one-command default. It scaffolds .atcr/, sets up the Synthetic flat-rate provider, walks you through the one API-key environment variable (the key is never written to atcr's config), shows the signup link, and scaffolds a .github/workflows/atcr.yml — so you reach your first review without hand-editing registry.yaml.

# 1. Install (Go 1.25+)
go install github.com/samestrin/atcr/cmd/atcr@latest
# ...or grab a prebuilt binary from GitHub Releases (tagged via GoReleaser),
# ...or, from a clone, run the wrapper: it installs the clone's own code (go install ./cmd/atcr),
# not the latest release, plus a Go preflight + PATH check:
./install.sh

# 2. One-command onboarding: scaffold .atcr/ + set up the Synthetic provider.
#    Run it inside a git repository, from its root. Skip the key prompt (press
#    Enter) and export the key yourself, as in step 3.
atcr quickstart

# 3. Export the key quickstart named, then verify every configured endpoint
#    before spending a real review on it
export LLM_SYNTHETIC_API_KEY=...
atcr doctor

# 4. Run the panel on the current feature branch, then reconcile — zero arguments
atcr review && atcr reconcile

# 5. Read the report
atcr report --format md

Prefer to wire a provider by hand? atcr init scaffolds the project config, the nine editable reviewer personas and their shared _base.md template into .atcr/; then point a provider + agents at any OpenAI-compatible endpoint in ~/.config/atcr/registry.yaml (see docs/registry.md) and export its key (for example export OPENROUTER_API_KEY=sk-...).

Choosing a provider

atcr quickstart sets up Synthetic because it is a flat-rate endpoint that reaches a working panel in one command. If you outgrow it, the recommended order is:

  1. Synthetic — the default (atcr quickstart). Flat-rate, one-command setup; run this first.
  2. DashScope (Alibaba) — secondary flat-rate option. A flat-rate alternative to switch to after trying Synthetic. There is no atcr quickstart wiring for it this release — see docs/personas-install.md for the manual registry snippet.
  3. Chutes → Featherless — explore, not default. More models, but slower inference, tighter context windows, and concurrency limits. Try Chutes first, then Featherless: explore, not default.
  4. LiteLLM — Advanced. An OpenAI-compatible proxy for aggregating several providers behind one endpoint. Keep it Advanced; it is not a first-run recommendation.
  5. Frontier / majors personas — opt-in, bring your own key. Personas prompt-tuned per each frontier provider's own official prompting guide are installed deliberately by anyone who already holds that provider's API key. They stay opt-in and outside the default funnel — see docs/personas-install.md to discover and install one by the model you have.
  6. Local models (Ollama-class) — privacy-first, zero egress. Community personas gerald, orson, and liam target local models, so the whole panel can run on your own hardware with no code leaving the machine. atcr quickstart --preset local-32gb or --preset local-64gb sets up orson and liam for that memory tier in one command (--preset local is local-32gb; gerald is in neither tier), offline and with telemetry off — see docs/personas-install.md. The community catalog also ships specialty lenses like simon, an anti-slop reviewer targeting AI-generated code bloat and over-engineering.

atcr doctor is the recommended post-atcr init verification step: it invokes every configured model endpoint once with a trivial prompt and reports any misconfigured provider, model, key, or base URL — so a bad config is caught in seconds instead of mid-review. It also warns when a persona copy under .atcr/personas/ has fallen behind the embedded one (see Keeping personas current). See Commands for its flags and exit codes.

atcr review resolves the range against the default branch, fans the change out to the roster, and records the review id in .atcr/latest. Every later command takes an id or path as its single anchor argument and defaults to latest, so the two-command pipeline above just works on a feature branch.

Run atcr from the repository root. Subcommands resolve project config (.atcr/config.yaml), the git range, and the history/audit ledgers (.atcr/) relative to the current working directory. Running from a subdirectory can write ledger records that atcr audit-report and atcr history — which walk up to the repo root — will not find.

Commands

Command Purpose
atcr review Resolve the git range (or scan the whole repo with --all / a subtree with --scope), build payloads, fan out to the reviewer pool, write per-agent + merged findings; --auto-fix applies sandboxed fixes and opens a PR
atcr reconcile Discover sources, cluster, dedupe, score confidence, write reconciled artifacts; a trust-aware consensus filter uses scorecard history to keep high-trust reviewers' singletons and demote low-trust ones, with --consensus strict|lenient|off tuning how tolerant it is
atcr dedupe Merge N reviewer td-stream files into location clusters for model adjudication: reuses the reconcile engine to cluster by file and line and merge each cluster, flags every cluster of 2+ needs_review with each member's own values, and prints the same {merged, summary} JSON keys as llm-support td-dedupe, which it replaces for review streams (atcr reconcile remains the command for atcr's own review directories) — see docs/technical-debt.md
atcr verify Run adversarial skeptics over reconciled findings; write verdicts and confidence v2
atcr diff-smell Scan a unified diff for over-simplification ("reward-hack") fingerprints — a deleted or skipped test, a weakened assertion, a lint suppression. Deterministic and model-free (no provider, no API key, no network) — see docs/diff-smell.md. Promoted from atcr verify diff, which stays a hidden deprecated alias for one minor version
atcr debate Cross-examine disputed findings (proposer/challenger/judge); settle severity splits, gray-zone clusters, and verification disagreements
atcr report Render md / json / checklist / sarif / axi views over the reconciled findings
atcr range Pre-flight base..head resolution only; prints resolution JSON
atcr status Print a review's progress as JSON while it runs and after: personas finished so far, each persona's chunk progress and last activity, and the latest finished stage (fanout → reviewed → reconciled → verified → debated, or failed / interrupted / stale for a run that ended that way) — see docs/status.md
atcr init Write .atcr/config.yaml, the nine default reviewer personas and their shared _base.md template (all editable) into .atcr/personas/, recording what it wrote in .atcr/personas/.stamp.json; --refresh-personas overwrites built-in copies that have fallen behind the embedded ones (see Keeping personas current)
atcr quickstart Interactive onboarding: scaffold .atcr/ (reusing init), set up the synthetic provider + API-key env var, and scaffold a CI workflow (--open, --force, --offline); --preset local-32gb or --preset local-64gb instead sets up the local Ollama provider and the orson and liam personas for that memory tier with no network call and telemetry off (--preset local is local-32gb)
atcr config Update project configuration in .atcr/config.yaml via atcr config set <telemetry|quality_signal> <true|false>; atcr config reset-install-id resets the quality signal's anonymous install ID
atcr serve Run the MCP stdio server over the same engine
atcr webhook Run a loopback-only daemon that reviews a GitHub pull request when someone mentions the Slack app with review <pr-url>, and replies in the thread with severity counts and finding titles; with a webhook.linear block, a Linear issue moving to a trigger status reviews the pull request attached to it — see docs/webhook.md
atcr doctor Self-test every configured endpoint (dedup'd by provider, model, base_url and resolved max_tokens, plus response_format, the tools loop and thinking for a declared target; fallbacks included); per-agent table or --json, with a SOURCE (user/project) provenance column. Also warns on stderr — and as stale_personas in --json — when a persona copy under .atcr/personas/ has fallen behind the embedded one, naming the file, the agents it serves (the selected agents under --agents, the roster agents otherwise; a copy an agent reaches only through an explicit persona: ref is checked too), whether it was hand edited, and the fix (atcr init --refresh-personas); a damaged .atcr/personas/.stamp.json adds one note naming the file and the refresh command (persona_stamp_damaged in --json); the exit code is unchanged
atcr history Query the per-package finding-history ledger in .atcr/history/: trend counts by severity over a --since window and optional --package prefix; --prune <horizon> deletes whole monthly shards past a retention horizon; --json prints the table as JSON — see docs/history.md
atcr trust Authorize project-defined providers from .atcr/registry.yaml before they can receive a key
atcr debt Query, capture, and report on technical debt in the .atcr/debt/ store (list / add / dashboard / resolve / recluster / compact / backfill-justifications / clean / convert / filter / group / import / lock / locks / report / sync-outcomes / unlock / validate, all over that one store); resolve --status wontfix --reason "<text>" dismisses a false-positive finding so it stops resurfacing, and recluster <id> --kind wrong-merge|wrong-split|wrong-category records feedback on how reconcile grouped a finding (the dashboard counts these as Reconciler corrections, apart from Wontfix) — see docs/technical-debt.md
atcr ignore Suppress a reconciled finding in future reconciles: atcr ignore <finding-id> --reason "<why>" appends a rule (file + category + a match quoted from the problem text, never the drifting id or line) to .atcr/ignore.yaml; matched findings move to reconciled/suppressed.json and a report.md footer — see docs/technical-debt.md
atcr audit-report Render a one-page markdown compliance report for a PR's review runs from the append-only .atcr/audit.log.jsonl ledger (--pr <n>)
atcr github Post reconciled findings to a GitHub pull request as a check run
atcr scorecard Display the per-reviewer scorecard for a single reconcile run; --json prints its records as JSON — see docs/scorecard.md
atcr quality-report Render the aggregate persona+model dismissed/confirmed prompt-quality signal (distinct from atcr report; persona digest, model, and counts only); --json is the same as --format json
atcr leaderboard Aggregate scorecard records across runs, ranked by corroboration rate; --json prints the table's rows, and atcr leaderboard export [--output <file>] prints the public submission document, with the submitter removed — see docs/scorecard.md
atcr benchmark Standard benchmark-suite tooling for the public leaderboard
atcr personas Manage community reviewer personas; submit contributes a locally-tuned persona back upstream as a PR — see docs/personas-authoring.md
atcr models Inspect model bindings, drift, and the catalog snapshot
atcr skill Install the embedded Agent Skill; atcr skill export [--harness <name>] [--user] [--dest <path>] [--force] writes it to your agent harness's skills directory
atcr version Print the atcr version

Command-group nouns are singular — benchmark, config, debt, leaderboard, and skill follow the git/docker/kubectl/gh convention of a singular noun for a group holding subcommands, and any new group keeps that rule. models and personas are grandfathered plurals: they shipped plural, and renaming them would break every scripted and documented invocation for a consistency win no user feels, so they stay. (debt is a mass noun and config names one file — neither could be pluralized anyway.)

Reporting commands share one heading and one --json flag. atcr --help lists audit-report, history, leaderboard, quality-report, report and scorecard under Reporting Commands, and the heading also names debt dashboard; no command was renamed or moved (see the decision record). Every command that prints a report takes --json for machine-readable output, except four that have none yet: audit-report, benchmark fit, debt report (use debt list --json instead) and personas search — see docs/agentic-consumption.md.

Key flags:

  • atcr review --base X --head Y / --merge-commit SHA / --id <id> / --output-dir <path> (write the tree to an explicit path; see below) / --payload diff|blocks|files / --timeout <secs> / --fail-on <severity> (one-shot review + reconcile + gate) / --resume <latest\|id\|path> (finish an interrupted/failed review by running only its pending agents, then reconcile; see below) / --force (overwrite an existing --id or --output-dir collision, backing the prior tree up to <dir>.bak first; mutually exclusive with --resume) / --no-cache (bypass the diff cache read and force a fresh review; fresh results are still written back to .atcr/cache) / --sprint-plan <path> (inject a sprint/epic plan as a SCOPE CONSTRAINT before the diff so reviewers suppress findings unrelated to the plan's work items and report each plan item the diff does not implement as an Unmet plan item: finding; a missing/empty plan is ignored, an unreadable one warns and proceeds) / --pr <n> (stamp the pull-request number on this run's audit record; falls back to GITHUB_REF when unset) / --all / --scope <path> (baseline whole-repo or subtree review — see below; --dir is a deprecated alias) / --no-file-cache (bypass the baseline incremental cache and rescan everything; --fresh is a deprecated alias) / --no-ignore (include files matched by .gitignore / .atcrignore) / --auto-fix (apply sandboxed fixes and open a PR — see below) / --axi (token-dense TOON output for agent callers — see below) / --sync-cloud / --cloud-endpoint <url> (after the run, push the pseudonymized scorecard to the endpoint; requires ATCR_API_KEY) / --dry-run (print the quality-signal payload without sending it; --preview is a deprecated alias) / --byte-budget <n> / --max-parallel <n> / --max-units <n> (with --all / --scope: the most bins one persona's plan may hold, default 512; a larger plan is refused before anything is sent)
  • One-shot pipeline chaining on atcr review: --verify / --require-verified / --debate / --thorough / --single-model / --min-severity <severity> run reconcile → verify → debate in a single command; --exec opts into sandboxed reproduction of findings (see docs/execution.md)
  • atcr reconcile --fail-on <severity> / --sources <a,b> (restrict to named source dirs) / --repo-root <path> (validate findings against a repo other than the current directory; also on atcr verify; --repo is a deprecated alias)
  • atcr dedupe --streams <a,b> (required, parallel to --source-tags) / --source-tags <tags> (default: each stream's parent directory name) / --tolerance <n> (default 3, the line window that clusters findings on one file) / --untrusted <tags> (sources whose findings alone are LOW confidence) / --json (default true; --json=false prints a one-line count)
  • atcr init --refresh-personas / --dry-run — bring stale persona copies under .atcr/personas/ back to the embedded content (see Keeping personas current); --refresh-personas cannot be combined with --force or --offline, and --dry-run requires --refresh-personas
  • atcr diff-smell --rev <rev> (default HEAD) / --staged / --diff <path> (or --diff - for stdin) — name exactly one source / --repo-root <path> / --json (payload-only stdout) / --fail-on hard|soft|none (opt-in gate; exits 0 on every verdict without it). Note the values are diff-smell verdicts, not the finding severities atcr review / atcr reconcile take
  • atcr audit-report --pr <n> (required — render the compliance report for that PR's recorded review runs; a PR with no recorded runs exits non-zero)
  • atcr report --format md|json|checklist|sarif|axi|pipe (pipe is the deprecated legacy AXI encoder) / --json (the same as --format json; with any other --format it is a usage error, exit 2) / --output <file> / --disagreements (focused disagreement-radar view — see docs/disagreement-radar.md)
  • atcr doctor / --json / --max-tokens <n> (default 8192 — the same default the review fan-out applies, so an undeclared agent is probed at the cap atcr review will use) / --timeout <secs> (default 60) / --agents <a,b> (test a subset of listed agents; their fallback chains are still probed). Exit 0 when every agent has a working invocation path (primary or fallback), 1 when any agent has none, 2 for usage/config errors.

Environment variables:

  • ATCR_DISABLE_AST_GROUPING — atcr reconcile clusters findings by AST isomorphism (the smallest covering AST block of each finding's line) by default, so findings group together across line-number drift, with line proximity as the per-finding fallback when no parser is available or the source is missing. AST grouping covers Go, Python, TypeScript/JavaScript, PHP, Rust, Bash, Java, Kotlin, C/C++, and C#; any other file type falls back to line proximity. Set this to a truthy value (1, true) to revert to legacy line-proximity-only clustering; a falsy, unparseable, or unset value keeps AST grouping on.
  • ATCR_TIER4_INDEX_MAX_FILES — overrides the 5000-file cap on the Tier 4 symbol index atcr reconcile builds when resolving findings whose cited file does not exist. A tracked tree over the cap disables Tier 4 for the run (counted by atcr_tier4_index_unavailable_total); set this to a positive integer to raise or lower the cap. An unparseable or non-positive value falls back to the default.
  • ATCR_TELEMETRY — names the enabled state (note the inverse direction vs. ATCR_DISABLE_AST_GROUPING): ATCR_TELEMETRY=0 disables the anonymous usage ping. See docs/telemetry.md.
  • ATCR_API_KEY — API key for --sync-cloud scorecard uploads; a missing or rejected key exits with code 3 when --cloud-endpoint is set (without --cloud-endpoint the run exits 2 first, as a usage error).
  • ATCR_AXI_MAX_LINES — caps the findings array of atcr report --format axi (default 500 lines) before truncation; no other --axi output is capped by this variable (debt filter has its own --max, default 10) (see docs/agentic-consumption.md).

Redirecting output for orchestrators (--output-dir)

By default atcr review writes the review tree to .atcr/reviews/<id>/ and points .atcr/latest at it — the right default for interactive use. An external orchestrator (a skill, CI step, or wrapper script) that needs the output at a specific location can pass --output-dir <path> instead:

atcr review --output-dir ./artifacts/review        # full tree (manifest.json, payload/, sources/) lands here
atcr reconcile ./artifacts/review                   # reconcile + report take the same path as their anchor
atcr report ./artifacts/review --format md
  • The tree is written verbatim to <path> (relative paths resolve against the current directory). The path must be new or empty — a non-empty directory is rejected with exit 2 so existing content is never clobbered.
  • .atcr/latest is not updated, so --output-dir runs never disturb the interactive pointer.
  • --output-dir and --id are mutually exclusive (the id is meaningless when the path is explicit).
  • atcr reconcile and atcr report need no extra flag — they already accept a filesystem path as their [id-or-path] argument, so hand them the same --output-dir path.

Resuming an interrupted review (--resume)

When a review is interrupted (Ctrl-C/SIGINT) or some agents fail, the completed agents' results are already on disk. --resume finishes the run by fanning out only the agents that did not complete, then reconciles — so you never re-spend tokens on agents that already produced a result:

atcr review --resume latest        # resolve .atcr/latest
atcr review --resume <id>          # a review id under .atcr/reviews/
atcr review --resume ./path        # an explicit review directory
  • The panel is locked: resume re-resolves the current git range and compares it (plus the configured roster) against the interrupted run's manifest.json. A changed range or roster aborts with exit code 2 — resuming against changed code or a different panel would mix inconsistent results. For a range review the error names the recorded range: re-pass it (--base <sha> --head <sha>), as the atcr status next step already does, or start a fresh atcr review.
  • An agent counts as complete only when its per-agent status.json records ok (a clean reviewer that found nothing is complete; a failed/timed-out one is re-run). On a baseline review an ok agent is still resumed when its chunks.json names bins it never reviewed, and only those bins are re-sent (see Baseline review). Pass the same range flags (--base/--head/--merge-commit) the original review used so the range matches.
  • If every agent already completed, resume just re-runs reconciliation. --resume cannot be combined with --id or --output-dir.
  • Re-running an explicit --id (or a non-empty --output-dir) whose directory already exists is rejected; the error names the two ways forward — --resume <id> to continue it non-destructively, or --force to back the prior tree up to <dir>.bak and start fresh. --resume and --force are mutually exclusive (opposite collision resolutions).

Baseline review (--all / --scope)

atcr review does not require a diff range: --all scans the whole repository and --scope <path> scans a subtree — useful for a first pass over a legacy codebase or a periodic full audit. Baseline runs are incremental: files whose content hash is unchanged since the last baseline are skipped, and --no-file-cache forces a full rescan. --all / --scope are mutually exclusive with --base / --head / --merge-commit. Binary files (any tracked file with a NUL byte in its first 8 KiB, so .xlsx, images, archives) are never reviewed: they are left out of the plan, one log line gives their count and the first five paths, and the coverage line does not count them.

A baseline run can legitimately be partial. Each persona's in-scope files are packed into bins sized to its model's context, and every bin the persona needs is planned and sent; its bins are listed in sources/pool/raw/agent/<persona>/chunks.json. One persona's plan may hold at most 512 bins (the per-persona unit budget). A larger plan is refused before anything is sent, with a usage error (exit 2) naming the --max-units value that would admit it: raise the budget with --max-units <n>, or narrow --scope. The diff path is not affected: it has its own ceiling of 64 chunks per persona, past which the remaining files are packed into the last chunk (with a warning on stderr) rather than refused. A bin that fails, times out, or comes back with nothing usable is also left unreviewed. A file too large for a persona's context window gets a bin of its own, is named on stderr when the plan is built, is sent once and never retried, and is marked over_window in chunks.json. Such a run still exits 0 by default, so read the coverage line rather than the exit code to know how much was reviewed.

Reading the coverage line. A multi-bin baseline run ends its summary with a line like:

Coverage: 68/128 persona-bins reviewed, 64/128 files covered by at least one persona (50.0%)
  • 68/128 persona-bins reviewed adds up every persona's bins: those that finished ok (and were not refused by the reviewer) against all the bins planned (including any a run from an older atcr recorded as deferred).
  • 64/128 files covered by at least one persona counts the in-scope files that at least one persona actually reviewed. The percentage is this file figure, and it is the number the gate below uses.
  • When some unreviewed bins hold a single file larger than the reviewer's context window, a second line counts them: Coverage: 1 unreviewed persona-bin(s) hold a single file larger than the reviewer's context window; they were sent once and not retried (over_window in chunks.json). Narrow --scope or add the file to .atcrignore to leave it out, or use a model with a larger window.
  • --axi reports the same four numbers as bins_reviewed, bins_planned, files_covered and files_in_scope; the deprecated --legacy-pipe payload keeps its frozen column set and never carries them. A bulk (single-bin) or diff review prints no coverage line.

Finishing a partial run. atcr review --resume <id> drains the missing bins: a persona with any pending, failed, timeout or deferred bin in chunks.json, or an ok bin that still left files unreviewed, is resumed, and only those bins are sent again, while bins already reviewed keep their findings. A persona whose bins are all reviewed costs no new calls. The resuming review … line names how many bins will be sent; each gets the full retry budget again (at most 4 sends per bin, each up to 6 HTTP attempts at the default max_retries), and its attempts in chunks.json keeps counting from the interrupted run. Run --resume again until the coverage line reaches what you need. deferred bins come only from runs made by an older atcr, which stopped each persona at a fixed ceiling; the resumed bins count against the unit budget like any other plan, and --max-units raises it on a resume too. Payload modes describes the queue: the unit budget, the retry budget, how a rate-limited provider is slowed, and what a resume costs.

Gating CI on coverage. --require-coverage <pct> is the CI gate: the run exits 1 when file coverage is below pct, after every artifact and the summary are written. It also exits 1 when the coverage record cannot be read, and it works with --resume. Without the flag the exit code ignores coverage.

atcr review --all --require-coverage 100      # fail unless every in-scope file was reviewed
atcr review --resume latest --require-coverage 100

Auto-fix (--auto-fix)

atcr review --auto-fix turns findings into fixes: an executor model generates a patch per eligible finding, atcr applies it to the working tree, validates it (build + tests), auto-reverts on failure, and opens a GitHub pull request with the results. It never auto-merges.

  • Sandboxed by default — no opt-in. Post-apply validation runs model-authored code, so it executes inside the same container isolation as --exec (no network, read-only root filesystem, dropped capabilities, resource caps). If no sandbox backend is configured or available, the command fails closed rather than validating on the host; --no-sandbox is the explicit danger opt-out.
  • Config edits blocked by default. Patches touching .git/, .githooks/, CI workflows, .env*, .planning/, or .atcr/ are rejected unless you pass --allow-config-edits (danger).
  • Two-tier execution. Complexity ceilings (max_severity_for_fix, max_estimated_minutes) let a cheap executor model handle simple fixes and escalate the rest to a frontier model — worked examples in examples/registry-with-executor*.yaml.
  • Shortcut fixes rejected. Fixes that smell like reward-hacking (deleted assertions, added suppressions, swallowed errors, stubbed bodies) are rejected/retried or flagged NEEDS_REVIEW rather than applied.

--repo / --token / --api-url target a non-default GitHub remote. The pull request targets the repository default branch; --auto-fix-base <branch> targets a named branch instead (local HEAD must be pushed and equal that branch). --config-dir <dir> reads .atcr/config.yaml (including validate_command and sandbox:) from another directory, so an untrusted pull request cannot choose its own validation command. See docs/auto-fix.md and docs/security.md.

Agent consumption (--axi)

--axi (Agent eXperience Interface) makes atcr comfortable as a subprocess for another agent: token-dense TOON output on stdout, diagnostics kept on stderr, deterministic exit codes, and a line cap on the atcr report --format axi findings array tunable via ATCR_AXI_MAX_LINES. See docs/agentic-consumption.md.

Available on:

  • Bare atcr --axi
  • atcr review --axi
  • atcr report --format axi
  • atcr reconcile --axi
  • atcr verify --axi
  • atcr debate --axi
  • atcr status --axi
  • atcr debt clean --axi
  • atcr debt filter --axi
  • atcr debt group --axi
  • atcr debt validate --axi

Limits

atcr assists code review; it does not prove code correct, replace tests or human review, or guarantee that a finding is real or that a clean report is safe. Model reviewers can miss defects and disagree, and confidence measures reviewer agreement rather than correctness. Hosted providers receive the review payload; use local models when code must not leave the machine.

  • Size and coverage. Binary files are excluded from baseline reviews. A file too large for a reviewer's context window is sent once and never retried, and failed, timed-out, or empty bins remain unreviewed. A partial baseline run still exits 0 by default, so read the coverage line or set --require-coverage. One persona's baseline plan is limited to 512 bins by default; raise --max-units or narrow --scope when a larger plan is refused.
  • Execution and source changes. Review and reporting do not execute model-authored code or modify source files. --exec opts into sandboxed reproduction; --auto-fix modifies the working tree, validates changes in a sandbox, and opens a pull request but never merges it. Auto-fix fails closed when no sandbox is available. --no-sandbox and --allow-config-edits are explicit danger opt-outs that remove those safeguards.
  • AXI exceptions. atcr does not yet satisfy every AXI principle. The exceptions below are copied verbatim from docs/axi-audit.md; "justified" records a deliberate compatibility or scope tradeoff, not conformance with the literal principle.
  1. Exception 1 — principle 1, justified: TOON is opt-in through --axi or --format axi, while human text or JSON remains the default to preserve the established human CLI and machine-consumer contracts (cli/main.go:569-577, cli/report.go:34, TestRootCmd_AXIFlagRegisteredOnRoot, TestRootCmd_BareNonAXIIsTextNotPayload); a deprecated, opt-in legacy pipe encoding (ATCR_LEGACY_PIPE=1, --legacy-pipe, or report --format pipe) replaces TOON and help[] on review, report and the home view and warns on stderr (cli/axi.go:49-67, cli/main.go:577, cli/report.go:141, internal/report/legacy_pipe.go:125, cli/home.go:162-165, the legacyPipeFromContext branch of writeReviewHelp in cli/review.go).
  2. Exception 2 — principle 2, unjustified: findings and debt-item lists have fixed ten-column base schemas, review summaries have twelve base columns, and no AXI surface offers --fields or a three-to-four-field list projection (internal/report/standard_axi.go:113-125, internal/report/render.go:232-239, cli/debt_filter.go:233-249, TestDebtFilter_AXI).
  3. Exception 3 — principle 3, unjustified: AXI findings cells are cut to 500 runes with an ellipsis but carry neither original field size nor a hint that --format json is the full-content alternative (internal/report/render.go:41-43, internal/report/render.go:657-671, internal/report/standard_axi.go:161-170, TestAXIText_SanitizesBeforeTruncating).
  4. Exception 4 — principle 3, unjustified: a row-truncated findings payload reports total and truncated but its help[] never tells the agent to raise ATCR_AXI_MAX_LINES to retrieve the remainder, which also leaves principle 9's truncated list unrevealed (internal/report/pagination.go:112-136, cli/report.go:168-172, cli/main.go:696-732, TestReportCmd_AXITruncatesAtEnvCap).
  5. Exception 5 — principle 3, unjustified: debt clean, filter, and group put complete problem and fix strings in list rows without a preview cap, total size, or full-content escape hatch (cli/debt_filter.go:233-249, cli/debt_clean.go:170-203, cli/debt_group.go:276-305).
  6. Exception 6 — principle 6, justified: AXI failures remain plain diagnostics on stderr rather than structured errors on stdout so redirected stdout is always a successful payload and existing consumers branch on the unchanged exit code (cli/main.go:157-162, cli/main.go:250-259, TestStatusCmd_AXIMissingReview).
  7. Exception 7 — principle 6, justified: AXI retains atcr's additional exit 3 for sync-cloud authentication failure instead of collapsing every non-usage failure into exit 1 because CI already uses that narrower branch (cli/main.go:238-265, TestAXIExitParity_AuthErrorExitsThree).
  8. Exception 8 — principle 6, unjustified: unknown flags exit 2 but name neither the command's valid flags nor a targeted replacement unless an individual command has a special case (cli/main.go:579-583, cli/debt_resolve.go:213-224, real-binary probe of an unknown flag on AXI status printed only atcr: unknown flag: --bogus on stderr).
  9. Exception 9 — principle 7, unjustified: atcr has an installable Agent Skill but no setup command, SessionStart hook, or OpenCode plugin to inject its live home view at session start; the skill's SKILL.md is written by hand rather than generated from the no-argument home view, with no --check step to fail CI when the two drift, as the principle's single-source rule asks; the skill's command examples need atcr already on PATH instead of a form that runs without a global install, such as go run github.com/samestrin/atcr/cmd/atcr@<version>, as the principle's non-interactive-commands rule asks; and the skill's trigger description runs 645 characters listing all 29 routed commands rather than the terse, outcome-focused trigger the principle's frontmatter rule asks for (cli/main.go:593-623, cli/skill.go:44-51, docs/skill-usage.md:13-56, skills/atcr/SKILL.md:3, skills/atcr/SKILL.md:20; repository searches for ambient and SessionStart found no session integration).
  10. Exception 10 — principle 9, unjustified: the four debt AXI renderers return immediately after EncodeChecked with no contextual help[], including a capped debt filter with no hint to rerun with --max 0 (cli/debt_filter.go:209-230, cli/debt_clean.go:170-203, cli/debt_group.go:276-305, cli/debt_validate.go:270-290).
  11. Exception 11 — principle 10, unjustified: --version and -v succeed but -V is rejected with exit 2 (cli/main.go:430-431, real-binary version probes; TestVersion_FlagAndSubcommandAgree covers only the long flag and subcommand).
  12. Exception 12 — principle 10, unjustified: all three successful version forms print atcr version <version> rather than the required bare version (cli/main.go:430-431, cli/version.go:44-55, TestVersion_FlagAndSubcommandAgree).
  13. Exception 13 — principle 10, unjustified: every visible command supports --help, but concise references such as status --help omit the principle's two-to-three usage examples (cli/main.go:593-623, real-binary probe of all 71 visible command paths, including help and completion, and the status --help output).
  14. Exception 14 — principle 6, justified: human-only debt add and quickstart retain optional TTY wizards, while the AXI surfaces do not prompt; neither wizard prompts off a TTY: debt add provides a complete flag route that fails immediately for missing values, and quickstart skips its API-key prompt and prints the export hint when stdin is not a terminal (--preset asks nothing at all) (cli/debt_add.go:103-134, cli/debt_add.go:204-253, cli/quickstart.go:377-380, TestDebtAdd_MissingRequiredNonTTYIsUsageError, TestQuickstart_StdinNotTTY_SkipsKeyPrompt).

Keeping personas current

atcr init copies the embedded personas into .atcr/personas/ as editable files, and those copies win at review time over the personas built into the binary. They are never overwritten afterwards — not even by atcr init --force, which refreshes only config.yaml and .gitignore — so a workspace initialized before a persona change shipped keeps reviewing with the older prompt indefinitely. Three mechanisms close that gap:

  • The stamp. Init records what it wrote in .atcr/personas/.stamp.json: each built-in persona file (_base.md included) mapped to the sha256 of the content written. A re-run records only the files it actually wrote and keeps the other entries; a workspace initialized before the stamp existed is never retro-stamped.
  • The doctor warning. atcr doctor compares each resolved built-in copy against the embedded content and the stamp, and warns on stderr (exit code unchanged; --json carries the same list as stale_personas) when one has fallen behind — naming the file, the agents it serves (the selected agents under --agents, the roster agents otherwise), and whether it was hand edited (so a refresh would overwrite the edit) or carries no stamp (a pre-stamp workspace, where whether it was edited is unknown). A copy an agent reaches only through an explicit persona: ref to a built-in name is checked under that built-in's file too. With no stamp entry the check falls back to the predicate-rule gap detection, and a damaged stamp (one that does not parse or has no files object) takes that fallback too — doctor prints one note naming .atcr/personas/.stamp.json and atcr init --refresh-personas so the fallback is not silent, and --json carries it as persona_stamp_damaged.
  • The refresh command. atcr init --refresh-personas lists every built-in copy under .atcr/personas/ that differs from the embedded one — marking hand-edited files as edited — then overwrites them and updates the stamp. --dry-run prints the list and writes nothing. A refresh touches only persona files: config.yaml, .gitignore and the community fetch are skipped, combining it with --force or --offline is a usage error, and a missing .atcr/personas is an error (run plain atcr init first). personas/ stays tracked by git, so git diff reviews what a refresh changed and git is the undo; a symlinked persona is replaced by a regular file without being read, and its target is untouched; a copy over 1 MiB is treated as differing.

Payload modes

atcr ships three payload modes that control what each reviewer agent sees. The default is blocks; set per-agent overrides in ~/.config/atcr/registry.yaml when a model handles a different format better.

Mode What the reviewer sees When to use
diff Unified diff The most compact and token-friendly mode. Right choice for frontier models and large ranges.
blocks Changed hunks expanded to the enclosing function/block (git diff --function-context), with real line numbers Default for v1. Best findings quality from small / MoE models reading real code.
files Full head-version content of changed files with changed regions marked Highest token cost. Audit-style review of small ranges.

One run can mix payloads — the frontier model reads the diff, the local 8B gets blocks — and manifest.json records who saw what. See docs/payload-modes.md for the decision guide, byte-budget truncation, and per-mode scope rules.

Payloads are also filtered, promoted, and sized automatically:

  • Ignore filtering. Changed files matching the repo-root .gitignore or .atcrignore are excluded from payloads by default; --no-ignore opts out. Credential files (.env*, .netrc, SSH private keys, .pem/.key files and similar; see providers.md) are always excluded.
  • Automatic per-file escalation. Complex files (high churn, many hunks, high cyclomatic complexity) are promoted up the ladder — diff → blocks → files — and payloads are prepended with an AST skeleton of the changed files' HEAD version so a diff-mode reviewer still sees the surrounding structure. Tunable via the payload_escalation registry block; manifest.json records what each reviewer actually saw per file.
  • Per-model sizing. Each reviewer's payload is sized to its own model's context window with the output budget reserved; when a payload still overflows, the on_overflow policy applies (chunk default / truncate / fail; fallback is recognized but not yet dispatched), and max_sprint_plan_bytes caps the --sprint-plan injection. See docs/registry.md.

Project-defined providers and agents

A repo can ship its own providers and agents in .atcr/registry.yaml, overlaying the user registry so a clone is self-contained — project entries shadow same-named user entries whole; new names are added. Because a project-defined provider could direct a key to an arbitrary endpoint, atcr gates them: run atcr trust to authorize a project provider (it pins the base_url + api_key_env pair) before any review or atcr doctor will use it. See docs/registry.md.

Tool-using reviewers (cost guidance)

Set tools: true on a function-calling-capable agent to turn it from a single-shot reviewer into a bounded, multi-turn tool-using agent: it can read_file, grep, and list_files across a read-only, path-jailed snapshot of the repo to verify a suspicion before reporting it. The payload becomes the starting point of the review, not the whole picture — see docs/payload-modes.md.

Tool agents are not free. We estimate a tool-using reviewer makes 3-11× the provider calls of a single-shot reviewer (up to 11 calls with the default max_turns of 10: one call per turn, plus one forced final answer when the turn budget runs out). That range is an estimate, not a measurement: atcr has no committed benchmark of it. Cost scales with how much exploration the model does. Each agent is bounded by per-agent budgets — max_turns, tool_budget_bytes, and timeout_secs — documented in docs/registry.md. Enable tools selectively (your strongest models, your highest-value lanes) rather than across the whole roster, and tune the budgets to cap spend. A tools: true agent on a model without supports_function_calling: true degrades cleanly to the single-shot path.

CI integration

atcr is a PR gate with no glue code: --fail-on <severity> returns a nonzero exit when any finding at or above the threshold survives reconciliation.

atcr review && atcr reconcile --fail-on high   # exit 1 if HIGH+ findings survive

Exit codes: 0 success · 1 failure (including a --fail-on threshold violation) · 2 usage or configuration error · 3 authentication failure (--sync-cloud with --cloud-endpoint and a missing or rejected ATCR_API_KEY; without --cloud-endpoint it exits 2) · 4 drift (atcr debt dashboard --check or atcr debt report --check found the --output file stale or missing: regenerate it and re-stage).

GitHub Actions:

name: atcr review
on: [pull_request]
jobs:
  atcr:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0          # full history: atcr needs the merge-base
      - uses: actions/setup-go@v5
        with:
          go-version: '1.25'
      - run: go install github.com/samestrin/atcr/cmd/atcr@latest
      # A fresh runner has no user registry, and a committed .atcr/registry.yaml
      # only overlays one. Commit your registry (it names key env vars, never keys)
      # and copy it into place, or set ATCR_REGISTRY_URL to a shared one.
      - run: install -D -m 644 .github/atcr/registry.yaml "$HOME/.config/atcr/registry.yaml"
      - name: atcr gate
        env:
          # one entry per api_key_env your registry's providers name
          OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }}
          BASE_REF: ${{ github.base_ref }}
        run: |
          atcr review --base "origin/${BASE_REF}"
          atcr reconcile --fail-on high

atcr quickstart scaffolds a review-only .github/workflows/atcr.yml that already writes its registry on the runner.

A ready-to-adapt script lives at examples/ci-gate.sh. Or skip the hand-rolled workflow entirely: the repo ships a composite GitHub Action (action.yml) that runs review → reconcile → atcr github and posts the result as a PR check with optional inline comments — see docs/github-action.md. Shallow checkouts (fetch-depth: 1) break merge-base resolution; atcr detects this and errors with git fetch --unshallow guidance rather than producing a wrong range. See docs/ci-integration.md.

Providers

atcr speaks to any OpenAI-compatible /chat/completions endpoint directly — no SDKs, no infrastructure, keys from environment variables resolved at invoke time. For maximum compatibility across providers, routing through a normalizing proxy such as LiteLLM is supported but not required. See docs/providers.md.

Documentation

Repository layout

  • cmd/atcr/ — thin binary entry-point shim
  • cli/ — the importable command tree (all subcommand logic)
  • internal/ — engine packages (gitrange, payload, registry, llmclient, fanout, stream, report, mcp, verify, debate, autofix, sandbox, scorecard, telemetry, and more)
  • reconcile/ — the deterministic reconciler as a standalone Go module (importable as a library; the root go.mod pins a tagged release of it, and a local, uncommitted go.work can point the build at the in-tree copy during co-development)
  • personas/ — the nine embedded default reviewer personas, _base.md, and nora.md (the threat-model mapper prompt, not a reviewer and not installed by atcr init)
  • skills/atcr/ — the atcr Agent Skill (host review + orchestration); it is embedded in the binary, so atcr skill export installs it
  • docs/ — user documentation
  • examples/ — CI gate script, a live-audit example, and sample executor registries
  • bin/ — local build output (go build -o bin/atcr ./cmd/atcr)
  • .planning/ — development planning artifacts

Development

Operation Command
Build go build -o bin/atcr ./cmd/atcr
Test go test ./...
Coverage go test -coverprofile=coverage.out ./...
Lint golangci-lint run
Vet go vet ./...

Pro-Tip: Use git worktree to work on multiple branches without disturbing your main checkout — e.g. git worktree add ../atcr-feature-x feature-x checks out feature-x into a sibling directory you can build/test in isolation, then git worktree remove ../atcr-feature-x cleans it up when done.

Go 1.25+. Direct dependencies are listed in go.mod; beyond spf13/cobra, gopkg.in/yaml.v3, and modelcontextprotocol/go-sdk they include tetratelabs/wazero (WASM parsers), github.com/cli/go-gh (PR resolution), and others.

License

ATCR's own code is MIT-licensed (LICENSE); the binary includes the Apache-2.0-licensed reconcile module (reconcile/LICENSE).

About

Agent Team Code Review

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages