Undercut for JetBrains AI Assistant
Undercut is a free, MIT-licensed policy file JetBrains AI Assistant's Junie agent follows at dispatch time — cheap tier first, escalate only on evidence, never on a vibe. One self-reported ccusage-style breakdown of default routing behavior in a different agent showed 93.8% of tokens going to the top-tier model by default (anthropics/claude-code#27665) — one account's data, from Claude Code rather than Junie, but the pattern of defaulting to the priciest tier for mechanical work is the reason this exists.
How this maps onto JetBrains AI Assistant
Junie, the agentic coding assistant inside JetBrains AI Assistant, documents support for Agent Skills with three confirmed discovery paths: project-level <projectRoot>/.junie/skills/<name>/, user-level ~/.junie/skills/<name>/ (%USERPROFILE%\.junie\skills\<name>\ on Windows), and the cross-agent .agents/skills/ convention shared with several other tools. Project-level wins on a name collision. That's a direct fit for something already shipped as a SKILL.md — no translation needed.
If no skill applies to a given task, Junie falls back to plain guidelines in .junie/guidelines.md or a root AGENTS.md — but a scored, versioned rubric is exactly what Agent Skills exist for, so the skill install below is the reliable path, not the fallback.
Undercut's tier names — cheap, standard, frontier, apex — are generic on purpose. JetBrains AI Assistant is multi-model, not a single vendor's own models — the plan and IDE decide which providers are on offer. models.md gives the rule of thumb rather than a fixed mapping for Junie specifically: cheap resolves to the smallest/fastest model available in your model picker, standard to your default work model, frontier to the highest-reasoning model on offer, and apex to a single tie-break call on the strongest model available. Nothing here sits between Junie and its model backend — it's a policy file the agent reads at dispatch time, same as any other skill, no proxy, no network hop.
Install for JetBrains AI Assistant
Junie's own docs confirm project-scoped discovery at .junie/skills/<name>/. Undercut's skill is already named firstpass, so the directory copies straight across — no renaming, no rewriting frontmatter — and it takes priority over a user-level or cross-agent copy if there's ever a name collision.
Junie's docs also list .agents/skills/ as a recognized discovery path — the same convention several other agents in this compatibility bar read. If a repo already carries a skill installed that way for another tool, Junie should pick it up with nothing extra to install.
Working across machines? Junie also reads a user-level skills directory — ~/.junie/skills/<name>/ on macOS/Linux, %USERPROFILE%\.junie\skills\<name>\ on Windows — for a skill you want available in every project without installing it per-repo. If no skill applies to the task at hand, Junie falls back to plain guidelines in .junie/guidelines.md or a root AGENTS.md, but the rubric is written as a skill, not guideline prose, so install it as a skill first.
testing/README.md and the raw JSON in testing/results/node src/main.js --mockZero lock-in. It's a policy Junie reads — remove the skill 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 (Junie scores the flags itself — measured robust to getting them wrong, see above), and doesn't promise a dollar figure for your workload. The Agent Skills discovery paths above come from JetBrains' own docs, researched fresh rather than run end-to-end by us — if you hit a mismatch, see the note in the PR. 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 Junie is currently doing with mechanical work.