03 / Route

Route

OH Router launches the official, unmodified Claude Code and Codex CLIs, signed in with your own accounts. It never handles their tokens. Routing picks a profile with room and follows your policy when one runs out.

Profiles

A profile is one provider account with two sign-in folders: personal for interactive sessions and work for headless ones. The provider CLI signs in inside the folder and keeps its own credentials there.

Profiles
$ oh-router profiles add --provider claude --id work --label "Work"
$ oh-router profiles list --json
$ oh-router profiles login --provider claude --id work
$ oh-router profiles probe --provider claude --id work

profiles login prepares an isolated Chrome profile for the provider’s own sign-in page; --no-open prints the address instead. probe checks the sign-in without starting a model turn. To sign in a profile on a paired device from this machine’s browser, add --device ID (see Reach).

Routing policy

oh-router policy get shows the policy and recent decisions. policy set changes one setting at a time.

policy set flagDefaultEffect
--interactive-providerclaudeProvider for interactive sessions without a tier
--headless-providercodexProvider for headless sessions without a tier
--max-effort-onlytrueRun every session at Max effort
--model-fallbacktrueAt a limit, allow a lower tier on the same provider
--cross-provider-fallbacktrueAt a limit, allow the other provider
--project-continuationfalseContinue a limited project conversation on another account by itself
--codex-earned-resetstrueUse a free Codex reset when one is offered
--cross-family-reviewtrue--review sessions use the other provider than the author
--auto-folder-trustfalseAnswer folder-trust prompts for known project folders

oh-router policy automation shows which accounts automatic routing may use; --set JSON replaces the list. Accounts left out stay available for sessions you start with --profile.

At a usage limit

A session that reaches its limit holds its queue. From there:

  • oh-router switch ID --tier sol moves it to another tier, provider or --profile, carrying recent context. --prompt adds a note for the new session.
  • oh-router project-continue ID --started-at SECONDS continues the same project conversation on another enrolled account, keeping its holder, history, queue and draft.
  • oh-router profiles redeem-reset --provider codex --id ID uses a free reset when the provider offers one. Claude reset checks run on the account’s home Mac.

Free-reset checks call a separate oh command at ~/.local/bin/oh, which this repository does not include. Without it they report authority_missing and everything else works.

Policy plugins

A plugin is an executable in ~/.config/oh-router/plugins/ (mode 0700, not a symlink) that advises a launch or a limit. ohd writes one JSON line to its stdin and reads one line back, with a 2-second timeout. Pin a plugin with a sha256 entry in config.json and it is skipped when the file changes. oh-router policy plugin-spec prints the full contract.

FieldDirectionValues
eventinlaunch or on_limit
sessioninProject, kind, class, tier, profile, headless, review, requirements
actionoutproceed, relaunch, wait or redeem_reset
profile_idoutOptional profile to use
model_tieroutOptional tier: opus, sol, fable, astra, sonnet, terra, luna

The Router checks advice before acting on it: the profile must exist, be signed in and have a free lane, and a session that requires browser-auth stays on Claude.

Example: personal and work projects

The workspace plugin example (Python 3) maps project names to profiles. Edit WORKSPACES, read the script, then install it. It leaves an explicit --profile alone and stays silent for projects it does not know.

Install the example
$ curl -fsSL https://ohrouter.com/examples/workspace-policy.txt -o ~/.config/oh-router/plugins/workspace-policy
$ chmod 0700 ~/.config/oh-router/plugins/workspace-policy
$ oh-router spawn --project studio --tier opus