Undercut for Replit Agent

Replit Agent already reads a replit.md. Give it one that stops overpaying.

Undercut is a free, MIT-licensed routing policy you drop into your project's replit.md — the file Replit Agent automatically reads on every request — cheap tier first, escalate only on evidence, never on a vibe. Replit Agent 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.

Install for Replit Agent See the benchmarks
Works anywhere a routing policy can be read
Claude Code Codex Cursor Copilot OpenCode Gemini CLI Replit Agent

How this maps onto Replit Agent

replit.md is Replit's documented Agent-memory mechanism — a single file, not a skills directory.

Per Replit's own docs, Agent automatically creates a replit.md file in your project's root directory using its own best practices, and automatically reads it on every request to understand your project's architecture, conventions, and preferences. The docs are explicit that you can also hand-author or edit it yourself — "you can create your own by adding a file named replit.md to your project root" — so appending a routing policy to it is a documented, supported use of the file, not a workaround.

That's a real difference from most of the other clients on this site: Replit Agent has no separate Skills/rules-directory convention we could find in its current docs — no AGENTS.md discovery, no .replit/skills/ layout — just this one root-level markdown file the Agent reads as context. Undercut's policy fits the same way a shorter project brief would: appended as its own section at the end of replit.md.

Undercut's tier names — cheap, standard, frontier, apex — are generic on purpose. models.md gives the rule of thumb rather than a fixed slug for Replit specifically: Replit Agent's modes (Free, Power, Max) already pick from different underlying models per session, so cheap maps to the smallest/fastest path available in whichever mode you're running, standard to the default working behavior, frontier to the highest-reasoning path, and apex is reserved for the single batched tie-break call when the ladder is exhausted.

Nothing about this sits between Replit Agent and its model backend. It's plain markdown text Agent reads into context automatically, same as the rest of replit.md — no proxy, no network hop, nothing to route around if you remove the section.

Install for Replit Agent

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

Option 1 — append to replit.md (recommended, confirmed path)

Run this from your Repl's project root, in the Shell tab. Replit Agent reads replit.md at the project root automatically, so appending the policy text there is the most reliable way to get it in front of Agent.

$ curl -fsSL https://raw.githubusercontent.com/undercutsh/firstpass/main/skills/firstpass/SKILL.md >> replit.md

Already have a replit.md Agent generated for you? This appends to it rather than replacing it — your existing project context stays intact. Replit's own docs also note that very large replit.md files may not be fully processed, so if yours is already long, keep an eye on it after appending.

Option 2 — skills CLI (unverified target for Replit)

$ npx skills add undercutsh/firstpass

This is the same generic skills CLI referenced on the main site. It's built around writing a SKILL.md into a skills directory (.claude/skills/ by default, or another agent's convention via its -a flag) — and Replit Agent doesn't document reading any such directory. We have not independently confirmed it writes anywhere Replit Agent actually looks. Use Option 1 above, which is directly confirmed against Replit's own docs.

What's still unverified: Replit's docs don't mention any precedence rule for a case where replit.md conflicts with instructions given directly in an Agent conversation, and we haven't tested whether Agent's own periodic rewrites of replit.md (it updates the file "as it learns more about your project") ever prune an appended section. Check the file after a few sessions if you want to confirm the policy text is still there.

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. 3Ask Agent directly whether it sees the routing policy in replit.md before starting a mechanical task — a single Repl checkpoint is pennies

Zero lock-in. It's markdown text Agent reads — delete the section 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 (Replit Agent scores the flags itself — measured robust to getting them wrong, see above), Doesn't promise a dollar figure for your workload, and doesn't prove your number until you run it — every figure here is a reproducible observation from our tasks and graders, not a guarantee about yours. We haven't independently verified any native Skills/rules-directory discovery path for Replit Agent the way OpenCode or Devin document one; replit.md is the one mechanism Replit's own docs confirm, and this page treats everything else about Replit Agent's internals as unconfirmed. 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 Replit Agent is currently doing with mechanical work.

View on GitHub