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

Model Router runs one task through Codex, Claude Code, Gemini, Amp, or your own CLI, with a model you pick for each stage. At the end it writes a brief that says what changed, how it was checked, and where to start reading.

curl -fsSL https://github.com/Tyru5/model-router/releases/latest/download/model-router-installer.sh | sh

Then run mr in a repository. Linux and macOS. Open source under MIT, code on GitHub.

Want something better?T3 Code is the industry-leading standard for agent orchestration.
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.

Pick an agent for each stage

Investigate with one model, implement with another, review with a third. When you move a stage, the config, the diagram above, and the terminal below update to match.

Stages

Harnesses

Click a stage, then a harness to move it there.

.model-router.tomlwritten by s in the TUI

        

Drive it from the keyboard

Everything happens in one terminal. This mock uses the real TUI layout and the stages you picked 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:

Background stages

Research, review, and the closing brief run in the background with their own timeouts. mr tells you when a run needs input.

Interactive stages

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

Structured handoffs

Each stage hands the next one a summary, verdict, findings, and test evidence instead of its raw output.

Let a stage hand work to other agents

Turn on delegation for a stage and its agent can pass self-contained tasks to other harnesses and models in the middle of a run. The agent only asks. The router launches each task and controls its process, sandbox, and cost.

  • Read-only or in a worktree

    A shared task reads the parent's checkout and can't write to it. A worktree task works on a copy and returns a patch the parent applies with task_apply.

  • No more access than the parent

    Each task runs unattended in its own OS sandbox and can't get more write access, native permissions, or network than the stage that started it.

  • Results wake the parent

    When its tasks finish, the router starts a follow-up turn of the parent with their results.

  • Schedules need your approval

    An agent can propose a recurring run. It fires only after you approve it with model-router schedules approve.

Claude Code, Codex, OpenCode, and custom adapters can delegate, including from interactive stages. Any harness can take a task. Delegates in a repo's config need model-router trust.

# .model-router.toml
[delegates.codex-review]
harness = "codex"
model = "gpt-6.2-sol"
effort = "high"

[delegates.claude-impl]
harness = "claude"
model = "claude-opus-5-5"
isolation = "worktree"

[[workflows.stages]]
id = "implement"
harness = "claude"
[workflows.stages.delegation]
delegates = ["codex-review", "claude-impl"]
max_parallel = 3
mr ~/src/payments-api
Implement tasks ↳ t1 · codex-review ✓ ↳ t2 · claude-impl ✓ · 1 wake(s)
── Implement · task t1 (codex-review) ──
handoff verdict=pass, no blocking findings
── Implement · task t2 (claude-impl) ──
handoff verdict=complete, 2 files changed
── Implement · wake turn 2: tasks t1, t2 ──
task_apply t2 applied, 2 files
handoff verdict=complete, checks passed

What it won't do without asking

Model Router starts other agents. It doesn't store their keys, loosen their permissions, or commit to your repository unless you tell it to.

No commits by default

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

No stored credentials

It reads provider keys from your environment at launch and redacts them in saved records and previews.

Native permissions

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

Trust before commands

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

No silent model swaps

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

Processes end with their stage

When a stage ends, its harness process group ends too. An optional bubblewrap or sandbox-exec sandbox per stage keeps Git config and hooks read-only.

Supported harnesses

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
# build from source and try the whole flow offline, no model calls
git clone https://github.com/Tyru5/model-router
cd model-router && 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

# approve a schedule an agent proposed
model-router schedules approve s1

# run as an MCP server for other agents
model-router serve --mcp

Want something better? Use T3 Code.

T3 Code t3.codes →

Better. The industry-leading standard for agent orchestration.

Model Router

A different tool that runs only in the terminal and CLI.