codex-router AGENTS.md

codex-router AGENTS.md is an instructions file for Codex, OpenCode from duolahypercho/codex-router. It costs 34,281 tokens per session, scanned B, original, MIT.

Repository instructions for installing and maintaining a model router across supported coding-agent clients. They explain how to choose a client target, follow the maintenance workflow, and report results.

In plain words
What is it for?
Use them to install the router for Codex, DeepSeek Harness, or Gemini CLI, decide whether repository-maintenance review is needed, and handle requests about unsupported Cursor or opencode targets.
Why use it?
They reduce guesswork when installing the router or making changes that affect several parts of a repository. They also clarify which clients are supported and which integrations were removed.

Instructions file for CodexOpenCode

About the project

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.

duolahypercho/codex-router · 3,100 stars · on GitHub

Install

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.

agentmods
npx agentmods add instructions/duolahypercho/codex-router/agents-md
Clone the repo
git clone --depth 1 https://github.com/duolahypercho/codex-router

Made for: Codex, OpenCode.

Wrote 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.

agentmods badge for codex-router AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/duolahypercho/codex-router/agents-md.svg)](https://agentmods.dev/instructions/duolahypercho/codex-router/agents-md)
Your own site
<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>
Per session 34,281 This file is loaded in full into every session.
When invoked 34,281 The same file — it is already loaded in full.
Security scan B 2 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce 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

Measured yesterday against content hash 1b1666bb9c2c, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

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`
AGENTS.md · 2,205 lines

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-maintainer for 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), and claude (Claude Code through the router-owned launcher), and openclaw (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_TARGET selects 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_TARGET in src/paths.mjs names that shared plane, and the environment aliases and the /health service 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.

Read the full file on GitHub · 2,205 lines

Changes

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.

  1. yesterday Changed · +15 lines · +235 tokens per session 1b1666bb9c2c
  2. 3d ago Changed · +167 lines · +2,573 tokens per session scan A → B 181e0d6a4933
  3. 5d ago First seen · 2,023 lines · 31,473 tokens per session scan A 4cbe95d8901d

Subscribe to this mod's changes

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.