Route each stage of a task to the agent that does it best.

Model Router sends one task through Codex, Claude Code, Gemini, Amp, or your own CLI, with the model you choose for every stage. It ends with a brief: what changed, how it was checked, and what to read closely.

curl -fsSL https://model-router.tiru5.me/install.sh | sh

Then run mr in a repository. Linux and macOS.

The workflow as a track diagram Repair pass when review asks for changes Task Brief Investigate Implement Review Review summary
Run r-0418New task: webhook retries ignore the Retry-After header.

Set the line: one agent per stage

Investigate with one model, implement with another, review with a third. Pick a stage, then plug it into a different harness. The config, the diagram above, and the terminal below follow along.

Stages

Harnesses

Select a stage, then a harness to repatch it.

.model-router.tomlwritten by s in the TUI

        

Drive it from the keyboard

Everything happens in one terminal. This is the real layout with your line from above. Click it and press r.

mr ~/src/payments-apiclick to use keys
Feature development
TaskWebhook retries ignore the Retry-After header. Respect it, cap at 10 minutes, add a test.
Stage
Runs
r-0418 webhook retryready
r-0417 flaky ci testdone
r-0416 rate limiterreview
r-0415 docs: authdone
Stages
Press r to start a run.
HarnessStatusStructured outputUsed by

Checked by model-router doctor. No model request was sent.

Or press these:

Unattended when it can be

Research, review, and the closing brief run in the background with their own timeouts. You're notified when a run needs you.

Interactive when it matters

Implementation opens the harness's own terminal. Detach with Ctrl+B, quit mr, and come back to the same screen.

Handoffs, not scrollback

Each stage passes a structured summary, verdict, findings, and test evidence to the next.

Interlocks you can't pull past

The router coordinates agents. It doesn't take their keys, widen their permissions, or touch your Git history without asking. Each one stays locked until you take an explicit step to release it.

No commits by default

Only a ship stage commits, on a new branch, after you confirm a preview.

Your logins stay yours

No stored credentials. Provider keys are read from your environment at launch and redacted in every record.

Native permissions

Each harness keeps its own approval rules unless a stage explicitly overrides them.

Trust before commands

A repo's config can't run checks or custom adapters until you run model-router trust.

No silent model swaps

A failed stage stops and offers retry, a replacement model, or resume.

Clean exits

Every harness process group ends with its stage. Optional bubblewrap or sandbox-exec per stage.

Harnesses on the line

Install and log in to the ones you use. model-router doctor checks what it finds without sending a request.

  • Codex structured output
  • Claude Code structured output
  • Gemini
  • Amp
  • Cursor
  • OpenCode
  • Aider
  • Goose
  • Copilot
  • Pi
  • omp
  • Your CLI custom adapter
# try the whole flow offline, no model calls
cargo run -- --config examples/demo.toml

# see exact commands, nothing launched
model-router preview --task 'Respect Retry-After'

# run it unattended in an isolated worktree
model-router run --task-file spec.md --unattended --worktree

# retry a stage with a different model
model-router resume r-0418 --retry --model opus

# read the brief and the diff
model-router report r-0418 --diff

# let other agents drive it
model-router serve --mcp