/model-right-sizer:model-right-sizer-prompt-tuningfrom model-right-sizer
Runs a discrete coordinate-ascent search over four wording knobs in model-right-sizer's prompt layers to maximize budget-adherence accuracy. Proposes winning wording as a diff for review.
Ships in model-right-sizer. 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.
This skill runs the search designed in
../../eval/tuning/DESIGN.md — read that
file first, especially its "What 'gradient descent' means here" section;
this SKILL.md is the runbook; the design doc is the honest account of what
kind of search this actually is and isn't.
In short: ../../eval/ablation/ already established
that all four layers earn their place (or at least, the fixed benchmark
suite hasn't shown otherwise). This skill starts from that answer — every
knob at level 0, i.e. the shipped agent file — and coordinate-ascent
searches four small, independently-editable wording knobs
(../../eval/tuning/knobs.py) for the setting
that maximizes real-execution accuracy_rate (secondarily, mean_loss) on
a held-back-checked benchmark subset.
This is the expensive kind of experiment from the start — unlike the ablation study's cheap composition sweep, EVERY candidate evaluation here requires real builds (there is no blueprint-only version of "did the real build stay within budget"). Compute and state, before spending anything:
blueprint_rows[] entry it produces, across the 3 tuning tasks
(t1_bulk_classifier, t4_interactive_latency_sensitive_chat,
t6_bounded_wellspecified_fix) — typically 3–9 real builds per candidate.MAX_PASSES passes (propose 2–3 as a default,
state it explicitly) until convergence or the cap, plus one held-out
check (3 more tasks' worth of real builds) at the very end, run once.If the person invoking this skill hasn't already specified MAX_PASSES or
a smaller pilot scope (e.g. "just sweep budget_margin once"), ask before
spending real build budget on a full multi-pass search. A reasonable
default when asked to "just run it": one full pass across all four knobs
(≈20–50 real builds), reporting whether it converged, before committing to
a second pass.
Real-execution measurement needs the same overhead-normalization discipline
../../eval/ablation/results/2026-08-21-full-independent-run.md
established: raw dispatch-reported token usage includes fixed per-dispatch
overhead (system prompt, tool schemas), not just the row's own spend.
../../eval/ablation/results/2026-08-21-full-independent-run-accuracy.json's
overhead_floors: sonnet 38,401 / haiku 28,508 tokens) rather than
re-measuring — but say explicitly that you're reusing them and why you
judge them still valid (same runtime, same rough timeframe).For each pass (cap at the confirmed MAX_PASSES), for each knob in
knobs.ALL_KNOBS, in order:
knobs.KNOBS[knob_name]["levels"] is one neighbor
candidate (optimizer.propose_neighbors). Render each with
../../eval/tuning/generate_variant.py
or knobs.render_variant directly.prompt as the intent, blueprint-only/dry-run mode first, then a real
build per resulting blueprint_rows[] entry at its stated model/effort/
budget, exactly as
../../eval/ablation/DESIGN.md's
accuracy-sweep step does. Record {actual_tokens, budgeted_tokens} per
row, actual_tokens normalized by the Step 1 floor for that row's model
tier.Agent tool caps concurrent dispatches (20 at last check);
past it, calls fail hard rather than queue. Prefer the Workflow tool's
pipeline() for a candidate batch large enough to need it — it paces
concurrency automatically. Either way, a long-running batch can stall
with no error and no notification; if a check-in is overdue, diagnose via
the run's journal.jsonl (started vs. result event counts) and
output-file mtimes before assuming it's still progressing, and recover
by recomputing the missing set from the filesystem rather than an
assumed cursor — see
../../eval/ablation/results/2026-08-21-full-independent-run.md
for a worked recovery from exactly this stall.optimizer.score_candidate(records) per
neighbor, using the current settings' own already-computed score as the
baseline to beat (compute it once per pass if it changed; carry it
forward unchanged if this knob is the first one visited this pass and
the prior pass's winner is already scored).optimizer.coordinate_ascent_step(current_settings, current_score, knob_name, neighbor_evaluations). If improved is
True, adopt new_settings/new_score as current before moving to the
next knob in this pass; if False, leave current unchanged.After a full pass, if no knob moved, stop — converged. Otherwise continue to the next pass, up to the confirmed cap.
Take the final settings (converged or cap-reached) and evaluate it —
same real-build protocol as Step 2 — against the held-out task set
(t2_ambiguous_cross_service_refactor, t3_long_horizon_agentic_build,
t5_fanout_pr_review), which no candidate touched during the search.
Report both numbers side by side. A held-out accuracy_rate well below the
tuning-set accuracy_rate is itself the headline finding (the search
overfit the tuning subset) — report it as prominently as a clean win would
be reported.
Render a markdown report (or an Artifact) with, at minimum:
settings/accuracy_rate/mean_loss, and which move (if any) was taken,
so a reader can audit the path, not just the endpoint.agents/model-right-sizer.md (via
../../eval/tuning/generate_variant.py
diff) — this skill never edits the shipped file itself; a human
reviews the proposed wording change and applies it (or doesn't) as its
own separate, reviewable change.agents/model-right-sizer.md — every variant and
every result lives under a scratch directory; the winning wording is
reported as a proposed diff for a human to apply.model-right-sizer-layer-ablation; this skill's search space
starts from all four layers present and stays there.computation_errors entry (never a silent drop or a fabricated
figure) for any record the scoring function rejects.../../eval/tuning/DESIGN.md — the full
experimental design, including what "gradient descent" means here and the
known limitations.../../eval/tuning/knobs.py — the knob
registry and variant renderer.../../eval/tuning/optimizer.py — the
scoring function and coordinate-ascent step logic (pure, no dispatch).../../eval/tuning/generate_variant.py —
CLI to render one knob-settings variant.../model-right-sizer-layer-ablation/SKILL.md —
the sibling study this one presupposes (all four layers stay); shares the
independent-dispatch and overhead-normalization discipline this skill
reuses verbatim.What SKILL.md sets; muted values are Claude Code's defaults
11 skills in this plugin
/model-right-sizer-auditOne-shot, PER-CALL-SITE audit of a repo's EXISTING LLM calls — every place code invokes a model (an SDK/API call, a sub-agent dispatch, an agent frontmatter definition), decomposed by INTENT into the distinct jobs it does, never a grep hit on a model name and never one candidate per file. A skill pinned by one static `model:` key still gets its steps split by intent when severable under Claude Code's per-turn model binding. DELEGATES each call to `model-right-sizer-dryrun` (never re-implements its scoring) and merges results into ONE schema-conformant JSON blueprint committed at the TARGET REPO'S ROOT via a PR — never a markdown table. Distinct from `model-right-sizer-dryrun` (invoke directly for one hypothetical task) and `model-right-sizer-install` (the standing before/after mandate). Use when someone says "audit this repo's model calls", "right-size the models in <repo> per call site", "find every LLM call and right-size it", or "commit a model right-sizing blueprint for <repo>"./model-right-sizer-budget-guardThe while-work-is-in-flight companion to `model-right-sizer-dryrun`: once `work_routing_map[]` is real and being dispatched as sub-agents, the runbook for keeping two things honest — the status ledger (`status`/`status_updated_at`/`status_note` per row, flipped at every real transition) and the token-budget guard (checking real spend against `budget.token_ceiling`; once `budget_threshold.py`'s `threshold_crossed()` trips at `warning_threshold_pct`, sending `format_budget_warning()`'s string into that unit's next turn). Checks at turn boundaries with whatever usage the dispatch mechanism reports — never a fabricated live ticker. Only applies to rows actually dispatched, never design-time-only `blueprint_rows[]`, and never replaces Pass B's usage report. Use when someone says "dispatch the work-routing map", "run the budget guard while units are in flight", "update the status ledger for unit X", or "did unit X cross its warning threshold".npx claudepluginhub cloudzero/cloudzero-claude-marketplace --plugin model-right-sizerOther plugins' skills for the same job