Skip to Content
Tares

How do I have a second model review internal refactors in a Python backend before each commit?

Tares lets Claude Code build while the Codex CLI critiques the plan and reviews every commit, so internal refactors in a Python backend get a second model’s review. A blocking finding sends Claude back to fix and amend the commit. If you disagree with a finding, you waive it with /tares:challenger-waive.

How it works

You turn a Claude Code session into a challenger session. Claude plans and builds as usual, and the Codex CLI on your laptop argues with it. The review runs locally and never waits on Tares. Tares records the exchange.

  • Plan critique. When you approve the plan for your internal refactors and Claude leaves plan mode, the plugin hands the plan to Codex in a read-only sandbox. Codex looks for gaps, wrong architecture, scope, unhandled risks and missing verification. It tags each finding [P1] (the plan fails as written), [P2] (will cause rework) or [P3] (advice). A plan critique never blocks. For a [P1], Claude revises or tells you why it disagrees. Expect 30 to 90 seconds.
  • Commit review. After each git commit, the plugin has Codex review that commit.
    • No findings: Claude carries on.
    • [P1] or [P2] findings: Claude is blocked and told to fix them and fold the fix into the same commit with git commit --amend. If the reviewed commit is already on a remote, Claude makes a new commit instead. The amended commit is reviewed again as round 2, and so on until Codex is satisfied.
    • [P3] findings: context only, never blocking.
  • Limits on the loop. The loop is capped at 8 rounds per commit and 5 turn ends per session. After that, the findings come back as context. A Codex timeout, error or inconclusive review never blocks.
  • Waivers. A waived finding stays waived on later rounds, and Tares records it as a challenge_waived event.

The full walkthrough is in the challenger workflow guide.

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:

    tares up tares mcp --transport streamable-http
  2. Install the Tares plugin for Claude Code, version 0.2 or later. The install asks for the Tares URL, the MCP endpoint and, on a secured instance, a read + ingest API key.

    /plugin marketplace add glassflow/tares /plugin install tares@tares
  3. Install the Codex CLI and log in. Codex runs on your laptop and is billed to your OpenAI account.

    npm install -g @openai/codex codex login
  4. Add an Anthropic API key for the summarizer under Settings > Model providers, or set ANTHROPIC_API_KEY. Tares Cloud instances come with one.

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

  6. Ask for the refactor in plan mode and approve the plan. Codex critiques it, and Claude’s first reply mentions the findings.

  7. Let Claude implement and commit. Each commit is reviewed, and blocking findings send Claude back to amend.

  8. If you disagree with a blocking finding, run /tares:challenger-waive. It lists the blocking findings and waives one or all of them.

  9. Optional: set the plugin option challenger_mode to advise to make commit findings advisory. The default is strict. If Codex needs to run the project’s commands, set codex_sandbox to workspace-write or danger-full-access. The default is read-only.

  10. Type /exit when you are done. The plugin ships a session_end line and a Tares agent writes the summary.

What you get

  • A critique of the refactor plan before any code is written, with each finding ranked [P1], [P2] or [P3].
  • A review of every commit. Blocking findings are fixed and amended into the same commit and reviewed again before Claude moves on.
  • A way out when you disagree. Waivers are remembered for that finding and recorded on the session.
  • One timeline per session on Tares. The Claude and Codex exchange reads as one thread, with challenge_plan, challenge_commit and challenge_waived events. The project’s Sessions list shows a Findings (N) or Pass badge for each reviewed commit.
  • A summary when the session ends. It has five sections: what was asked and built, the plan and how Codex changed it, each commit and what Codex caught, cost, and Memory proposals.
  • Memory you control. Accept a proposal and the next Claude Code session in that repo gets it as context before your first prompt. Nothing reaches memory without an accept.
  • A predictable cost. A session with a plan and three commits is typically five to eight Codex runs, billed by OpenAI. The summarizer is one Tares agent run per session.

When something else fits

  • You want a lighter touch. Set challenger_mode to advise so commit findings inform Claude without blocking it. Plan critiques already never block.
  • You want to switch it off mid-session. /tares:challenger off turns the challenger off for the rest of that session. A session that was not marked is streamed like any other and nothing runs.
  • You want a whole project built, not one session checked. The software factory for Claude Code runs an orchestrator, a reviewer and builders in the background, and can have a second model check every commit. Start with Build a software factory with Claude Code.
  • You do not use Codex. The challenger check is built around the Codex CLI and your OpenAI account, so it needs both.

Still stuck? Get help

Last updated on