/spatz:routingfrom spatz
Spatz model and effort selection. Use when an agent is about to dispatch a subagent, delegate a task, run codex exec, choose a model or effort, or verify or review another agent's work. Applies to Claude Code subagents, Codex, and other coding harnesses.
Ships in spatz. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Before every dispatch you route yourself, get a fresh ranking and use its first pair. Task size, urgency, and a previous ranking do not replace this call.
Use spatz when it is on PATH. Otherwise use this plugin's bin/spatz, resolved from the installed skill directory as ../../bin/spatz. Quote the absolute launcher path. It tries PATH, then Bun, then npx.
If the launcher is unavailable, use npx -y @spatz/cli@<version>. Read <version> from the plugin's .claude-plugin/plugin.json or .codex-plugin/plugin.json. Use the same executable for suggestions and reports. The first download is about 60 MB. Warm the plugin's pinned CLI by running "<plugin root>/bin/spatz" --version once. Codex stores plugins under ~/.codex/plugins/cache/; Claude's plugin path is shown by /plugin and is usually under ~/.claude/plugins/. Codex hooks time out after 10 seconds.
Find the models you can use now. Take names only from the live lists below, never from memory or from earlier runs:
CODEX_HOME="$(mktemp -d)" codex debug models | jq -r '.models[] | [.slug, .visibility, ([.supported_reasoning_levels[].effort] | join(","))] | @tsv'. Use list entries only. The empty CODEX_HOME avoids the account's settings. Do not add --bundled: it prints the copy shipped with the binary, not the current list.claude -p --model <model> --effort <effort> --output-format json "reply OK". A model is usable when its key appears in the result's modelUsage. Probe only the candidates from the catalog that you plan to use.Pass only the usable models and efforts in --models, or set them in config. A dispatch to a model that fails the check is reported as unavailable in step 3.
Done when the usable pairs are known, or the failed check is disclosed.
Write one task sentence without secrets or customer data. The sentence is sent to TypeSafe AI for classification. Run this command through the shell tool before the dispatch:
spatz "<the task in one sentence>" --json
For verification or review, add --family claude after GPT work or --family gpt after Claude work. This filters candidates. It does not add models.
Default precedence: SPATZ_MODELS > project .spatz.json > user ~/.spatz/config.json > harness preset. If you can dispatch extra models, set models in config. For example, Claude Code users with Codex can include GPT models. If the preset is wrong, narrow candidates with --models <model>:<effort>+<effort>,<model>:<effort> to pairs you can dispatch.
For a retry of earlier work, add --retry-of <earlier suggestion_id> to keep its recovery chain. A separately routed review keeps its own suggestion.
Keep stdout unfiltered: hooks read suggestion_id from it. Add --dry-run when testing spatz itself, so tests do not count for learning. If spatz exits non-zero or returns no ranking, continue with the harness default and disclose the failure in one line. For a review, also disclose when this fallback cannot supply the other family.
Done when the full output contains a ranking and suggestion ID, or the fallback is disclosed.
Dispatch ranking[0] at its selected effort through the harness's dispatch tool. Show the choice in this format:
spatz: <model> [<effort>] (<strategy>, n=<n>) · <suggestion_id>
Take strategy from the response and n from the selected ranking entry. Require the agent to report the model actually answering. Check available runtime evidence against the pick. If the selected model is unavailable, say so and stop that dispatch. Do not silently substitute another pair or claim an independent review.
In Claude Code, pass both model and effort on the Agent call (Claude Code 2.1.292 or later accepts a per-invocation effort). Or use a pinned agent whose model: and effort: frontmatter match the pick.
Efforts are none, low, medium, high, xhigh, max and ultra. Use only efforts offered by the selected harness model.
For Codex CLI, map ultra to -c model_reasoning_effort=ultra (for example, SPATZ_SUGGESTION_ID=<suggestion_id> codex exec -m gpt-6-sol -c model_reasoning_effort=ultra "<task>"). Claude Code has no ultra.
Prefix every Codex dispatch with SPATZ_SUGGESTION_ID=<suggestion_id> codex exec ..., using the ID from this ranking. Codex inherits the environment; the spatz Codex hooks record the run's tokens and test/build results against that suggestion.
If hooks are not installed or trusted, run spatz import-rollout <rollout.jsonl> --suggestion <suggestion_id> after the run. Use the rollout from that Codex run. Reimporting the same turns does not add their tokens twice. Still report the verified result below.
Give the dispatched agent its suggestion ID (in its brief, or in SPATZ_SUGGESTION_ID for Codex). The hooks then close its suggestion when the agent ends: with test/build evidence as an outcome, otherwise as unknown. Hooks cannot judge the result, so still report from the agent's verified result. spatz pending lists suggestions that have neither.
If a verified result fails, escalate: run spatz "<task>" --retry-of <suggestion_id> and dispatch the returned pair.
For none, set only the model and leave the harness effort setting untouched. Report the effort as none.
Done when the dispatch uses the selected pair and its answering model is recorded, or its unavailability is disclosed.
Run the report for the suggestion whose work was verified. Record the model and effort that actually performed that work:
spatz report <suggestion_id> --model <model used> --effort <effort used> --result pass|partial|fail
Choose pass for complete success, partial for incomplete success, and fail for failed verification. Report a separately routed review under its own suggestion ID. If routing failed before creating a suggestion, there is no ID to report. If reporting fails, disclose it.
Reports apply to one attempt. An identical report is a replay. A changed verdict creates a retry.
To correct a mistaken verdict, repeat the report with --correct. To target a specific execution, use --attempt <attempt_id>.
A correction keeps the known model, effort and usage unchanged. Report pair conflicts as a new attempt.
The skill needs no attempt-start call. Keep the suggestion ID through dispatch, import and reporting.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub lorenzh/spatz --plugin spatz