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.
$ 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 flag | Default | Effect |
|---|---|---|
--interactive-provider | claude | Provider for interactive sessions without a tier |
--headless-provider | codex | Provider for headless sessions without a tier |
--max-effort-only | true | Run every session at Max effort |
--model-fallback | true | At a limit, allow a lower tier on the same provider |
--cross-provider-fallback | true | At a limit, allow the other provider |
--project-continuation | false | Continue a limited project conversation on another account by itself |
--codex-earned-resets | true | Use a free Codex reset when one is offered |
--cross-family-review | true | --review sessions use the other provider than the author |
--auto-folder-trust | false | Answer 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 solmoves it to another tier, provider or--profile, carrying recent context.--promptadds a note for the new session.oh-router project-continue ID --started-at SECONDScontinues the same project conversation on another enrolled account, keeping its holder, history, queue and draft.oh-router profiles redeem-reset --provider codex --id IDuses 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.
| Field | Direction | Values |
|---|---|---|
event | in | launch or on_limit |
session | in | Project, kind, class, tier, profile, headless, review, requirements |
action | out | proceed, relaunch, wait or redeem_reset |
profile_id | out | Optional profile to use |
model_tier | out | Optional 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.
$ 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