Undercut for Cody
Undercut is a free, MIT-licensed routing policy you save as a Prompt in Sourcegraph Cody's Prompt Library — cheap tier first, escalate only on evidence, never on a vibe. Cody has no built-in per-task cost dial of its own to compare against; this exists because the same overpay-by-default pattern we measured elsewhere in the agent ecosystem (see the Claude Code page) shows up anywhere an agent defaults every task to its strongest model.
Sourcegraph discontinued Cody Free, Cody Pro, and Cody in Starter plans on July 23, 2025, and pointed individual and Pro users to Amp instead — Cody Enterprise plans were unaffected and remain live today. If your org doesn't already run Cody Enterprise, this page still applies once you do; otherwise see the Amp page for the free path Sourcegraph itself now recommends. Sources: Cody FAQ and Sourcegraph's announcement.
How this maps onto Cody
Cody is genuinely different from every other client on this site, and the honest version of that difference matters more than the pitch. Cody does not document an always-on, auto-read repository instructions file the way Claude Code reads CLAUDE.md, Warp reads AGENTS.md, or Copilot reads copilot-instructions.md. Its older per-workspace .vscode/cody.json custom-commands file was itself explicitly invoked (a slash command or a click), never context loaded automatically — and per Sourcegraph's own Prompts docs, that file has since been migrated to the Prompt Library, a cloud-hosted, org-shared collection of saved prompts reachable from the top navigation bar of a Sourcegraph Enterprise instance or the Cody panel in your IDE. Prompts there are also run explicitly — the play icon, or the Prompts dropdown in chat — not read into every session by default.
That's a real difference from the rest of this site's install story: saving Undercut's rubric as a Prompt gets it in front of Cody, shared with your whole org, but it only fires when someone actually runs it — there's no confirmed way to make Cody apply it silently on every dispatch the way an AGENTS.md file does elsewhere. If your repo is also worked on by an AGENTS.md-reading agent — Sourcegraph's own pricing page lists Cody as working alongside Claude Code, Cursor, Codex, and Amp — appending the same policy text to that repo's AGENTS.md gets you the always-on version for those clients, with the Cody Prompt as the explicit-invoke path for Cody sessions specifically.
Undercut's tier names — cheap, standard, frontier, apex — are generic on purpose. Cody Enterprise is multi-model rather than tied to one vendor's lineup, so models.md gives a rule of thumb rather than a fixed slug: cheap resolves to the smallest/fastest model your Sourcegraph instance has enabled, standard to the default chat model, frontier to the highest-reasoning model on offer, and apex to a single batched tie-break call. Nothing here sits between Cody and its model backend — it's prompt text Cody runs at your request, no proxy, no network hop.
Install for Cody
Copy the raw policy text below, then in your Sourcegraph Enterprise instance go to Prompts > Create new prompt, paste it into the Prompt template box, set the mode to Chat only, and mark it Public (or share to your org) so the whole team can run it — not just you.
Run the printed text through that command (or just open the file on GitHub and copy it) and paste the result as the prompt body. Once saved, run it from the Prompts dropdown in Cody chat before dispatching a batch of mechanical work — it applies for that session, not silently on every future one.
If the same repo is also worked on by Claude Code, Cursor, Codex, or Amp — all of which Sourcegraph's own pricing page lists as working alongside Cody — append the same file to the project's AGENTS.md so those clients pick it up automatically. Cody itself won't read this file on its own; it's a belt-and-suspenders step for a mixed-agent repo, not a substitute for Option 1.
What's still unverified: skills.sh lists no Cody install target, so the generic npx skills add undercutsh/firstpass referenced on the main site does not apply here — use Option 1 above instead. We also have not found a documented way to make a saved Prompt run automatically on every Cody session the way AGENTS.md does for other clients; treat that specific gap as confirmed absent rather than untested, per Cody's own Prompts docs linked above.
testing/README.md and the raw JSON in testing/results/node src/main.js --mockZero lock-in. It's prompt text Cody runs when you ask — delete the Prompt and you're back to status quo.
How it works
The Undercut Rubric · v1This 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.
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.
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.
The next tier up gets only the failed or uncertain items, plus verification notes. It resolves the residue — it never redoes the batch.
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
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.
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.
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
Not a proxy, not a gateway, doesn't auto-flag in production (Cody's own dispatcher scores the flags itself — measured robust to getting them wrong, see above), and doesn't promise a dollar figure for your workload. It also doesn't prove your number until you run it — every figure here is an observation from our tasks and our graders, not a guarantee about yours. It's Enterprise-only in practice: Cody Free and Pro were discontinued July 23, 2025 (see the banner above), so this page only helps if your org already runs Cody Enterprise. And unlike the rest of this site, there's no confirmed way to make Cody apply this automatically every session — it's a Prompt you run, not a file Cody reads on its own. Full list, with the finance/procurement note and the paid-tier disclosure, is on the main page.
Nothing about this page expires. What does keep happening is the token bill, one session at a time, on whatever Cody is currently doing with mechanical work.