stas4000/claude-subagent-router

8 stars · Last commit 2026-09-29

Claude Code sub-agents: an Opus 5.5 lead, Sonnet 5.5 or Opus 5.5 builders picked per sub-task by a Jev classifier, and a guard so Sonnet never runs at max effort.

README preview

# claude-subagent-router

A Claude Code sub-agent setup where an Opus 5.5 lead hands sub-tasks to Sonnet 5.5 or Opus 5.5 builders by effort level. A PreToolUse hook picks the builder for each sub-task. A Jev classifier makes the pick, and an offline rule-based picker answers when Jev is not available. A hard guard makes sure Sonnet never runs at max effort.

It is the setup we run ourselves, packaged so you can copy it. Python 3.10+, standard library only.

## Why

We ran every sub-agent on Opus 5.5, because we never compromise on quality. Then we measured Sonnet 5.5 at each effort level on real coding tasks, and added Sonnet where it is just as good: Sonnet 5.5 on high and extra high passed the same hidden tests as max, on a fraction of the output tokens (numbers in [Measured](#measured)). Work that touches shared state, money, auth, sends or a wire format stays on Opus.

## How it fits together

```
              lead (Opus 5.5)
                   |  Agent call: a builder name plus the brief
                   v
        PreToolUse hook   router/hook.py
                   |  asks router/pick.py
                   v
         Jev classifier   (offline rules when Jev is off or down)

View full repository on GitHub →