Undercut for Windsurf

Cascade already reads a root AGENTS.md. Give it one that stops overpaying.

Undercut is a free, MIT-licensed routing policy delivered through AGENTS.md, which Windsurf's Cascade agent reads automatically with zero configuration — cheap tier first, escalate only on evidence, never on a vibe. Windsurf was acquired by Cognition; its docs and product now live under the Devin Desktop umbrella, and its own rules path (.windsurf/rules/) works too. See Install below for exactly what's confirmed and what isn't.

Install for Windsurf See the benchmarks
Works anywhere a routing policy can be read
Claude Code Codex Cursor Copilot OpenCode Windsurf

How this maps onto Windsurf

A multi-model IDE. AGENTS.md is the confirmed way in.

Windsurf was acquired by Cognition, and its documentation now lives under docs.devin.ai, branded as part of Devin Desktop — docs.windsurf.com redirects there. Per that documentation, Windsurf's Cascade agent now prefers workspace rules from .devin/rules/*.md, with .windsurf/rules/*.md and the legacy single-file .windsurfrules kept as fallbacks for backward compatibility. Global rules live at ~/.codeium/windsurf/memories/global_rules.md (capped at 6,000 characters; workspace rules files cap at 12,000). Separately, Cascade also reads a root-level AGENTS.md automatically — documented as location-scoped rules with zero configuration required, which is the most portable of the confirmed paths and doesn't depend on which of the rules-file conventions your workspace already uses.

Windsurf doesn't have a model family of its own the way Claude Code or Codex do — it's a multi-model IDE, wired up to whichever provider(s) you've configured in Cascade's model picker. Undercut's tier names — cheap, standard, frontier, apex — are generic on purpose for exactly this case. models.md gives the rule of thumb rather than a fixed mapping: cheap resolves to the smallest/fastest model you have access to in Cascade, standard to your default work model, frontier to the highest-reasoning model on offer, and apex to a single batched tie-break call on the strongest model available.

Nothing about this sits between Cascade and its model backend. It's a Markdown file Cascade reads at dispatch time — no proxy, no network hop, nothing to route around if you delete the block.

Install for Windsurf

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

Option 1 — append to AGENTS.md (most portable, confirmed path)

Cascade reads a root-level AGENTS.md automatically, with no rules-file setup required — this is the path we're most confident about, and it doesn't depend on which of Windsurf's own rules conventions your workspace uses.

$ echo "" >> AGENTS.md && curl -fsSL https://raw.githubusercontent.com/undercutsh/firstpass/main/skills/firstpass/SKILL.md >> AGENTS.md

Option 2 — Windsurf's own workspace rules

If you'd rather keep it inside Windsurf's own convention, drop it under .devin/rules/ — the preferred path per current docs since the Devin Desktop rebrand — or the legacy fallback location, .windsurf/rules/. Both are confirmed in Windsurf's documentation.

$ mkdir -p .devin/rules && curl -fsSL https://raw.githubusercontent.com/undercutsh/firstpass/main/skills/firstpass/SKILL.md -o .devin/rules/firstpass.md

Want it applied to every workspace instead of one repo? Copy the same content into ~/.codeium/windsurf/memories/global_rules.md — note that file caps out at 6,000 characters (workspace rules files cap at 12,000), so check the raw SKILL.md fits before relying on the global copy.

Update: Cascade has its own Agent Skills path, confirmed. Per Cascade's own skills docs, Windsurf does not share Devin CLI's .devin/skills/ path — it discovers skills from .windsurf/skills/<name>/ (workspace) and ~/.codeium/windsurf/skills/<name>/ (global), plus the cross-agent .agents/skills/ convention. That means cp -r firstpass/skills/firstpass ./.windsurf/skills/firstpass is now a confirmed, direct install path too — AGENTS.md (Option 1) remains the most portable if you're already using it across other tools.

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. 3Open Cascade on a small task with the policy installed and confirm in the model picker/response which tier it actually dispatched to

Zero lock-in. It's Markdown text Cascade reads — delete the file or the block 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 — and on Windsurf specifically, Cascade has its own confirmed skill-discovery path (.windsurf/skills/, distinct from Devin CLI's .devin/skills/ — see Install above), but that's a documented path, not a session we ran ourselves, so treat the live behavior as unverified until tested. Cascade's own reliability at scoring the flags hasn't been separately measured the way Claude Code's has (see above); treat that as unverified until tested. And it doesn't promise a dollar figure for your workload. Full list of general limits, 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 Cascade is currently doing with mechanical work.

View on GitHub