Skip to Content

How do I have a second model review small features in a Python backend before each commit?

Tares lets Codex review each commit Claude Code makes in a Python backend, in a challenger session. Mark the session, and Codex critiques the plan and then every commit. A blocking finding sends Claude back to amend the commit, and you can waive a finding you disagree with. The plan critique and commit reviews run on your laptop, and Tares records the exchange and summarizes the session afterwards.

How it works

In a challenger session, Claude Code plans and builds as usual while the Codex CLI on your laptop acts as the second reviewer. The reviews run in the Claude Code hooks against your OpenAI account, and Tares only receives the results. A Tares that is down or slow never blocks a review.

  • Plan. When you approve the plan and Claude leaves plan mode, Codex critiques it for gaps, wrong architecture, scope, unhandled risks and missing verification. Each finding is tagged [P1] (the plan fails as written), [P2] (will cause rework) or [P3] (advice). A plan critique never blocks. Claude mentions the findings in its first reply and adjusts, or tells you why it disagrees.
  • Commit. After each git commit, Codex reviews that commit. With no findings, Claude carries on. With [P1] or [P2] findings, Claude is blocked and told to fold the fix into the same commit with git commit --amend, or to make a new commit when the reviewed one is already on a remote. The amended commit is reviewed again as round 2, and so on until Codex is satisfied.
  • Limits. The loop stops at 8 rounds per commit and 5 turn ends per session. After that, the findings come back as context instead.
  • Never blocking. [P3] findings, a Codex timeout, an error and an inconclusive review never block.

For a small feature, this means each commit gets its own review before Claude moves to the next one.

Set it up

  1. Run Tares with its MCP endpoint next to it, or use a Tares Cloud instance, which serves the endpoint itself. Locally, use two terminals:

    tares up tares mcp --transport streamable-http
  2. Install the Tares plugin for Claude Code, version 0.2 or later. In Claude Code, run:

    /plugin marketplace add glassflow/tares /plugin install tares@tares

    The install asks for the Tares URL and the MCP endpoint. Locally, keep the default http://127.0.0.1:8788/mcp.

  3. Install the Codex CLI and log in to it. Codex runs on your laptop and is billed to your OpenAI account.

  4. Set an Anthropic API key for the summarizer under Settings > Model providers, or as ANTHROPIC_API_KEY. Tares Cloud instances come with one.

  5. Open Claude Code in your Python repo and say “make this a challenger session”, or type /tares:challenger. The first marked session creates the Challenger workflow project by itself.

  6. Ask for the feature in plan mode, approve the plan, and let Claude implement and commit. Each commit is reviewed.

  7. If you disagree with a blocking finding, type /tares:challenger-waive. It lists the blocking findings and waives one or all. The waiver is remembered for that finding on later rounds and shipped to Tares as a challenge_waived event.

  8. To make commit reviews advisory for good, set the plugin option challenger_mode to advise. The default is strict.

  9. Type /exit when you finish. A Tares agent writes the session summary and proposes what the next session in this repo should remember.

Run tares factory doctor to check what Claude Code needs for a repo. It reads a Python repo from pyproject.toml, setup.py, setup.cfg, Pipfile or requirements.txt, and tells you whether Claude Code has a language server for Python.

What you get

  • A critique before code exists. Codex checks the plan before Claude writes anything, so rework is flagged early.
  • A review on every commit. Each commit is reviewed on its own, and blocking issues are fixed in that commit instead of piling up.
  • A way to overrule. A waiver keeps one disputed finding from blocking again on later rounds.
  • One thread per session on Tares. The Claude and Codex exchange lands as challenge_plan, challenge_commit and challenge_waived events. The project page lists each session with a Findings (N) or Pass badge per commit.
  • Memory for the next session. The summary includes up to five Memory proposals. Accept one and it is handed to Claude as context when the next session starts in that repo. Nothing reaches memory without an accept.
  • Predictable cost. A session with a plan and three commits is typically five to eight Codex runs, billed by OpenAI. Plan reviews take 30 to 90 seconds, so the first reply after approval is slower.

The full set of events and plugin options is in the challenger workflow guide.

When something else fits

  • If you run a crew of background Claude Code sessions rather than one session, the first tares factory crew up asks whether a second model checks every commit. Get started covers the crew.
  • If you want no second model at all, leave the session unmarked. It streams like any other and nothing runs.
  • If you want findings as advice only, set challenger_mode to advise.

Still stuck? Get help

Last updated on