$npx -y skills add Archive228/loopkit --skill model-routingSplit the Plan/Act/Verify loop across three model tiers — frontier planner, cheap executor, frontier judge — via env vars read by run.sh.
| 1 | # Model routing |
| 2 | |
| 3 | `run.sh` reads three optional env vars and threads them into each `claude` invocation as `--model`. All default to unset, in which case the CLI default model is used (behaviour unchanged from a bare run). |
| 4 | |
| 5 | ## The three knobs |
| 6 | |
| 7 | - `CLAUDE_PLANNER_MODEL` — reserved for `/spec` workflows that draft PROMPT.md up front. Not read by the current `run.sh` loop, but claimed here so future planner passes bind to it. |
| 8 | - `CLAUDE_EXECUTOR_MODEL` — used on the "do the next step" call. This is the workhorse; it runs on every iteration. Pick something cheap and fast. |
| 9 | - `CLAUDE_JUDGE_MODEL` — used on the `/verify` call. Runs once per iteration to adversarially check the executor's diff. Pick a frontier model — a weak judge is worse than no judge. |
| 10 | |
| 11 | ## Recommended shape |
| 12 | |
| 13 | ``` |
| 14 | planner = frontier (Opus-class, runs once at /spec time) |
| 15 | executor = cheap-fast (Haiku-class, runs every turn) |
| 16 | judge = frontier (Opus-class, runs every turn but on a small diff) |
| 17 | ``` |
| 18 | |
| 19 | ## Example |
| 20 | |
| 21 | ```bash |
| 22 | export CLAUDE_PLANNER_MODEL="claude-opus-4-7" |
| 23 | export CLAUDE_EXECUTOR_MODEL="claude-haiku-4-7" |
| 24 | export CLAUDE_JUDGE_MODEL="claude-opus-4-7" |
| 25 | ./run.sh |
| 26 | ``` |
| 27 | |
| 28 | ## The Elvis Executor+Judge finding |
| 29 | |
| 30 | A cheap executor paired with a frontier judge outperforms a frontier executor with no judge on long loops. The judge catches the executor's premature-victory claims that a mono-model run rationalises away when it runs out of context. Cost stays low because the judge only sees the diff, not the working history. |