{"id":"75342276-8919-4cc9-aad6-05dab286a2ce","slug":"right-size","kind":"skill","name":"right-size","summary":"Agent Skills and a router that pick the model, reasoning effort and delegation a coding task deserves. Multi-harness, benchmarked.","owner":"ciroperf","repoUrl":"https://github.com/ciroperf/right-size","license":"MIT","licenseTier":"permissive","trust":"community","stars":4,"match":null,"fewStars":true,"format":"skill","createdAt":"2026-10-17T12:23:21.000Z","addedAt":"2026-10-21T11:46:02.044Z","logoUrl":"https://avatars.githubusercontent.com/u/45690237?u=618f6f1ba74d87eadb5ceed1a9c1afe2c8f22149&v=4","linkOnly":false,"collection":null,"skillPath":null,"categories":["developer-tools","productivity"],"tags":["ai-agents","antigravity","claude-code","codex","llm","model-routing","reasoning-effort","token-optimization"],"runtime":"binary","local":true,"cloudCapable":false,"cloudCapability":"unknown","cloudReadyOnPlatform":false,"needsApiKey":false,"reviewed":false,"syncedAt":"2026-10-26T19:21:40.700Z","sample":false,"url":"https://conduits.dev/tools/right-size","language":"Python","transports":["stdio"],"install":{},"requirements":{"env":[],"upstreamMayCharge":false},"tools":null,"readme":"<div align=\"center\">\n\n<picture>\n  <source media=\"(prefers-color-scheme: dark)\" srcset=\"assets/banner-dark.svg\">\n  <source media=\"(prefers-color-scheme: light)\" srcset=\"assets/banner-light.svg\">\n  <img alt=\"right-size: give every coding task the compute it deserves\" src=\"assets/banner-light.svg\" width=\"100%\">\n</picture>\n\n<br/>\n\n**Agent Skills and a small router that give every coding task the compute it deserves: the model and effort to start on, when to step up, and when a subagent is (rarely) worth it.**\n\n[![License: MIT](https://img.shields.io/badge/license-MIT-0d9488.svg)](LICENSE)\n[![Agent Skills](https://img.shields.io/badge/Agent%20Skills-SKILL.md-7c3aed.svg)](https://agentskills.io)\n[![Release](https://img.shields.io/github/v/release/ciroperf/right-size?color=blue)](https://github.com/ciroperf/right-size/releases/latest)\n[![Status](https://img.shields.io/badge/status-beta-orange.svg)](#roadmap)\n[![Tests](https://github.com/ciroperf/right-size/actions/workflows/tests.yml/badge.svg)](https://github.com/ciroperf/right-size/actions/workflows/tests.yml)\n[![PRs welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](CONTRIBUTING.md)\n\n[![Claude Code](https://img.shields.io/badge/Claude%20Code-supported-D97757?logo=claude&logoColor=white)](#install)\n[![Codex](https://img.shields.io/badge/Codex-supported-111111)](#install)\n[![Antigravity](https://img.shields.io/badge/Antigravity-advice-4285F4?logo=google&logoColor=white)](#harness-support)\n[![Cursor](https://img.shields.io/badge/Cursor-advice-555555)](#harness-support)\n[![Copilot](https://img.shields.io/badge/Copilot-advice-555555?logo=githubcopilot&logoColor=white)](#harness-support)\n\n[Install](#install) · [Usage](#usage) · [How it works](#how-it-works) · [Tiers](#tiers) · [Harness support](#harness-support) · [Benchmark](#benchmark) · [FAQ](#faq)\n\n</div>\n\n---\n\n## Why\n\nCoding agents waste tokens in predictable ways:\n\n1. **Everything runs on the biggest model at the highest effort**, including renames and one-line fixes.\n2. **Work gets delegated to subagents when doing it inline would be cheaper.** A subagent starts cold: its own system prompt, its own context, re-reading files the main agent already has.\n\nright-size sizes the work, starts on the smallest setup that still gets it done, and steps up only on evidence. What the [benchmark](#benchmark) has measured so far, on real bug fixes scored by their own tests:\n\n| Finding | Measured |\n|---|---|\n| Maximum effort buys nothing on ordinary fixes | Opus at `max`: **3.9× the cost, 5.3× the time**, same 10/10 solved |\n| A cheaper session model is where the saving is | Whole session on Sonnet: **60% cheaper, ~3× faster** than the Opus default, same 6/6 bugs solved |\n| Subagents rarely pay off on small, related fixes | Forcing delegation: **about 2× the cost** of doing it inline |\n\nThese are single runs on one repo; [benchmark v1](bench/README.md#v1-prepared-not-run-yet), with repetitions and harder tasks, is prepared.\n\n**Three ways to use it**\n\n- ⚙️ **`/right-size-defaults`** sets the model and effort your sessions start on, from the project's tests and risk profile. Most of the measured saving comes from here.\n- 🧭 **Router mode** (`route.py`) sizes a task before the session starts, launches it on that tier's model and effort, and escalates if the session gets stuck.\n- 💬 **The `right-size` advisor** sizes work inside a session: inline or subagent, which tier, which effort, and when to step up.\n\n```\nright-size: delegate=no · tier=deep · effort=medium\nwhy: auth + users schema change (risk floor → deep), no tests, ~3 files\napply: inline; run the session on opus (/model opus) at medium effort (claude-code)\nescalate if: a verifiable failure → /effort high; past deep only after you confirm\n```\n\n**What makes it different**\n\n- 🧭 **It can say \"don't delegate\".** Inline is the default; a subagent has to earn its start-up cost.\n- 🔌 **Multi-harness.** One decision, translated into each agent's native config: Claude Code and Codex, with advice-only maps for Antigravity, Cursor and Copilot.\n- 🛡️ **Risk-aware, not keyword-based.** Auth, payments, migrations and public APIs go to the top tier, however small the diff. Read-only questions about them stay cheap.\n- 📈 **Escalates on evidence.** Start low when tests exist; step up one tier on a verifiable failure, two on a reasoning failure, and raise effort before going past the top tier.\n- 📏 **Measured, not claimed.** The benchmark is in the repo, including every case where right-size made things worse.\n\n## Install\n\nInstall it for **every project** (global) or **just one project**. A project install lives in the repo, so you can try right-size on one codebase, or share it with your team, without touching anything else.\n\n<details open>\n<summary><strong>Claude Code</strong></summary>\n\nGlobal, for all your projects:\n\n```bash\nclaude plugin marketplace add ciroperf/right-size\nclaude plugin install right-size@ciroperf\n```\n\nJust this project, shared with the team through `.claude/settings.json` (teammates are offered the plugin when they open the repo):\n\n```bash\nclaude plugin marketplace add ciroperf/right-size --scope project\nclaude plugin install right-size@ciroperf --scope project\n```\n\nUse `--scope local` instead for this project only, without committing anything.\n\n</details>\n\n<details>\n<summary><strong>Codex</strong></summary>\n\nGlobal, as a plugin that updates itself:\n\n```bash\ncodex plugin marketplace add ciroperf/right-size\ncodex plugin add right-size@ciroperf\n```\n\nJust this project: Codex plugins are always user-wide, so copy the skills into the repo's `.agents/skills/` instead:\n\n```bash\nnpx skills@latest add ciroperf/right-size -a codex\n```\n\n</details>\n\n<details>\n<summary><strong>Antigravity, Cursor, Copilot and others</strong> (manual updates)</summary>\n\nJust this project (the default when run inside a repo):\n\n```bash\nnpx skills@latest add ciroperf/right-size\n```\n\nGlobal: add `-g`. Pick agents with `-a`, e.g. `-a cursor`. Update later with `npx skills update`.\n\n</details>\n\n<details>\n<summary><strong>Claude.ai or manual install</strong></summary>\n\nDownload from the [latest release](https://github.com/ciroperf/right-size/releases/latest):\n\n- `right-size.skill`: upload it in Claude.ai under **Settings → Capabilities → Skills**.\n- `right-size-vX.Y.Z.zip`: all three skills. Copy the `skills/` folders into your agent's skills directory (for example `.claude/skills/` or `.agents/skills/`), keeping them side by side.\n\n</details>\n\n### Recommended: set the project's default model and effort\n\n```text\n> /right-size-defaults\n```\n\nIt checks the project's safety net and risk profile, recommends the model and effort new sessions should start on, and writes them on your confirmation (`model` and `effortLevel` in `.claude/settings.local.json` or `.claude/settings.json`; `model` and `model_reasoning_effort` in `.codex/config.toml`). It never picks `high` or above as a default: those are escalation steps. This is where most of the measured saving comes from (see [Benchmark](#benchmark)).\n\n### Optional: generate the subagents\n\n```text\n> /right-size-setup\n```\n\nThis writes one subagent per tier with model and effort preset: `.claude/agents/right-size-*.md` in Claude Code, `.codex/agents/right_size_*.toml` in Codex. It asks before overwriting anything. Without these agents right-size still works, but it can only pass a model per call, and effort then follows the session.\n\n## Usage\n\nIt runs on its own when an agent is about to delegate, plan multi-step work, or pick a model. You can also ask for it directly:\n\n```text\n> right-size this before you start\n> is this worth a subagent?\n> size these four tickets\n```\n\nEach answer is a four-line block: the decision, the facts behind it, how to apply it in the harness you're in, and when to step up. At most three short notes follow, only for assumptions to confirm or things the subagent's brief must include.\n\n<details>\n<summary><strong>Example: a rename across a monorepo (Claude Code)</strong></summary>\n\n```\nright-size: delegate=yes · tier=mechanical · effort=low\nwhy: 14 call sites in 9 unopened files, a one-sentence rename pattern, tsc --noEmit + vitest catch misses\napply: right-size-mechanical (haiku), or general-purpose with model=haiku if that agent doesn't exist (claude-code)\nescalate if: tsc or vitest still red after a real attempt → standard (sonnet, medium)\n```\n\n</details>\n\n<details>\n<summary><strong>Example: a read-only question about payment code (Codex)</strong></summary>\n\n```\nright-size: delegate=no · tier=inline · effort=session\nwhy: read-only (so payments doesn't push it to deep), likely 1-3 files once grep finds the entry point\napply: inline; keep session model and effort (codex)\nescalate if: event handling fans out past ~10 files / ~2k lines → spawn right_size_scout (gpt-6-luna, effort low, read-only)\n```\n\n</details>\n\n<details>\n<summary><strong>Example: sizing a batch of tickets before fanning out</strong></summary>\n\n```\n1. right-size: delegate=no  · tier=inline   · effort=session   why: one line in list_display, field already exists\n2. right-size: delegate=yes · tier=deep     · effort=high      why: float→Decimal data migration on a money column\n3. right-size: delegate=yes · tier=standard · effort=medium    why: mechanical pattern, but scripts/ has no tests\n4. right-size: delegate=yes · tier=standard · effort=medium    why: new view + button on an existing pattern\nescalate if: tests red after a real attempt → one tier up; wrong approach → two tiers up\n```\n\n</details>\n\n> The examples are real outputs from the skill's test suite (Claude Opus 5.5, October 2026), lightly trimmed.\n\n### Router mode: size the whole session\n\nInside a session, right-size can only save by delegating: the main session keeps the model it started with. The router moves the decision in front of the session. One classifier call on the cheapest tier (about $0.002 in Claude Code) sizes the task with the same `tiers.yaml`, then the harness starts on that tier's model and effort.\n\n```bash\npython .claude/skills/right-size/scripts/route.py \"fix the failing date parsing test\"\n```\n\n```\nright-size: route · tier=standard · model=sonnet · effort=medium\nwhy: bug fix with a clear reproduction, tests present, not a risk area\nescalate if: a real attempt fails → deep (opus, effort medium)\n```\n\nThe script ships inside the skill folder and needs only Python 3.9+, no packages. Where it lives depends on how you installed right-size; inside a session, asking \"give me the right-size router command\" makes the skill print it with the full path.\n\n| Install | Path to `route.py` |\n|---|---|\n| `npx skills add` (project) | `.claude/skills/right-size/scripts/route.py` (`.agents/skills/...` for Codex) |\n| `npx skills add -g` | `~/.claude/skills/right-size/scripts/route.py` |\n| Claude Code plugin | `~/.claude/plugins/cache/ciroperf/right-size/<version>/skills/right-size/scripts/route.py` |\n\nA short alias helps:\n\n```bash\nalias rs='python .claude/skills/right-size/scripts/route.py'          # bash / zsh\n```\n\n```powershell\nfunction rs { python .claude\\skills\\right-size\\scripts\\route.py @args }   # PowerShell\n```\n\n| Flag | What it does |\n|---|---|\n| `--print` | Run headless. If the session ends with `RIGHT-SIZE-ESCALATE: verifiable` or `reasoning`, the router resumes it one or two tiers up, within the ceiling, and prints the cost of each step |\n| `--file <path>` | Read the task from a file, or from stdin with `-` |\n| `--dry-run` | Show the decision and the command, don't run anything |\n| `--tier <tier>` | Skip the classifier |\n| `--split` | With `--print`: when the task is several independent requests, run each as its own session on its own tier. Measured so far: costs more than one session, see [`bench/`](bench/) |\n| `--harness codex` | Launch Codex instead (`-m` plus `model_reasoning_effort`). Not yet tested end to end |\n| `--json` | With `--print`: a JSON summary of the decision and every run |\n| `-- <args>` | Pass the rest to the harness CLI, e.g. `-- --permission-mode acceptEdits` |\n\n```\nright-size: route · tier=mechanical · model=haiku · effort=low\nright-size: escalate · mechanical → standard (sonnet, effort medium) · tests still red\nright-size: done · mechanical (haiku) $0.01 → standard (sonnet) $0.07 · router $0.0002 · total $0.08\n```\n\nIf the classifier can't run (CLI missing, not signed in, timeout), the router falls back to `standard` and says so. Interactive sessions get the same note, and the agent tells you which `/model` and `/effort` to switch to if it gets stuck. A switch resumes the same conversation, so nothing is lost, but the new model reads it once without cache. Whether routing beats the harness default on cost at equal results is what the [benchmark](#benchmark) is measuring next.\n\n## How it works\n\n```mermaid\nflowchart LR\n    A[Task] --> B{Size it<br/>files · safety net · risk · reading vs reasoning}\n    B --> C{Worth a subagent?}\n    C -- no --> D[inline]\n    C -- yes --> E{Pick tier}\n    E --> F[scout]\n    E --> G[mechanical]\n    E --> H[standard]\n    E --> I[deep]\n    D & F & G & H & I --> J[Pick effort<br/>raise effort before model]\n    J --> K[Apply ceiling<br/>.right-size.yaml]\n    K --> L[Translate to harness<br/>model + effort]\n```\n\nThe decision itself is kept cheap: it uses what's already in context plus at most a couple of quick lookups. Sizing a task should never cost more than the savings it's after.\n\n## Tiers\n\nModel names live only in the harness maps. The skill reasons in abstract tiers:\n\n| Tier | For | Claude Code | Codex | Antigravity |\n|---|---|---|---|---|\n| `inline` | Small changes, files already in context | session model | session model | session model |\n| `scout` | Read and search only | `haiku` · low | `gpt-6-luna` · low | Flash · Low |\n| `mechanical` | Renames, boilerplate, import updates | `haiku` · low | `gpt-6-luna` · low | Flash · Low |\n| `standard` | Ordinary features and fixes | `sonnet` · medium | `gpt-6.1-sol` · medium | Flash · High |\n| `deep` | Auth, security, migrations, payments, concurrency | `opus` · medium | `gpt-6-astra` · high | Pro · High |\n\nAdvice-only maps, with no generated config yet:\n\n| Tier | Cursor | Copilot |\n|---|---|---|\n| `scout`, `mechanical` | `composer-2.5` | Claude Haiku 5.5 |\n| `standard` | `composer-2.5` | Claude Sonnet 5.5 |\n| `deep` | `claude-opus-5[effort=high]` | Claude Opus 5.5 |\n\nMappings were verified against each vendor's docs (Cursor and Copilot on 2026-10-18, the others on 2026-10-17) and are not yet benchmarked. They live in [`skills/right-size/harnesses/`](skills/right-size/harnesses/), and keeping them current is most of this project's maintenance.\n\n## Harness support\n\n| Level | Harnesses | What you get |\n|---|---|---|\n| **Full** | Claude Code, Codex | Advice, native config, benchmark |\n| **Advice + map** | Antigravity, Cursor, Copilot | Advice with native model names; generated config and a smoke test are planned |\n| **Advice** | Any harness that loads Agent Skills | Advice in tier terms |\n\nGemini CLI was replaced by Antigravity CLI in June 2026, so it has no map of its own.\n\n## Configuration\n\nCap the tier for a project by adding `.right-size.yaml` at the repo root:\n\n```yaml\nmax_tier: standard   # anything above asks for confirmation first\n```\n\n## When not to use subagents\n\nDelegation costs more than it saves when:\n\n- the files are already in the main context;\n- the change is a few lines;\n- the brief would be about as long as the work;\n- you are iterating on the change interactively;\n- the \"parallel\" parts actually depend on each other.\n\n## Benchmark\n\n**v0, 2026-10-17:** 10 real [honojs/hono](https://github.com/honojs/hono) bug fixes merged after the models' training cutoff, scored by each PR's own tests. Claude Code 2.1.302 headless, Opus 5.5 main model, one run per task and configuration. Method, tasks and every run record are in [`bench/`](bench/).\n\n<picture>\n  <source media=\"(prefers-color-scheme: dark)\" srcset=\"assets/bench-2026-10-17-v0-dark.svg\">\n  <img alt=\"Benchmark v0: cost per solved task default $0.33, max $1.30, right-size $0.42; wall time 9, 50 and 11 minutes; tasks solved 10, 10 and 9 of 10\" src=\"assets/bench-2026-10-17-v0-light.svg\">\n</picture>\n\n| Config | Solved | Total cost | Cost per solved task | Total tokens | Total time |\n|---|---|---|---|---|---|\n| `default` (Opus 5.5, default effort) | 10/10 | $3.31 | $0.33 | 4.40M | 9 min |\n| `max` (Opus 5.5, effort `max`) | 10/10 | $13.01 | $1.30 | 15.80M | 50 min |\n| `right-size` (skill + subagents) | 9/10 | $3.77 | $0.42 | 5.32M | 11 min |\n\nWhat it shows, regressions included:\n\n- **Maximum effort is the big waste.** `max` cost 3.9× as much and took 5.3× as long as the default, and solved nothing extra.\n- **right-size did not beat the default.** It cost 14% more: reading the skill and sizing the task is overhead, and it never delegated, which was the right call. Every task was a fix inside one module, with the files already in context, so a cold-start subagent would have cost more.\n- **One regression:** `trie-suffix-wildcard` failed under right-size, with 298 of 299 tests passing. It ran inline on the same model and effort as `default`, so this is most likely run-to-run variance. A single run per configuration can't prove it.\n- **The lesson:** inside a session, advice alone can't save on small fixes, because the session keeps its model. That's why [router mode](#router-mode-size-the-whole-session) exists.\n\n**Batches, 2026-10-18:** two prompts with three independent Hono bugs each, every bug scored by its own PR's tests. One run per configuration. Records in [`bench/results/2026-10-18-batch/`](bench/results/2026-10-18-batch/).\n\n| Config | Bugs solved | Total cost | Total time |\n|---|---|---|---|\n| `router-standard` (whole session on Sonnet, medium) | 6/6 | **$0.41** | 1 min |\n| `default` (Opus 5.5, medium) | 6/6 | $1.03 | 3 min |\n| `router-split` (one session per bug, each on its own tier) | 6/6 | $1.29 | 4 min |\n| `right-size` (advisor; chose inline) | 6/6 | $1.32 | 3 min |\n| `router` (risk floor sent both batches to Opus at high effort) | 6/6 | $1.48 | 4 min |\n| `delegate` (experiment: every bug forced onto a subagent) | 6/6 | $2.09 | 4 min |\n\n- **The saving is the session model.** Sonnet solved all six, including the two security fixes, for 60% less than the default.\n- **Subagents didn't pay.** The Haiku and Sonnet subagents were cheap, but the Opus session's briefing and review, plus security parts sent to a cold Opus subagent, doubled the cost. The advisor's choice to stay inline was right.\n- **What changed because of it:** the `deep` tier now starts at medium effort, with high as its first escalation step, and `/right-size-defaults` exists.\n\nNext, [benchmark v1](bench/README.md#v1-prepared-not-run-yet): Opus at high effort and always-Sonnet as references against the router, four harder tasks where a cheaper model should fail, and three runs per configuration. Its question is whether routing beats simply starting on Sonnet.\n\nOne task prompt (`accepts-wildcard`) contradicted its PR's tests in the first pass and failed in all three configurations. It was corrected and all three reran; the note is in [`bench/tasks/hono.yaml`](bench/tasks/hono.yaml).\n\n## FAQ\n\n<details>\n<summary><strong>Does it replace a model router or proxy?</strong></summary>\n\nNo. Router mode only picks the model and effort a harness session starts with, using the harness's own CLI flags; it never sits between the agent and the API. API-level routers such as claude-code-router or OpenRouter are complementary.\n\n</details>\n\n<details>\n<summary><strong>How is this different from other routing skills?</strong></summary>\n\nSome skills advise a tier and effort but leave the rest to you. Others hook every subagent spawn in a single harness. right-size also decides *whether* to delegate, maps the decision to native config in several harnesses, and backs it with a public benchmark.\n\n</details>\n\n<details>\n<summary><strong>Can the advisor change the model of the session I'm in?</strong></summary>\n\nNo. Inside a running session nothing can switch the main model or effort for you: right-size can only tell you which `/model` or `/effort` to run. That's why the measured savings come from `/right-size-defaults` and router mode, which act before the session starts.\n\n</details>\n\n<details>\n<summary><strong>Will it go stale when new models ship?</strong></summary>\n\nThe skill reasons in tiers, so only the YAML maps need updating. Each map records the date it was verified.\n\n</details>\n\n## Roadmap\n\n- [x] Advisor skill with tiers, risk floor and escalation\n- [x] Harness maps for Claude Code, Codex and Antigravity\n- [x] `right-size-setup`: generate native subagents (`scout`, `mechanical`, `standard`, `deep`) for Claude Code and Codex\n- [x] `right-size-defaults`: recommend and set the project's default model and effort\n- [x] Router mode: pick the session's model and effort before it starts (`scripts/route.py`)\n- [x] Benchmark v0: one repo, one harness ([results](#benchmark))\n- [x] Batch experiments: delegation, split and pinned-tier routing ([results](#benchmark))\n- [x] Cursor and Copilot maps (advice only)\n- [ ] Generated config and smoke tests for Antigravity, Cursor and Copilot\n- [ ] Benchmark v1: router vs always-Sonnet and Opus high, harder tasks, three runs each (prepared)\n- [ ] Codex end-to-end runs of the router and benchmark\n\n## Contributing\n\nModel updates, new harness maps and benchmark tasks are all welcome. See [CONTRIBUTING.md](CONTRIBUTING.md).\n\n## License\n\n[MIT](LICENSE) © Ciro Perfetto\n"}