Skip to content

AI code review for GitHub

Code review that cleans up after itself.

Reviews your GitHub pull requests with the model of your choice. Tick the fixes you want and it commits them.

Open source · Runs as a GitHub Action · Your key, your model

The review loop

  1. On every push

    Review

    A comment on each issue, with a one-click fix where there is one. It reads the code around each change too, and where the changed code is used, because a change can be right in itself and break what calls it.

  2. In the summary

    Respond

    One summary lists every issue. Tick the fixes you want, then Commit the ticked fixes, and they land as one commit. Resolve a conversation to dismiss it, or reply /codemop learn to teach the whole repository.

  3. Before merging

    Merge

    An optional merge check fails while bugs or security issues are open, and passes once they're fixed or dismissed. Make it required, and a known bug doesn't merge unnoticed.

A real review

CodeMop's review of its own pull request #20, a 1,450-line refactor (a typical pull request costs a few cents). Tick the fix, then Commit the ticked fixes.

CodeMop commented on src/codemop/cli/post.py, lines 143–144

🐛 Bug: Title fallback can resolve another finding's conversation

by_title is built from every CodeMop thread, including ones that carry a finding id. Suppose an addressed finding has no inline comment (it was over max_comments), and a different, still-open finding with the same path and title has a thread. That thread gets resolved, and the nextsync_threads then dismisses the open finding. The path/title fallback should only use threads from before comments carried ids.

Suggested change
-    by_title = {(t.path, c.title): t for c, t in conversations(threads)}
+    by_title = {(t.path, c.title): t for c, t in conversations(threads) if c.finding_id is None}
     to_resolve = [by_finding.get(f.id) or by_title.get((f.path, f.title)) for f in addressed]
CodeMop commented

CodeMop review of 7f67de8

1 open issue(s). Tick the fixes you want, then tick Commit the ticked fixes at the end, and CodeMop commits them to this branch as one commit.

Why CodeMop

Safe on any pull request
It reads the diff through GitHub's API and never checks out or runs the pull request's code, so it can hold your key on a fork's PR, from anyone. Agents that run tools on the code can't.
Cheap enough for every push
A few cents a review with the default model, and done in under a minute. It was chosen by an eval in which 99% of its comments were right.
Your model, your key
Anthropic, Mistral, OpenAI, OpenRouter, any OpenAI-compatible endpoint, or a local model. No CodeMop server: your code goes only to the provider you choose.
It learns, and you can see what
What it's taught goes in a file in your repository, which you can read and edit. Re-reviews look at the new commits only, and resolve conversations once the code is fixed.

Set up in two minutes

  1. Add your model provider's API key as a repository secret, e.g. ANTHROPIC_API_KEY. For Claude it comes from console.anthropic.com; a Pro or Max subscription isn't one.
  2. Commit CodeMop's workflow, .github/workflows/codemop.yml, from the quick start to your default branch. Its review step is just this.

Every pull request from then on gets a review.

- uses: sgtwickool/codemop@v1
  with:
    api-key: ${{ secrets.ANTHROPIC_API_KEY }}