The decision layer for agent harnesses

Your agent.
A better
next move.

Give every tool call a little more direction. Harness Router chooses the next tool, uses the result, and keeps your agent moving.

Open sourcePython 3.11+MIT licensed

routing.previewIllustrative example
Current observation

The failing test points to src/parser.py.

Selected next toolread_file
0.93confidence

For the harness
you already use.

CodexClaude CodeohmypiAntigravityDeepSeek

01 / The loop

A little direction. Every iteration.

Good decisions
come full circle.

A tool result changes what your agent knows. Feed that observation into the next choice, and routing becomes part of the whole workflow.

01

Decide.

Bring the goal, current state, and available tools. Router chooses a next step from that set.

pre_decision
02

Execute.

Your harness builds the arguments, checks its permissions, and carries out the tool call.

host harness
03

Observe.

Turn the result into the next observation. Recompute the next tool as the task progresses.

post_tool_use
New observation. New decision.

Your harness keeps its planning, permissions, approvals, and execution policy.

02 / The decision stack

The right depth
for the next step.

Reuse a known choice. Ask Jev when tools overlap. Look ahead when downstream outcomes matter.

Inside the router
01CacheReuse

A compatible state can reuse a previous decision. The hook cache includes the goal, observation, last action, and tool catalog.

same statecached choice
02JevChoose

Resolve a closed choice among available tools through OpenRouter. Large registries can be narrowed by category before selecting a tool.

available toolsnext tool
03MCTSLook ahead

Search a supplied, side-effect-free state graph when the first choice depends on later outcomes. Simulate the possibilities, then return the first action.

simulated pathsfirst action

MCTS is optional and needs a simulator. A fallback hands the choice back to the planner.

03 / Integrations

One router. Five ways in.

A native place
in your workflow.

Each adapter works with the lifecycle its host exposes. Your tools and execution controls stay with the harness.

01

Codex

Prompt and result hooks precompute the next tool. Local validation can request a re-plan.

Native hooksSet up
02

Claude Code

Discover native and MCP tools, then connect prompt, tool-result, and validation callbacks.

Native hooksSet up
03

ohmypi

Route from the live tool registry and expose the selected tool through the active tool set.

ExtensionSet up
04

Antigravity

Use invocation and result callbacks to prepare decisions, then validate before execution.

Hooks + MCPSet up
05

DeepSeek

Connect through the Codex hook bridge with a supplied tool catalog and current goal.

Hook bridgeSet up
Building your own loop?

Call Router directly with the Python API, CLI, or MCP server.

Read the API guide

04 / Get started

Python 3.11+ · OpenRouter API key

Make the connection.

Install the router, add your key, and connect the harness you use.

01 Install the router

Terminal
uv / harness-router
uv tool install --force --with 'mcp>=2,<3' \
  'git+https://github.com/Protocol-Lattice/harness-router.git@main'

02 Set your provider key

Environment
export OPENROUTER_API_KEY="your-key"

Make the key available to the harness process before starting a session.

03 Connect Codex

Git project root
Project hook installer
curl -fsSL https://raw.githubusercontent.com/Protocol-Lattice/harness-router/main/scripts/install_hook.py \
  | python3 - --provider codex
Finish installing the adapters

The current Codex and Claude Code installer also needs these two adapter files. Run this after installing the hook.

Prompt and stop adapters
for hook in pre_decision stop; do
  curl -fsSL "https://raw.githubusercontent.com/Protocol-Lattice/harness-router/main/.codex/hooks/${hook}.py" \
    -o ".codex/hooks/${hook}.py"
done

Start a fresh Codex session

The startup hook discovers tools. Prompt and result callbacks then prepare the next choice for local validation.

Integration guide

The installer merges settings and backs up changed files. Add .harness-router/ to your project's .gitignore for shared session state.

Inspect the installer

Open source. Open possibilities.

Keep your harness.
Move it forward.