OH Router · oh-router · ohd · oh-holder

Headless Rust session router, terminal safety guard, and board worker for Claude Code and Codex.

oh-router supervises Claude Code and Codex inside detached PTY holders, routes work across four frontier and standard model tiers (Opus, Sol, Fable, Astra), blocks accidental keystrokes into terminal spending dialogs, coordinates @vercel/board tasks, and pairs machines over Cloudflare Tunnel.

Install verified release binaries (macOS & Linux)
$ curl -fsSL https://ohrouter.com/install.sh | sh
$ oh-router --version

Verifies the SHA-256 archive digest before extracting oh-router, ohd, and oh-holder into ~/.local/bin.

Open-source MIT Rust workspace (oh-router, ohd, oh-holder) for macOS and Linux.

2D ECMA-48 VT screen guard blocking keystrokes while a usage-limit credit dialog is on screen.
oh-vt maintains a live 120x40 ECMA-48 grid with SGR cell attributes and screen_epoch checks so automated steering never confirms paid usage-credit prompts.

Four-tier routing & effort

Four frontier and standard models with unified effort control

oh-router routes strictly across four full-capability models (Opus, Sol, Fable, Astra) and maps a four-step EffortLevel (low, medium, high, max) across Claude Code and Codex flags.

TierModel IDProviderClassCLI Mapping & Default Effort
opusclaude-opus-5-5claudestandardclaude --model claude-opus-5-5 --effort <level> (high, or max when window headroom >= 50%)
solgpt-6.1-solcodexstandardcodex -m gpt-6.1-sol -c model_reasoning_effort="<level>" (max)
fableclaude-fable-5-2claudefrontierclaude --model claude-fable-5-2 --effort <level> (max, frontier default)
astragpt-6-astracodexfrontiercodex -m gpt-6-astra -c model_reasoning_effort="<level>" (max)

Detached PTY holders (oh-holder)

Each session runs inside its own detached oh-holder process over a 0600 Unix domain socket, so live TTYs survive ohd daemon restarts without dropping running commands.

Cross-provider continuation

oh-router switch <id> --tier sol --effort max stages recent turn context and continues work across providers, models, and machines.

Workspace lane isolation

Each workspace profile separates personal (interactive) and work (headless) directories with independent OS flock leases.

Neutral PolicyAdvisor plugins

Executable stdio JSONL plugins in ~/.config/oh-router/plugins/ advise workspace directory mapping and project tier defaults with optional SHA-256 binary pins.

2D ECMA-48 terminal guard

Never send blind keystrokes into a paid usage-credit dialog

Raw newline or digit writes into an unparsed PTY can confirm pay-as-you-go upgrade menus when an agent hits a window limit. oh-vt parses every byte from the PTY master before any write reaches the child process.

  • Maintains primary and alternate (?1049h) cols x rows cell grids with SGR bold, inverse, foreground color, and wide-character widths.
  • Increments a monotonic screen_epoch counter whenever display erase, scroll, resize, or alternate-screen transitions alter visible geometry.
  • Classifies empty_input_box, permission_prompt, folder_trust_dialog, and limit_dialog states deterministically.
  • Rejects session.steer, session.action, session.input, and queue.flush with limit_dialog_blocked while a spending or upgrade prompt is on screen.

Read the 2D VT Screen Guard guide

@vercel/board coordination

Atomic task claims, lease renewal, and routed worker loops

oh-board embeds both a native Rust @vercel/board@0.53.0 HTTP client (VbClient) and a zero-dependency local server (EmbeddedVbServer) speaking the same endpoints.

  • Start locally in one command (oh-router board connect --mode local) or connect to a hosted board with --mode vercel --url <https-url>.
  • Create tasks with routing labels (--label tier=sol --label effort=max) and task dependencies (--need <task-id>).
  • Run oh-router worker --once or oh-router worker --loop to claim ready tasks, spawn routed sessions, renew claim leases, and halt cleanly on 409 claim_lost.

Read the Vercel Board Worker guide

Vercel Board task lifecycle showing ready tasks, atomic claim leases, worker execution, and thread updates.
oh-board speaks @vercel/board@0.53.0 locally or against a hosted board, renewing task claim leases while oh-router worker supervises execution.

Cloudflare Tunnel pairing

Supervise remote Linux and macOS hosts without opening firewall ports

Expose ohd only on 127.0.0.1 behind a cloudflared Quick or Named Tunnel using constant-time stream_steer Bearer authentication.

Start a scoped Quick Tunnel on a remote machine
$ oh-router daemon start
$ oh-router devices tunnel-start --scope stream_steer --quick --publish
$ oh-router devices recipe --name build-box --role server --quick
  • Rejects ?token= URL query strings with 401 Unauthorized so tokens never leak into proxy or access logs.
  • stream_steer permits session listing, inspection, steering, and dialog actions while forbidding kind: "shell", custom argv, and profile or tunnel changes.

Read the Cloudflare Tunnels & Pairing guide

Multi-machine pairing over Cloudflare Tunnel to a loopback 127.0.0.1 HTTP bridge with stream_steer scope.
oh-router devices tunnel-start pairs cloudflared with a 127.0.0.1 HTTP JSON-RPC bridge using constant-time stream_steer Bearer tokens.