Claude Subagent Router
A Claude Code plugin with seven subagent workers and a review skill that checks rules, the spec and bugs separately. A subagent is a helper that your main Claude Code session starts for one task. The main session gives it a brief: the prompt that describes the task. Five workers run on Claude models. Two hand their task to the Codex CLI, OpenAI's coding agent for the terminal, once you turn Codex on.
Two parts are optional and off by default:
- Codex runs tasks on your ChatGPT plan. The plugin blocks bought Codex credits unless you allow them, with one exception under Known limits.
- Model routing sends the briefs of
Agent tool calls to Jev, a paid classifier from TypeSafe: a model that writes no text and answers fixed questions with probabilities. When Jev is confident, the plugin changes the model of the call, and for its own workers also the worker.
See What leaves your machine before you turn either one on.
Why
- The right model for each task. Without routing, a subagent often runs on the main session's large model, even for a search. The plugin picks Haiku for a search, Sonnet for most edits and reviews, and Opus for hard work. With Jev and Codex on, a hard task with a self-contained brief (it holds everything the task needs) can go to Codex on your ChatGPT plan.
- Better output from each worker. The debugger reproduces a failure before it names a cause. The implementer shows evidence for each "done". The review skill checks rules, spec and bugs separately.
- A second opinion before a decision.
consult asks Codex a design question, read-only.
This saves your Claude plan's usage limits. The plugin calls no Claude or OpenAI API; the one paid API is Jev. The savings are not proven yet; the offline evaluation measures them.
Requirements
- Claude Code with a Claude plan.
- Node.js 20 or newer. The plugin has no npm dependencies.
- For the routing: a TypeSafe API key for Jev.
- Optional: the Codex CLI with a ChatGPT login. Codex jobs need macOS or Linux. On Windows, the routing between Claude models works, and Codex stays off.
Install
This repository is also a marketplace, a catalog of plugins. Add it, then install the plugin for one project:
claude plugin marketplace add robertanton81/claude-subagent-router
cd /path/to/your-project && claude plugin install subagent-router@claude-subagent-router --scope local
--scope local turns the plugin on only in that project, in .claude/settings.local.json, which Git does not track. Leave it out to turn the plugin on in every project. The plugin's settings file, ~/.claude/orchestrator/config.json, is one per user either way.
- If you already have a TypeSafe key, the command in Turn on Jev installs the plugin and stores the key in one step.
- To update, run
claude plugin marketplace update claude-subagent-router, then claude plugin update subagent-router@claude-subagent-router, and start a new session.
Setup
In a session, the skills /subagent-router:configure and /subagent-router:setup do this work. Each step below has full instructions in Setup.
- Turn on Jev (optional), for the routing. Create a key at https://console.typesafe.ai/keys, store it in the plugin option (a setting that Claude Code keeps for the plugin), then turn Jev on with
/subagent-router:configure. See Turn on Jev.
- Turn on Codex (optional). Run
codex login with your ChatGPT account, then turn Codex on with /subagent-router:configure. With Claude Code's Bash sandbox on (its limit on what shell commands may write), see The Claude sandbox.
- Add the status line log (optional, with Jev on). The limit rules, which move work when Claude is near its limit, need your Claude usage numbers, which only your status line script receives. See Add the status line log.
- Check the setup with
/subagent-router:setup. The check never prints a secret.
What leaves your machine