Run AI code review locally, on your own machine
You can run the AI part of every MergeJudge review on your own computer. The open-source mergejudge-runner uses your own Claude Code or Codex (ChatGPT) login, or a GLM (z.ai) API key. The hosted MergeJudge service still handles GitHub events, lanes and posting, and your machine does the model step.
This page is the short version. The full reference is Run reviews on your own machine.
What this is and isn't
The runner reviews pull requests. It takes review jobs from MergeJudge for PRs on repos where the MergeJudge GitHub App is installed. It doesn't review uncommitted or unpushed changes. For early feedback on work in progress, open a draft PR (see Get feedback before you merge).
What you need
- Node.js 20 or newer.
- At least one engine, signed in on this machine:
- Claude Code: run
claudeonce and sign in (claude auth statusshould show you're signed in). - Codex CLI: signed in with ChatGPT (
codex login). An API-key login isn't accepted. - Or a z.ai API key for GLM, used with your own z.ai account.
- Claude Code: run
- The MergeJudge GitHub App installed on the account or organisation whose PRs you want reviewed, with you as an admin of that installation.
- macOS or Linux if you want it to start automatically at login.
Set it up
npx mergejudge-runner setupOr install it globally:
npm i -g mergejudge-runner
mergejudge-runner setupsetup prints a short code and https://github.com/login/device. Open the address, enter the code and approve the MergeJudge GitHub App. It then:
- registers this machine and writes
~/.config/mergejudge-runner/config.json(file0600, folder0700); - checks whether
claudeandcodexare installed and signed in; - asks whether to add a GLM API key;
- offers to start the runner at login (a LaunchAgent on macOS, a systemd user unit on Linux).
Useful flags (from the runner README; run mergejudge-runner setup --help for the full list):
| Flag | What it does |
|---|---|
--engine <claude-code|codex|glm> | The runner's default engine |
--model [engine=]<model> | Models to offer (repeatable; the first per engine is its default) |
--codex-effort <minimal|low|medium|high|xhigh> | Codex reasoning effort (default low) |
--glm-key-env NAME | Read the GLM key from an environment variable instead of asking |
--no-glm | Don't ask about GLM |
--installation <id> | Choose an installation when you administer several |
--no-autostart, --yes, --print-unit | Control auto-start (--print-unit prints the service file and writes nothing) |
--name <name>, --force | Name this runner and replace an existing registration |
Without auto-start, run it by hand and check on it:
mergejudge-runner run # keep taking review jobs
mergejudge-runner run --once # handle one waiting job, then exit
mergejudge-runner status # config, server reachability, heartbeatDeep-local mode: the AI step and code index on your machine
By default, MergeJudge's hosted service builds the review context and sends it to your runner through its job queue. The diff and snippets are removed from the job when the review finishes. To have the runner read the code from its own git clone, set this in .mergejudge.yml on the base branch:
review:
mode: deep
runner:
code_source: localIn this deep-local mode the job carries no code: only the repo, PR details, commit SHAs, your config and the rules result. The runner clones the repo with your machine's own git credentials, computes the diff, builds an index under ~/.mergejudge/ and sends back only the review result. In deep-local mode the AI step and code index run on your machine. Our servers still read the pull request diff from GitHub to run the rule checks, and don't store it. They keep the review result. Findings can quote short lines of code, the same text that's posted on the PR.
In every mode, your code is sent to your AI provider (Anthropic through Claude Code, OpenAI through Codex, or z.ai) under your own account.
Get feedback before you merge
Since the runner reviews PRs, the way to get early feedback is to push a branch and open a draft pull request. MergeJudge reviews it like any other PR and posts the lane, line comments and rubric results. Each new push updates the review. When you're done, mark the PR ready for review.
Prefer everything inside your own CI with your own AI key, without the hosted service? Use the GitHub Action instead.
Use your own login responsibly
The claude-code and codex engines use your personal subscription login. Consumer subscriptions are generally meant for personal use, so check your provider's terms, and don't share one login across a team or run it as a service for others. For team use, add a provider API key instead (see LLM providers).