babysitter - automatic model routing for Codex and Claude Code
Every prompt, routed.
Babysitter has Jev classify each prompt you type, then runs it on the tier its rules pick: a small model for a typo, a large one for a race condition.
bbs-codex [prompt]
bbs-claude [prompt]
Your codex and claude commands stay exactly as they are.
git clone https://github.com/divyansharma001/babysitter.git
YOU ❯
src/policy.js and src/claude-session-policy.js.Four tiers. Plain rules you can read.
Jev scores each prompt for complexity, risk, and breadth. A short local policy turns those scores into a tier. Set the scores and see what it picks, or click a tier to see scores that land on it.
| Tier | Chosen for | Claude Code | Codex |
|---|---|---|---|
| Clear, repeatable, mechanical work | haiku | gpt-5.6-luna | |
| Everyday engineering work | sonnet · medium | gpt-5.6-terra | |
| Complex, ambiguous, broad, or high-risk work | opus · high | gpt-5.6-sol | |
| Hardest work: high complexity plus high impact or broad scope | fable · xhigh | gpt-6-astra |
- High-risk or repository-wide work goes to at least Sol.
- Low classifier confidence alone never raises the tier.
- If Jev is down, the prompt runs on Terra instead of blocking.
Classifying is not switching.
Claude's prompt cache belongs to one model. Switching models on every prompt can cost more than it saves, so in bbs-claude a separate session policy decides when a switch is worth it.
- Upgrades
- happen right away.
- Downgrades
- wait until the current model has handled 3 turns.
- After ~12,000 tokens
- of context, automatic downgrades stop.
/compact- writes a short handoff and starts a fresh routed session.
Add it next to what you have.
You need
- Node.js 20 or later
- A TypeSafe API key for Jev
- The Codex CLI and/or Claude Code, signed in
Good to know
- It never replaces
codexorclaude. Remove the link and you are back where you started. - It uses your own signed-in CLIs. It does not proxy or store provider credentials.
- Updates only run when you type
bbs-update, and it refuses if you have local changes.
git clone https://github.com/divyansharma001/babysitter.git
cd babysitter
cp .env.example .env
# add your TYPESAFE_API_KEY to .env
npm install
npm link
Then start a routed session with bbs-codex or bbs-claude.
What it does not do.
- It only routes sessions started with
bbs-codexorbbs-claude. It cannot reach into a session that is already running. - Every prompt costs one small Jev call. Any saving depends on your work and the models you can use.
- Models, effort controls, pricing, and sign-in are set by your Codex and Claude accounts, not by Babysitter.
- It shows the cost the provider reports. It does not estimate savings for you.