MemtraceDOCS

Code reviewer

Review GitHub pull requests locally with AST rules, YAML packs, and graph-backed cross-module checks — ranked #1 on a 50-PR offline benchmark, ~20% ahead of the nearest competitor.

Memtrace reviews GitHub pull requests using the same local code graph your agents query while coding. Analysis is deterministic — AST detectors, YAML rule packs, optional graph-backed cross-module checks — with no LLM in the review path. Post findings to GitHub, watch the PR for @memtrace commands, and optionally let a local headless agent apply @memtrace fix this.

Overview#

Code review: four moving partsFLOW
--post@memtrace cmdsfix this
Review enginelocal AST + graph
GitHub Appauth + comments
Watch looplocal
Fix agentoptional local
SERVICEEXTERNALSUPPORTINGINFRASTRUCTURE

The hosted Memtrace service does not run fixes and does not need your repo path — it mints GitHub App installation tokens and optionally relays @memtrace comments to your local process.

Quick start#

terminal
# Index the repo if needed
memtrace index .

# Pick the headless agent for @memtrace fix this (once per machine)
memtrace code-review setup

git checkout -b feat/my-change
# … make changes, commit, push …
gh pr create --fill

memtrace code-review \
  --pr https://github.com/OWNER/REPO/pull/123 \
  --post \
  --watch \
  --repo-root "$PWD"

Preview without posting: omit --post. Keep a local Memtrace owner running while you expect watched commands to execute: memtrace start, a headless daemon, or an active memtrace mcp session.

AGENT-FIRST WORKFLOW

With the memtrace-code-review skill installed, ask your agent in plain language: "Review this PR with Memtrace and post findings." The skill routes to the MCP review tool instead of manually reading diffs.

What runs where#

PartWhereWhat it does
Review engineYour machineReads PR diff, local checkout, AST rules, YAML rules, indexed graph.
GitHub AppGitHub + Memtrace authPosts review comments; reads PR replies for @memtrace commands.
Watch loopYour machineExecutes queued @memtrace commands from PR comments.
Fix agentYour machineApplies @memtrace fix this in a temporary PR checkout when a supported agent is configured.

--pr mode needs memtrace auth login to exchange your session for a short-lived installation token. Local --diff and --base/--head modes never contact GitHub — ideal for CI. Full flag reference: memtrace code-review.

GitHub pull request with a Memtrace inline review comment showing What, Evidence, Why, and Fix sections.
Memtrace review comment on GitHub

GitHub @memtrace commands#

When a PR is watched (--post --watch), comment on the PR or reply to a Memtrace inline review.

CommandUse whenNotes
@memtrace review / rerunFresh review after new commitsPosts a new review if findings remain
@memtrace explainShort explanation of a findingReply to the inline Memtrace comment
@memtrace ignoreFinding not useful for this PRSuppresses that finding in future reviews
@memtrace fix thisLocal agent applies a narrow fixUses memtrace code-review setup agent; same-repo PR branches only
@memtrace mergeAsk GitHub to mergeBranch protection and checks still apply

Memtrace reacts with 👀 when a command is picked up, removes it when done, then adds 👍 or 😕. Force a sync with memtrace pr sync.

Automatic fixes#

terminal
memtrace code-review setup
# or: memtrace code-review setup --agent codex|claude|cursor|gemini|auto

memtrace code-review --pr <URL> --post --watch --repo-root "$PWD"
# then reply to an inline comment: @memtrace fix this

Memtrace checks out the PR branch in a temporary directory, runs the configured headless agent on one finding, commits, and pushes — your active working tree is untouched. Custom adapters: memtrace code-review setup --command "/path/to/wrapper".

CapabilityClaudeCodexCursorGeminiOther MCP agents
Skills + MCP review
review / rerun / explain / ignore
Automatic fix thisautoautoafter loginautocustom adapter

Offline benchmark#

On a 50-PR offline code-review corpus (golden comments across Sentry, Grafana, Keycloak, Cal.com, and Discourse PRs), Memtrace ranks #1 by 3-judge mean F1. Judges: GPT-5.2, Claude Sonnet 4.5, and Claude Opus 4.5.

RankTool3-judge mean F1
1Memtrace0.7268
2Cubic v20.6077
3Qodo Extended v20.5546
4Augment0.5214
5Qodo Extended Summary0.4960
6Mergemonkey0.4691
7Qodo v220.4686
8Qodo v20.4650
9Bugbot0.4438
~20% AHEAD OF THE NEAREST COMPETITOR

Against Cubic v2 (second place): Memtrace 0.7268 vs Cubic 0.6077 — an absolute lead of +0.119 F1 and a relative lead of +19.6% (~20% higher quality on this offline benchmark). Machine-readable snapshot: benchmarks/code-reviewer-offline-results.json in the Memtrace repository.

--review-mode strict (default) keeps benchmark-safe, high-precision findings. --review-mode online adds evidence-gated convention-drift detectors that read live files at --repo-root — useful in production, not counted in the offline leaderboard.

What it looks for#

  • AST review detectors for high-confidence bug patterns
  • YAML rule packs for language and framework issues
  • Cross-module graph checks when --graph-mode strict (default)
  • Local repository context from the indexed Memtrace graph

It is not a generic style bot — fewer, higher-signal findings. Quality analytics (dead code, complexity, hotspots) live on Code quality & review.

What has to be running#

BlockerFix
Repo not indexedmemtrace index .
Local checkout not on PR branchgit checkout <pr-branch>
PR started without --post --watchRe-run with both flags
fix this finds no agentmemtrace code-review setup
Merge rejectedGitHub checks / branch protection — not Memtrace

See also memtrace code-review, memtrace pr, and Local-first privacy.