Harness Router is a decision layer for agent harnesses. It is built for AI coding agents such as Codex and Claude Code, and its purpose is to route tool calls before they run. Instead of letting the model reason through every closed-choice tool selection, Harness Router decides which tool to call and returns that decision. It works two ways: use the skill to stop model reasoning about obvious tool calls, or let PreToolUse intercept and route calls automatically. Fast route handles ordinary choices, while real ambiguity can escalate to Jev-backed MCTS. It ships as a native stdio MCP server with two tools and it is MIT open source.
The problem it addresses is the cost of reasoning about the obvious. The site's core instruction is to stop reasoning about obvious tool calls, explaining that with the skill, Codex can delegate closed-choice tool selection to Harness Router instead of spending a full model reasoning step on an obvious choice. The headline statistics are 2 MCP tools, 1 Jev prior max in MCTS, and 0 extra model reasoning required before hook routing. That matters because a routing decision is far narrower than a generation step. The site compares Jev with GPT-6 Astra: Jev input is about 238× cheaper, at $0.042 per million input tokens versus $10, and Jev output tokens are free while GPT-6 Astra is $50 per million output tokens, so the total request-cost gap can be substantially larger depending on output usage. The stated point is not to replace Codex's planner: Jev handles the narrow, closed-choice routing step, while Codex keeps the broader reasoning and execution loop.
The first feature group is the two ways into the router. Use the skill when you want explicit control, or use the hook when you want every tool call checked automatically. With the skill, Codex can delegate closed-choice tool selection to Harness Router instead of spending a full model reasoning step on an obvious choice. Prefer automatic enforcement? The PreToolUse hook applies the same routing layer before execution without requiring the model to invoke the skill explicitly. The site illustrates typical decisions with a few simple transitions: a known file leads to read, an edit that has finished leads to test, and four plausible tools lead to route. Compact state goes in and one tool choice comes out.
The second feature group is the native MCP server and its tools. Codex gets a native stdio server instead of a heavy helper flow. There are 2 MCP tools, route and route_mcts. route takes a compact goal, the latest observation, and a small shortlist. The server keeps its provider alive, reuses connections, and returns a tiny structured result. Registration is done by adding a mcp_servers.harness-router block to ~/.codex/config.toml with the harness-router-mcp command and the OPENROUTER_API_KEY environment variable, then restarting Codex and verifying both tools with /mcp.
The third feature group is route_mcts, for when one move is not enough and the product needs to search. route_mcts explores a supplied side-effect-free state graph. Jev can seed the root once, and the remaining simulations are local. The server never executes simulated writes, shell commands, browser mutations, or network mutations; it selects only the first real action. A representative benchmark profile is described as 4,096 sims at depth 3, with 1 Jev prior max in MCTS. The site shows a small example tree with branches such as quick at 0.60, invest at 0.78, verify at 0.31, and an inspect path leading to finish at 1.00 or a fallback.
The fourth feature group is the project hooks and their safety behavior. You choose Codex or Claude Code. The project hook prepares a session tool catalog, then uses Harness Router to check tool choices before execution. The installer runs in your project root, adds the hook scripts, merges the configuration, and keeps generated state out of Git; it keeps existing settings and other hooks, backs up changed files, and is safe to run again. For Codex, the startup hook discovers its MCP tool inventory and builds the session catalog. For Claude Code, the startup hook discovers native tools from claude mcp serve and configured MCP tools through the SDK control interface, then publishes the live registry via HARNESS_ROUTER_TOOL_REGISTRY, and discovery makes no model call. Behavior is fail open and keeps approvals: each PreToolUse call uses fast route first, and when that decision is uncertain and a side-effect-free graph provider is configured, the hook can escalate to route_mcts. Without a graph provider it never invents an MCTS tree. The same choice, a fallback, a timeout, or a router error lets the original call continue, while a different confident choice blocks only that call and asks your agent to re-plan once. Sandbox and approval rules remain untouched.
Overall, the rule is one router with two ways in: skill or hook. The router validates the call against the discovered tool inventory before execution, keeps deterministic transitions cheap while still checking the selected tool, and returns one tool choice from compact state. Simple decisions stay on the fast path and route_mcts is brought in only when the choice needs deeper search. Installing takes three steps. First, install the latest main branch globally and isolated through uv tool with the mcp>=2,<3 dependency and the harness-router git URL. Second, expose your OpenRouter key to the local MCP process by exporting OPENROUTER_API_KEY; the server can load without it, but Jev routing needs it when route is called. Third, register the stdio server in Codex with codex mcp add harness-router -- harness-router-mcp, then verify with codex mcp list. Project hook installation is a separate step that runs the installer in your project root with a provider flag for Codex or Claude Code.
The reported outcomes are about decision latency, measured on 26 Sep 2026 with two experiments of 24 paired decisions each, using four, eight, or sixteen candidates, where timing stopped at the choice and selected tools were never executed. For route on ordinary tool choices, Harness Router was 9.5× faster on observed mean latency, 3,842.1 ms for Codex versus 404.5 ms; 10.2× faster on median, 3,384 ms versus 332 ms; and 9.0× faster on p95, 6,435 ms versus 718 ms, with 24/24 choices matching Codex. For route_mcts on three-step trees with 4,096 sims, it was 12.3× faster on mean, 4,772.4 ms versus 388 ms; 11.6× faster on median, 4,328.5 ms versus 372.5 ms; and 12.8× faster on p95, 6,958 ms versus 545 ms, with 24/24 optimal at 100%. The methodology notes that Codex chose a name only and its timer includes response generation, host scheduling, and dispatch, while router timings include MCP transport and the provider round trip, with MCTS also including local search; graph preparation, pure reasoning time, and task completion time were not measured. These exploratory runs used different workloads in an existing Codex conversation, matching choices measure agreement, and the MCTS test checks the highest-reward branch.
Concretely, the workflows shown on the site include routing a known file straight to read instead of reasoning about it; keeping deterministic post-edit transitions such as edit finished to test cheap through fast routing while still checking the selected tool; handling a shortlist of four plausible tools by sending compact state in and getting one tool choice out; escalating a three-step decision to route_mcts over a supplied side-effect-free state graph that selects only the first real action; and installing a project hook so a session tool catalog is prepared and every tool choice is checked before execution for either Codex or Claude Code.
Harness Router is aimed at developers and teams running AI coding agents such as Codex and Claude Code who want tool selection to be faster, cheaper, and more reliable before execution. It integrates through MCP as a native stdio server, supports project hooks for Codex and Claude Code, requires Python 3.11+ in the project root for hook installation, uses uv tool for an isolated global install, and needs OPENROUTER_API_KEY when Jev routing is called. It is released under the MIT license and is free to install and use.
In short, Harness Router keeps simple decisions fast and brings in route_mcts only when the choice needs deeper search, routing tool calls before they run through either a skill or a hook.