Discover MCPs & agents
Loading MCPs and agents…
Loading MCPs and agents…
Route an engineering backlog into the right AI coding agent: high-volume and review tasks to OpenAI Codex, deep refactor/architecture/ambiguous tasks to Claude Opus 4.8. Deterministic, auditable keyword routing with rationale. Stdlib only.
Jump to setup instructionsGitHub checked 568h ago - refresh overdue
A deterministic task router that assigns backlog items to the AI coding agent best suited for each job -- OpenAI Codex for volume and review work, Claude Opus 4.8 for depth-sensitive engineering.
Keywords: OpenAI Codex, Claude Opus 4.8, AI coding agents, agent orchestration, task routing, developer productivity, Claude Code, model selection, AI pair programming
License: MIT
Running every engineering task through a single AI coding agent leaves capability on the table.
Routing every task to Claude is slow and expensive. Routing every task to Codex means architecture and security work gets less scrutiny than it deserves. A simple, auditable router fixes this.
No third-party dependencies. Requires Python 3.10 or later.
git clone https://github.com/aharwelik/codex-claude-router
cd codex-claude-router
That is all. The router package is importable directly from the repo root.
python -m router plan examples/backlog.json
Sample output:
-------------------------------------------------------------------
ID LANE CONF RATIONALE
-------------------------------------------------------------------
T01 codex-volume 0.96 Volume signals fired: docstring, repetitive.
T02 codex-volume 0.99 Volume signals fired: rename, codemod, bulk.
T03 codex-volume 0.96 Volume signals fired: boilerplate, add type hints.
T04 codex-review 1.00 Review signals fired: review, audit, find bugs, check, ve...
T05 codex-review 1.00 Review signals fired: review, audit, check, verify.
T06 claude-depth 1.00 Depth signals fired: architecture, refactor, redesign, cr...
T07 claude-depth 1.00 Depth signals fired: concurrency, race condition, deadloc...
T08 codex-volume 1.00 Volume signals fired: boilerplate, scaffold, bulk, add te...
T09 codex-volume 1.00 Volume signals fired: format, typo, changelog, whitespace...
T10 claude-depth 0.15 No strong signals detected.
-------------------------------------------------------------------
Summary (10 task(s)): claude-depth: 3 | codex-review: 2 | codex-volume: 5
python -m router plan examples/backlog.json --json
Each task in the JSON output includes id, lane, confidence (0-1), rationale, and a signals object listing which keywords fired in each category.
One task per line. Lines starting with # are treated as comments.
python -m router plan my-tasks.txt
python -m router explain "Investigate race condition in the job queue dispatcher"
Output:
Lane : claude-depth
Confidence : 0.96
Rationale : Depth signals fired: race condition, investigate. This task involves
architecture, subtle bugs, security, refactoring, or cross-cutting
concerns where Claude Opus 4.8's reasoning depth reduces the risk of
missing non-obvious interactions.
Depth signals : 2 fired
from router import score_task, plan_backlog
result = score_task("T1", "Refactor auth module", "security-sensitive, multi-file")
print(result.lane.value) # "claude-depth"
print(result.confidence) # e.g. 0.97
print(result.rationale)
tasks = [{"id": "T1", "title": "Add docstrings", "description": "boilerplate pass"}]
results = plan_backlog(tasks)
JSON backlog (recommended):
{
"tasks": [
{"id": "T1", "title": "Rename UserRecord to UserEntity", "description": "bulk codemod"},
{"id": "T2", "title": "Redesign auth architecture", "description": "security, multi-file"}
]
}
A top-level JSON array is also accepted. The id field is optional and defaults to T1, T2, etc.
| Lane | Agent | Use when |
|---|---|---|
codex-volume | OpenAI Codex | Boilerplate, rename, format, lint, docstrings, scaffolding, bulk codegen |
codex-review | OpenAI Codex | Code review, PR audit, diff checks, find-bugs passes |
claude-depth | Claude Opus 4.8 | Architecture, refactors, security, concurrency, subtle bugs, ambiguous scope |
The default lane when no signal fires is claude-depth with low confidence (0.15). Ambiguous scope is treated as higher blast-radius work.
The router uses transparent keyword heuristics -- not a model. Every routing decision is deterministic and auditable: given the same input text, the same lane is always chosen.
Each signal table is a list of (regex, weight, label) triples. The router matches all patterns against the combined title and description, accumulates weighted scores per lane, and picks the lane with the highest total. Confidence is derived from the accumulated score via a saturation curve so a single strong signal (~0.9 weight) yields roughly 75% confidence, and two strong signals yield 90%+.
The full signal tables are in router/scorer.py and can be read and extended directly.
This router is part of the proof-carrying-ops model, which introduces the Blast-Radius Invariant: higher-blast-radius work -- changes that touch more of the system, carry more ambiguity, or are harder to reverse -- must be routed to a tighter verification gate before merge.
The router operationalizes this:
codex-volume). These changes are easy to inspect and revert. Codex's throughput advantage is captured without overloading the review gate.codex-review) are low blast-radius reads: Codex does the first-pass diff scan and surfaces potential bugs for a human to confirm. The human is still the final gate.claude-depth) gets Claude Opus 4.8's reasoning depth as a prerequisite to the merge gate. A concurrency bug, an insecure auth pattern, or an architectural mismatch found at this stage costs seconds to fix; found post-deploy it can cost hours.Defaulting unknown tasks to claude-depth is a deliberate conservative choice: ambiguity is itself a blast-radius signal.
python3 -m unittest discover -s tests -p 'test_*.py' -v
All tests use the built-in unittest module. No third-party test runner required.
python3 tools/no_emoji_check.py
Must print OK: no emoji code points found. This check also runs in CI via .github/workflows/ci.yml.
Anthony Harwelik -- aharwelik@gmail.com -- https://github.com/aharwelik
GitHub checked 15h ago - refresh overdue. Recently viewed repositories target hourly refresh.
Find a documented setup for your client. No sign-in, installation, or tool execution.
If this MCP is also published on mcpchannel.ai, you can subscribe from Browse and use the gateway config there instead.