Skip to Content

How do I have a second model review internal refactors in a Node/TypeScript app before each commit?

Tares has the Codex CLI review every commit Claude Code makes, so each internal refactor in your Node/TypeScript app is checked before the session moves on. A blocking finding sends Claude back to fix the commit and amend it. If you disagree with a finding, you waive it with /tares:challenger-waive.

How it works

You run this as a challenger session. Claude Code plans and builds as usual, and Codex runs on the same laptop, billed to your OpenAI account. Tares never calls Codex. It records the exchange and writes the after-session summary. The full walkthrough is in Challenge Claude Code with a second model.

The check has two parts:

  • The plan. When you approve a plan and Claude leaves plan mode, Codex critiques it for gaps, wrong architecture, scope, unhandled risks and missing verification. For a refactor, the plan review happens before any code changes.
  • Each commit. After every git commit, Codex reviews that commit. Findings are tagged [P1] (fails as written), [P2] (will cause rework) or [P3] (advice).

What happens next depends on the tag:

  • No findings: Claude carries on.
  • [P1] or [P2]: Claude is blocked, told to fix the findings and fold the fix into the same commit with git commit --amend. If the reviewed commit is already on a remote, it makes a new commit instead. The amended commit is reviewed again as round 2, and so on until Codex is satisfied. The loop stops at 8 rounds per commit and 5 turn ends per session, and then the findings come back as context.
  • [P3]: context only, never blocking.
  • A Codex timeout, error or inconclusive review never blocks.

A plan critique never blocks. Only [P1] counts as blocking on a plan, and even then Claude revises or tells you why it disagrees.

Set it up

  1. Start Tares and its MCP endpoint, or sign in to Tares Cloud, which serves the endpoint itself. Install the Tares plugin for Claude Code, version 0.2 or later, from the marketplace entry tares@tares.

    tares up
  2. Install the Codex CLI on your laptop and log in with codex login. Set an Anthropic API key for the summarizer under Settings > Model providers, or as ANTHROPIC_API_KEY. Tares Cloud instances come with one.

  3. Open Claude Code in your Node/TypeScript 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.

  4. Ask for the refactor in plan mode. Approve the plan, read Claude’s first reply with the Codex findings, and let it implement and commit.

  5. When a commit is blocked, let Claude amend. When you think a blocking finding is wrong, run /tares:challenger-waive. It lists the blocking findings and waives one or all of them. The waiver is remembered for that finding on later rounds and shipped to Tares as a challenge_waived event.

  6. Optional: set the plugin option challenger_mode to advise so commit findings stop blocking. Set codex_sandbox to workspace-write or danger-full-access when Codex needs to run the project’s commands. The default is read-only.

  7. End with /exit. The challenger_summarizer agent then writes the session summary.

If you run the whole crew instead of one session, tares factory crew up asks whether a second model checks every commit. The setup page, Get started, lists the Codex CLI as optional for that. It also notes that tares factory doctor checks whether Claude Code has a language server for the languages it finds in your repos, tsconfig.json for TypeScript and package.json for JavaScript.

What you get

  • Every commit in the refactor gets a second opinion before Claude moves on, and a blocking finding is fixed inside the same commit instead of piling up in later ones.
  • One timeline per session on Tares. The Sessions list shows the plan outcome and one badge per reviewed commit, Findings (N) or Pass. The Claude and Codex exchange reads as one thread.
  • Events you can filter on: challenge_plan, challenge_commit and challenge_waived, with the verdict label (PASS, FAIL, INCONCLUSIVE, TIMEOUT or ERROR).
  • A summary of what was asked and built, what Codex changed in the plan, what it caught in each commit and what it cost. It ends with up to five Memory proposals about the repo. Nothing reaches memory until you accept it, and accepted decisions are handed to Claude at the start of the next session in that repo.
  • Review state, fix-loop counters and waivers stay under the repository’s .git/. If Tares is down or slow, reviews are never held up.

Expect a plan review to take 30 to 90 seconds. A session with a plan and three commits is typically five to eight Codex runs, billed by OpenAI.

When something else fits

  • If a finding is noise, waive it, or switch challenger_mode to advise so commit findings inform without blocking.
  • If you want a whole project built by several sessions rather than one reviewed session, use the crew from Get started.
  • If you do not want a second model on your OpenAI bill, run a plain Claude Code session. A session that is not marked is streamed like any other and no review runs.

Still stuck? Get help

Last updated on