API reference: Reference overview maps every package to its exhaustive API page, each with links to source and tests.
bunx smithers-orchestrator starters.
Default model routing
Claude builds and gates; Codex reviews and validates. Implementation runs on Claude Opus 5 (registry v7: it outbenchmarks GPT-5.6 Sol on agentic coding at lower output cost), and when usable Codex authentication is available GPT-5.6 checks the work: Sol for final review and second opinions, Terra for validation and tool-heavy checking, and Luna only for trivial, minimal-risk passes (tiny scoped edits, mechanical transforms, quick lookups, research-style gathering). Pin the tier to the role:
Never give GPT-5.6 Sol or Terra the orchestration or gating seat: deciding
scope, choosing direction, judging whether work progresses, and calling
something done are Claude jobs (Opus 5 at medium reasoning effort by
default, Fable 5 for planning and the most consequential calls). Sol and Terra
stay excellent inside reviews and validation, where they report findings for
the Claude orchestrator to weigh. Implementation starts on Claude Opus 5
(registry v7: it outbenchmarks Sol on agentic coding at lower output cost),
escalating to Fable 5 for the most ambitious builds; do not let Luna
carry work with real blast radius. Non-Codex adapters are later sequential
fallbacks when earlier Codex agents are unavailable or fail; they are not
parallel peers or a second opinion on every run. Explicit provider-specific
workflows continue to run as written. See the
SOTA model registry for the decision
rules and primary release links.
Implement → review loop
Iterate until a reviewer signs off, with a hard cap.<Loop> until, read the most recent iteration with ctx.latest. ctx.outputMaybe(.., { nodeId }) without an explicit iteration resolves the current render iteration (which equals the loop iteration only for a single, non-nested loop, and is 0 when several loops coexist), so an outputMaybe-based until can silently never advance.
Parallel Codex review
Two Codex tiers provide independent signals without routing to another provider. Cost = the slower model’s latency.continueOnFail keeps one tier’s timeout from blocking the other.
Approval gate with branching
Decision data drives the next branch.onDeny: "fail" aborts, "continue" proceeds without the gated branch, "skip" skips the gated tasks.
Retry policy & timeouts
Optional, non-blocking step
Conditional branch on output
ctx.outputMaybe for control flow.
Dynamic ticket discovery
Discover work, run each ticket, re-render to catch the next batch. Scales to large projects.t.id, not array index) so resume matches.
Coherent task with tools
One context boundary per logical operation, not per step. Splitting too finely loses cross-step reasoning.Per-agent least-privilege tools
Side-effect tools with idempotency
External mutations must mark themselves and use the runtime idempotency key. Addrevert when time travel can compensate the operation.
revert is legal only with sideEffect: true. Its context includes
output, effectStatus, idempotencyKey, runId, nodeId, iteration,
attempt, and toolCallSeq. effectStatus is either succeeded or
unknown. Treat both as “possibly happened”: find the external object, then
undo it. A handler must be idempotent and must throw when it cannot verify the
object safely.
Caching for iterative authoring
Schemas in their own file
MDX prompt with auto-injected schema
props.schema is the JSON-schema description of the Task’s outputSchema, auto-injected. Keeps the prompt and the validator in sync.
In .mdx prompt files, prose that looks like JSX or HTML is parsed as JSX. Wrap examples such as <Parallel maxConcurrency={N}> in inline backticks or a fenced code block so the prompt module still compiles and exports its default prompt component.
Custom hooks over ctx
VCS revert & per-attempt snapshots
Smithers records the current JJ commit ID in_smithers_attempts.jj_pointer per attempt. Revert any attempt with a recorded JJ pointer to its exact workspace state:
With SMITHERS_DURABILITY_SNAPSHOTS=1, attempts in one run that share a
rootDir can overlap while their brief JJ captures are serialized. Different
run scopes sharing that worktree, including a parent and child run, serialize
the whole attempt so checkpoints retain the correct owner. A waiter occupies a
scheduler slot for up to five minutes. A timeout disables snapshots for that
waiter and records a durability gap that needs attention. Lock waits are logged
and abort-aware.
TIME_TRAVEL_SIDE_EFFECT_BLOCKED.
git push are exempt.
GitHub API mutations such as gh pr merge are not.
Time travel: fork, replay, diff
--run to start immediately);
replay also makes a child run but immediately resumes it. Branch operations do
not run compensation handlers because the parent still owns its effects.
replay and fork --run stop before an effect-bearing boundary unless
--force is present. A plain fork succeeds and reports a warning.
--restore-vcs checks out the original revision so re-execution sees the same
source. See Time-travel commands compared.
Scoring tasks
ratio.
Eval suites for regressions
status, output (exact match), and outputContains (partial match). Reports land in .smithers/evals/<suite>.json; the command exits non-zero on failures.
Continue-as-new for very long runs
A run with too much accumulated state hands off to a fresh run with carried state.Hot reload while authoring
Fork agent session context
Every agent task produces a reusable session snapshot.fork starts a new task from a copy of another task’s final context, without mutating the source.
fork adds the source as a dependency (the forked task waits for it), copies its conversation into a fresh session, then submits the new prompt. Both branches above start from the same investigation and never affect each other. Chain it for follow-ups (plan → implement → verify); inside a <Loop> it forks the latest completed snapshot for that id. See <Task> fork.
Read next
- How It Works: the model these recipes plug into.
- Components: full prop surface.
- CLI: every command.