Agent Router CLI
CLI that picks the agent, model and effort for a task by remaining subscription quota and launches it in a Herdr pane.
- 123 ★ on the repository
- Last commit
Extended access
Why this level
- Launches agents with your user's permissions and sends the task text to the external TypeSafe service.
- Reads subscription usage data and keeps a key in the Keychain.
Install
- Works in
Manual install
git clone https://github.com/nidhi-singh02/agent-router.git && cd agent-router && npm install && npm run buildCommands from install step 1 of the README. The README follows the clone with `cd model-router`; the cloned folder name is used here.
Access and checks
How we reviewExtended accessThe tool runs code or makes network calls and only reads external data.
- Launches agents with your user's permissions and sends the task text to the external TypeSafe service.
- Reads subscription usage data and keeps a key in the Keychain.
This is third-party code. Review the repository files before installing.
What it does
The `router run` command takes a task text and decides who runs it: Cursor, Claude Code, Codex or OpenCode, with which model and effort level. Fixed rules first filter out unavailable options: disabled models, exhausted quotas and a 40 percent reserve on shared accounts. Then the TypeSafe service ranks the remaining options and picks the effort level. After the choice, router opens a new Herdr pane, starts the agent under your login, waits for startup and sends the task. No provider keys are needed: it uses logins already made in the agents' CLIs. The `--dry-run` mode prints the decision card and launch command without launching. An optional `model-router` skill lets the agent itself hand the next phase of work on, for example implementing an approved plan.
Who it is for. People with several coding agent subscriptions who do not want to decide by hand which one gets a task.
Good fit when
- Claude Code quota is nearly used up while Codex and Cursor have room.
- A shared team account must not be drained below its reserve floor.
- Before launching you want to see which model the router would choose, without running it.
- The plan is agreed and implementation should go to a suitable agent in a new pane.
Not a fit when
- You have no TypeSafe key: routing always calls the service and there is no fallback.
- The task text contains secrets or client data: it goes to TypeSafe.
- Herdr is not in use: without it only `--dry-run` works.
Example request
Show through `router run --dry-run` which agent and model would take the task "implement the plan in docs/plans/billing.md".Limitations
The project is pre-release. It needs Node.js 20 or newer, a TypeSafe key, at least one logged-in agent and Herdr, and a run without `--dry-run` works only inside a Herdr pane. Accounts are set by hand in `.model-router/config.json` and there is no add command. The TypeSafe key is stored in the macOS Keychain. The launched agent gets your user's permissions, so review the chosen route and task. Model figures in `models.json` are estimates you can adjust.
How to disable. Remove the `router` link from `PATH` and the symlinks to the `model-router` skill in agent skills folders. Configuration lives in `.model-router/`, and the TypeSafe key is deleted from the Keychain separately.
FAQ
How do I see the router's choice without launching an agent?
Run `router run "<task>" --dry-run`. The command prints the decision card and launch command and opens no pane.
Where does router get remaining quota?
From the source set in the account's `collectorPreference`: local sessions, the vendor CLI, its API or a browser dashboard. `router status --usage` shows what is left.
What is the 40 percent reserve?
For a shared account (`ownership: shared`) the router does not spend the last 40 percent of quota, and `reserveFloor` cannot go below that value.
How do I connect the skill to agents?
Symlink `skills/model-router` into `~/.claude/skills`, `~/.codex/skills` and `~/.cursor/skills` as shown in the README.
What is needed to run it?
Node.js 20 or newer, a TypeSafe key, a login in at least one agent (`agent`, `claude`, `codex` or `opencode`) and Herdr for runs without `--dry-run`.
Discussion
No questions or reviews yet.
Related
CLI toolsA local gateway for Claude Code, Codex, OpenCode and other agents: pick model providers, route requests, set fallbacks and read logs
A bridge between local CLI agents: Codex, Cursor or Claude Code delegate work to Antigravity, Grok, Kimi and seven more.
Hooks read each prompt before the model and ask a free or local model for a draft first, saving Claude subscription quota.
One agent launches others in the background: Claude Code, Codex, Copilot CLI, Grok Build and Pi, with a model chosen per stage.
A terminal coding agent that reads your project, edits files and runs commands, sending each request to the best free model that is answering today
A scaffold of personas, rules and skills in plain Markdown: Maestro hands work to different models and spares your main plan
Comparison with similar tools
Cards that share the main search query, and how they differ.
| Tool | Official | Repository stars | Main difference |
|---|---|---|---|
| Agent Router (this card) | no | 123 | |
| Claude Code Router | no | 38,020 | redirects Claude Code requests to other model providers; Agent Router picks the agent and model by quota and launches it |
| herdr | no | 48,519 | terminal multiplexer for agents; Agent Router starts agents in its panes along the chosen route |
README in short
Requirements and step-by-step setup come first, then the account configuration format and a table of models with launch commands. Daily commands, work phases and security and privacy notes follow.