The playbook · updated Jul 2026
The Cost Engineering Playbook.
The patterns behind a low AI bill, in one place — copy them, adapt them, keep the savings. They come in two layers: floor patterns that stop you overpaying, and one ceiling discipline that decides where the savings even matter.
These are illustrative — and that’s the point
Every block below is a starting shape, not a drop-in you run blind. The value was never the snippet — it’s knowing which of yourworkflows each one fits, and wiring it without breaking anything. Take them freely; if you’d rather we fit them to your stack, that’s the service. We profit from your clarity, not your confusion.
New here? Read the three pieces this playbook distills: Model Routing, Compiled AI, and the capstone Cheap Execution Is the Floor.
1 · Plan with the best, delegate execution to the cheap
When: any multi-step build. Plan/spec on a frontier model; hand the finished spec to a good cheap coder. Banks the majority of the savings (~68% on a feature).
A tiny “routing skill” that encodes the split — the frontier agent writes the spec, then shells out to a cheaper CLI to execute it:
# skill: plan-then-delegate
# 1. PLAN on the frontier model (this session). Produce a written spec.
# - which files are touched, the architecture, the acceptance checks
# 2. DELEGATE execution to a cheaper coder via its CLI:
codex exec --model gpt-5.5 --effort medium "$(cat spec.md)
Build exactly this spec. Do not redesign. Return a diff."
# 3. REVIEW the diff back on the frontier model (optional, cheap):
# "Review this PR against the spec. Only flag real issues."
# 4. Frontier plans + reviews (few output tokens = cheap);
# cheap model writes the code (many output tokens = wholesale price).2 · Route by task, not by default
When: every request. Stop sending easy work to the frontier. Map task → tier once; let the map decide.
A plain task→model table your harness (or a wrapper) reads. Adjust the names to your providers:
const ROUTE = {
// planning / architecture / hard judgment → frontier
plan: "frontier", // e.g. Opus 4.8 / Fable
review: "frontier",
// bulk execution → good-but-cheap
code: "cheap-coder", // e.g. Sonnet / GPT-5.5 / Composer / GLM
refactor: "cheap-coder",
// routine knowledge work → fast + cheapest
extract: "fast-cheap", // e.g. Haiku
summarize: "fast-cheap",
classify: "fast-cheap",
deploy: "fast-cheap",
};
// Rule of thumb: does this task DECIDE something, or EXECUTE something?
// Decide → frontier. Execute → cheap. When unsure, start cheap and escalate.3 · Route by task — but stay put inside a session
When: long, cached conversations. Swapping models mid-session throws away the prompt cache and can cost MORE (up to ~5×). Pick at the start; don't thrash.
The discipline, not a config — the one caveat that trips people who over-apply routing:
# DO: choose the right model when a TASK starts, then finish on it.
# DON'T: switch models turn-by-turn inside one cached session.
#
# new task ─▶ pick tier ─▶ [stay on it: cache stays warm] ─▶ done
# next task ─▶ pick tier again
#
# Why: a warm prompt cache is often 10× cheaper per input token.
# Mid-session model-hopping re-pays full price for the whole context.
# (See: /learn/cache-aware-routing)4 · Turn the effort dial down on easy tasks
When: simple, mechanical steps. Most harnesses default reasoning to 'high'. 'Deploy this' does not need max thinking — the dial is free money.
# effort/thinking is a SEPARATE lever from model choice.
plan / debug hard bug → effort: high (worth every token)
write code from a spec → effort: medium
deploy / rename / lint → effort: low (default 'high' is waste here)
# same model, lower effort = fewer thinking tokens = lower bill.
# don't pay for deliberation the task doesn't need.5 · Compile the repeats — reason once, run forever
When: a task repeats and is stable (status reports, ticket creation, routine extraction). Don't pay a model to re-derive the same procedure every run.
A decision gate before you point an agent at anything recurring:
function shouldCompile(task) {
// Repeating + stable → compile it to deterministic automation.
// the model reasons ONCE; the script runs forever; only the
// small changing part (a summary) still spends tokens.
if (task.repeats && task.stable) return "COMPILE → script/tool";
// Novel or genuinely fuzzy → keep the agent. That's what it's for.
return "KEEP AGENT (one-off judgment)";
}
// The token bill is a symptom; re-reasoning is the disease.
// (See: /learn/compiled-ai)6 · Spend the frontier where it multiplies
When: you've done all of the above. The floor is now table stakes. The leverage moves to WHICH questions you point the frontier at.
Not a snippet — a weekly habit. Budget scouting hours the way you budget spend:
# the honest audit, run on yourself weekly:
# 1. Has my task list CHANGED in the last 3 months —
# or am I running the old list cheaper and calling it transformation?
# 2. What could the newest model do that I could never even ASK before?
# (you can't imagine with capabilities you haven't touched)
# 3. Who on the team may pose a $40 question to a model WITHOUT asking?
# if 'nobody' → that's the constraint, not the price.
#
# Floor = cut the bill. Ceiling = point the frontier at the $40 question.
# (See: /learn/execution-floor)Scruuge’s TLDR
Do all five floor patterns aggressively — then remember they’re table stakes. Your 10× isn’t a cheaper token; it’s the question no competitor thought to ask.
Take the playbook — or have us wire it.
Everything above is yours. If you’d rather we find which of your workflows each pattern fits, wire the routing, and compile the repeats without breaking anything, that’s the work. Start free — the calculator shows where you’re overpaying in two minutes; the $999 Assessment maps both layers end-to-end.