Undercut for OpenCode

OpenCode already loads SKILL.md files through its native skill tool. Give it one that stops overpaying.

Undercut is a free, MIT-licensed policy file that OpenCode discovers the same way it discovers any other agent skill — cheap tier first, escalate only on evidence, never on a vibe. OpenCode is model-agnostic by design, wired up to whichever provider you configure; the rubric doesn't care which one that is, only whether the unit of work is mechanically verifiable.

Install for OpenCode See the benchmarks
Works anywhere a SKILL.md is read
Claude Code Codex Cursor Copilot OpenCode

How this maps onto OpenCode

Same rubric. OpenCode's native skill tool underneath it.

OpenCode ships a documented Agent Skills mechanism: a native skill tool that discovers SKILL.md files under .opencode/skills/<name>/SKILL.md (walking up from your working directory to the git worktree root), and — for compatibility with skills written for other agents — the same <name>/SKILL.md layout under .claude/skills/ and .agents/skills/ too, plus the equivalent global paths under ~/.config/opencode/, ~/.claude/, and ~/.agents/. The agent calls skill({ name }) to load a skill's full content on demand, gated by the frontmatter's required name and description fields. That's the exact shape Undercut ships in — no adapter needed.

Undercut's tier names — cheap, standard, frontier, apex — are generic on purpose. models.md resolves each one to a real model slug per provider family (Anthropic, OpenAI, Google, open-weight), which lines up with how OpenCode itself works: it's provider-agnostic, so whichever model family you've wired OpenCode up to, the tier maps onto that family's roster the same way it does for a direct-API integration — cheap is the smallest/fastest model, standard is the default work model, frontier is the highest-reasoning production model, apex is reserved for the single batched tie-break call.

Nothing about this sits between OpenCode and your model provider. It's a policy file OpenCode's skill tool loads at dispatch time — no proxy, no network hop, nothing to route around if you remove the skill directory.

Install for OpenCode

Free. MIT. Nothing installs, nothing proxies your traffic.

Option 1 — skills CLI

$ npx skills add undercutsh/firstpass

This is the same generic skills CLI referenced on the main site. We haven't independently verified which of OpenCode's recognized skill directories it targets — if it writes to .claude/skills/, that path is one of OpenCode's documented discovery locations and needs no change; if you're unsure, use Option 2 below and place it under .opencode/skills/ directly.

Option 2 — copy the skill directory directly

Clone or download undercutsh/firstpass, then copy skills/firstpass/ into .opencode/skills/firstpass/ at your project root (or ~/.config/opencode/skills/firstpass/ to make it available globally). OpenCode's skill discovery walks up from your working directory to the git worktree root, so it also works dropped anywhere in between.

$ mkdir -p .opencode/skills && cp -r firstpass/skills/firstpass ./.opencode/skills/firstpass

Validate it yourself

  1. 1Read the published results — testing/README.md and the raw JSON in testing/results/
  2. 2Reproduce for free, no API key, no spend: node src/main.js --mock
  3. 3Run live with whichever provider you've already configured OpenCode against — a single-vendor smoke test is pennies

Zero lock-in. It's a policy OpenCode's skill tool reads — delete the directory and you're back to status quo.

How it works

The Undercut Rubric · v1

Six flags assign a tier. Three triggers are the only way up.

This is a named, versioned spec — not internal logic we could quietly change. When the rubric changes (a new flag, a different cap), the version number moves and the changelog says why.

Every unit of work gets scored against six flags, then assigned the cheapest tier that can plausibly handle it. It only moves up a tier when something objective proves it needs to — a failed check, a measured disagreement, an explicit uncertainty flag. It never moves up on a guess, and it never moves back down mid-task.

unit of work
6-flag rubric
0 flags
cheap~90% of units land here ✓
1–2
standard
3+/own
frontier
↑ escalate +1 tier only on: fail ×2 · two runs disagree · tagged "uncertain" residue only — never redoes the batch
See the rubric

Step 1 — Base tier, six-flag rubric

Unverifiable — can output be checked mechanically? (tests, schema, diff, grep)
Ambiguous — one right answer, or several defensible ones?
Blast — reversible? touches money, auth, user data, production, deletes?
Cross-cutting — one file/source, or reasoning across many?
Novel — pattern-following, or genuinely new design?
Format-strict — must output match an exact schema?

0 flags → cheap · 1–2 → standard · 3+ or any ownership/judgment call → frontier. Apex only when you can write one sentence stating why the marginal intelligence pays for the cost.

The override — single biggest lever

Cheap-to-verify ⇒ cheap-to-generate. If output can be checked mechanically, it starts at the lowest tier regardless of how hard it looks — verification catches failure. Only unverifiable work needs to start high.

Step 2 — Escalate exactly one tier, on evidence only

  • Verification fails twice at the current tier
  • Two cheap-tier runs disagree on ambiguous-flagged work
  • The worker tags an item "uncertain"

Residue-only handoff

The next tier up gets only the failed or uncertain items, plus verification notes. It resolves the residue — it never redoes the batch.

Hysteresis — guardrails

Never de-escalate mid-task. Max one retry per tier. Anything still unresolved goes to a single batched apex tie-break call. One hard file in a 700-file job doesn't drag the other 699 up a tier.

 unit of work
      |
  6-flag rubric
      |
  +---+----+
  | 0 flags|--> cheap
  | 1-2    |--> standard
  | 3+/own |--> frontier
  +---+----+
      | fail x2 / disagree / uncertain
      v
  escalate +1 tier
  (residue only)
      |
  still unresolved?
      v
  single batched
  apex tie-break

Why it holds up

Flags steer. Verification and escalation decide.

Even when the rubric flags are scored imperfectly, the escalator still routes work to the right tier almost every time — because a wrong flag only ever costs one extra cheap attempt, never a wrong answer or a big bill.

See the data

A stock dispatcher model reproduces the rubric flags imperfectly — Haiku hits 90% agreement, Sonnet 93%. The weakest flag (format-strict) is only 60%. None of that matters: under the shipped policy, both dispatchers still route 100% of units to the correct tier. A wrong flag changes the ladder cap, never the base tier — worst case, one extra cheap attempt.

Haiku dispatcher
90% flag agreement
100% tier-match
Sonnet dispatcher
93% flag agreement
100% tier-match

The rules are about the work, not the model.

Every rule is a property of the unit of work — verifiable, ambiguous, blast-radius — never a specific model's known weakness. Vendor cards go stale as models change; work properties don't. It's also hard-won — a format-strict rule that worked on Anthropic backfired on Gemini, which is exactly why the rubric no longer encodes per-vendor behavior.

Honest limits

What this doesn't do.

Not a proxy, not a gateway, doesn't auto-flag in production (OpenCode scores the flags itself — measured robust to getting them wrong, see above), and doesn't promise a dollar figure for your workload. Full list, with the finance/procurement note and the paid-tier disclosure, is on the main page.

Undercut the top tier. Not the quality bar.

Nothing about this page expires. What does keep happening is the token bill, one session at a time, on whatever OpenCode is currently doing with mechanical work.

View on GitHub