Codex Router is a local model-routing setup that connects Codex and several other coding agents to external providers such as Kimi, DeepSeek, Anthropic, xAI, and GitHub Copilot. It is for users who want to configure routed models and manage provider credentials locally across supported agent clients. Its catalogue entries provide skills and instructions for installing and operating the router.
Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add instructions/duolahypercho/codex-router/agents-mdgit clone --depth 1 https://github.com/duolahypercho/codex-routerWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/instructions/duolahypercho/codex-router/agents-md)<a href="https://agentmods.dev/instructions/duolahypercho/codex-router/agents-md"><img src="https://agentmods.dev/badge/instructions/duolahypercho/codex-router/agents-md.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.34281 | $0.34281 |
| Opus 5 | $0.17141 | $0.17141 |
| Sonnet 5 | $0.06856 | $0.06856 |
| Haiku 4.5 | $0.03428 | $0.03428 |
Grade B, and why
codex-router AGENTS.md scanned grade B with 2 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Reads agent configuration directoriesmediumAgent snooping
.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.
1. Require the official `claude` CLI. Never edit `~/.claude/settings.json`. Makes network callslowCapability
Not a fault in itself. Listed so you know the mod talks to something, and to what.
- Test the shape the client actually sends. A curl with no `Authorization` How it starts
The opening of the file, as written. The whole thing — 2,205 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Model Router installation instructions
Repository maintenance workflow
- Use
$repo-maintainerfor incoming-change adoption decisions and consequential maintenance that can cross modules, clients, operating systems, installers, providers, credentials, protocols, generated artifacts, or release surfaces. - Use its impact analysis and risk-proportional verification before calling such work complete. Skip it for factual replies and obviously isolated trivial edits.
These instructions apply when a user asks an agent to install this repository.
Choose the target
codex(the Codex CLI and desktop app),dsh(DeepSeek Harness),gemini(Gemini CLI),cursor(Cursor Agent plus Cursor App), andclaude(Claude Code through the router-owned launcher), andopenclaw(OpenClaw through a router-owned Responses provider) are supported targets. OpenCode remains a provider rather than a client target.- Cursor is asymmetric: Cursor Agent uses the router's authenticated loopback Connect adapter, while retail Cursor App sends BYOK traffic through Cursor's servers and therefore needs an explicit stable public HTTPS tunnel to the router's separately keyed, app-only edge on port 4214. Never expose the main caller capability or the router port itself to the public Internet.
- A target is a client, not a router. One installation serves all of them:
one background service, one gateway, one set of provider credentials, one
provider selection, one set of ports.
MODEL_ROUTER_TARGETselects which client's configuration a command writes. It must never fork the state directory, the service, or the credential store — a user who installs two would otherwise be asked for every API key twice and would run two gateways against one set of provider quotas.ROUTER_PLANE_TARGETinsrc/paths.mjsnames that shared plane, and the environment aliases and the/healthservice name are keyed on it rather than on the client. - Installing more than one is normal and needs no special handling: run the install once per target. Whichever ones are already present are republished whenever the routable set changes, so the clients cannot drift apart.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- yesterday Changed · +15 lines · +235 tokens per session 1b1666bb9c2c
- 3d ago Changed · +167 lines · +2,573 tokens per session scan A → B 181e0d6a4933
- 5d ago First seen · 2,023 lines · 31,473 tokens per session scan A 4cbe95d8901d
codex-router AGENTS.md is an instructions file published in the GitHub repository duolahypercho/codex-router (3,100 stars, last pushed today), licensed MIT. It adds 34,281 tokens to every session, about $0.1714 per session on Opus 5. A static security scan graded it B with 2 findings (reads agent configuration directories, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other instructions, from other repositories
u-claw CLAUDE.md
Claude Code instructions for dongsheng123132/u-claw, covering claude.md, project overview — critical mental model, development commands, portable version — build dev copy and copy to usb drive.
openinterpreter AGENTS.md
Instructions for openinterpreter/openinterpreter, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.
muxlayer AGENTS.md
AGENTS.md instructions for dengmengmian/muxlayer, covering 核心原则, 工程规范, 输出规范, tdd 模式 and 边界.
feima-copilot-llms-extension copilot-instructions.md
Copilot instructions for feimacode/feima-copilot-llms-extension, covering feima copilot llms extension - copilot instructions, localization and 1. runtime strings — l10n/bundle.l10n.zh-cn.json.
cherry-studio AGENTS.md
AGENTS.md instructions for CherryHQ/cherry-studio, a project described as: AI productivity studio with smart chat, autonomous agents, and 300+ assistants. Unified access to frontier LLMs.
dario CLAUDE.md
Claude Code instructions for askalf/dario, covering dario — notes for claude code (and other llm coding agents), commits and prs, style, scope and when in doubt, ask.