Show HN: Router picks Cursor/Claude/Codex and effort per task, then launches it A developer released router, a pre-release command-line tool that selects an AI coding agent, model, and reasoning effort for a task and launches it inside a Herdr pane, supporting Cursor, Claude Code, Codex, and OpenCode. The tool applies deterministic eligibility rules first — enabled models, quota, and a 40% reserve floor on shared accounts — then calls the TypeSafe API to rank remaining options and choose an effort level, with no fallback if TypeSafe is unavailable. Router requires Node.js 20 or newer, a TypeSafe API key, at least one logged-in agent CLI, and Herdr, and keeps configuration, usage snapshots, decisions, and session history local unless an explicitly configured integration needs them. Local-first, quota-aware routing for AI coding agents in Herdr. router is a command-line tool that picks an AI coding agent, model, and reasoning effort for a task, then starts that agent for you in a Herdr pane. router run "implement the approved plan in docs/plans/billing.md" It filters your subscriptions with fixed rules enabled models, quota, the 40% reserve on shared accounts , asks TypeSafe to rank what is left and choose an effort, starts the chosen agent Cursor, Claude Code, Codex, or OpenCode , and hands it the task. Pre-release: the project is under active development. Review the security and privacy notes below before using real credentials or shared accounts. - Quota-aware: routes around depleted or reserved subscription capacity. - Policy-first: deterministic eligibility rules run before semantic ranking. - Local-first: configuration, usage snapshots, decisions, and session history stay on your machine unless an explicitly configured integration needs them. - Agent-agnostic: supports Cursor, Claude Code, Codex, and OpenCode through one command. - Node.js 20 or newer nvm use reads .nvmrc . - A TypeSafe API key. Routing always calls TypeSafe; there is no fallback. Each run sends the task text to TypeSafe. Recognizable credentials are rejected locally before the call; do not place other sensitive narrative data in routing tasks. - At least one agent CLI you are logged in to: agent Cursor , claude Claude Code , codex , or opencode . The router uses those logins; no provider API keys are needed. - Herdr , to launch agents. router run without --dry-run only launches from inside a Herdr pane HERDR ENV=1 . git clone https://github.com/nidhi-singh02/agent-router.git cd model-router npm install npm run build npm link -w @model-router/router Or add an alias to ~/.zshrc : alias router="node $HOME/Code/model-router/packages/router/dist/cli.js" After git pull , run npm run build again. The config lives in .model-router/ inside the repo gitignored . Point the router at it from ~/.zshrc , then source ~/.zshrc : export MODEL ROUTER HOME="$HOME/Code/model-router/.model-router" mkdir -p .model-router cp config.example.json .model-router/config.json Without MODEL ROUTER HOME , the router uses ~/Library/Application Support/model-router on macOS ~/.config/model-router elsewhere . security add-generic-password -a "$USER" -s model-router-typesafe -w The command prompts for the key, so it never lands in shell history. The config refers to it with "typesafe": { "apiKeyRef": "keychain:model-router-typesafe" } . Every pane and agent then finds the key without exporting anything, and it stays out of agents' environments. To replace the key, add -U . If macOS asks to allow security access the first time, choose "Always Allow". TYPESAFE API KEY in the environment still works as a fallback. There is no router accounts add command. Edit the accounts array in .model-router/config.json hidden folder; for example code .model-router/config.json with one entry per agent login: { "id": "acct personal claude", "label": "personal claude", "provider": "anthropic", "agent": "claude-code", "ownership": "personal", "collectorPreference": "local-session" , "enabledModels": "anthropic:claude-sonnet", "anthropic:claude-opus" , "enabled": true } | Field | Values | |---|---| | agent | cursor , claude-code , codex , opencode | | provider | Matches the models: cursor , anthropic , openai | | ownership | personal , or shared for a subscription other people also use see below | | reserveFloor | Optional, 0 to 1. Shared accounts default to 0.40 and cannot go lower | | collectorPreference | Where usage comes from: local-session , official-cli , official-api , browser-dashboard | | enabledModels | Model IDs from the table below | | enabled | true or false | | credentialRef | Optional env:NAME or keychain:NAME . Never put secret values in the file | Run router accounts to check that the file parses. docs/configuration.md has the full schema. The skill lets an agent route the next phase of your work see Phases phases-planning-then-implementation . Link the repo copy so updates arrive with git pull : ln -s "$PWD/skills/model-router" ~/.claude/skills/model-router ln -s "$PWD/skills/model-router" ~/.codex/skills/model-router ln -s "$PWD/skills/model-router" ~/.cursor/skills/model-router The links follow whatever branch is checked out in this repo. Defined in packages/router/config/models.json . Add an ID to an account's enabledModels to use it. | Model ID | Agent | Starts as | Efforts | Quota pool | |---|---|---|---|---| | cursor:grok-4.6 | Cursor | agent --model cursor-grok-4.6-