01 / 21 Title
←→ navigate Β· O overview Β· C core (12-min) Β· F fullscreen Β· G go to
A Talk on AI Cost Discipline

Token Economics

Better Results, Fewer Tokens.

Mir Mursalin Ankur & Arafat Hossain
Lead Software Engineer, Nerddevs β€” Now leading a team that ships more code through AI agents than by hand.
"Every AI coding session has a meter running. Most teams never look at it until the bill arrives."
02 Β· THE MOMENT MOST TEAMS NOTICE THE METER

The Bill Nobody Saw Coming

Bill reveal cartoon
A $200/mo plan β‰ˆ $14,000/mo of real compute β€” a ~70Γ— subsidy someone is paying.

Community estimates put a heavily-used $200/mo plan at $14,000–35,000/mo of real compute β€” estimates disagree 2Γ—, but the shape holds: sticker and consumption aren't in the same order of magnitude. Someone is paying the difference.

Forbes Β· Jul 2026

"AI Costs More Than The People It Replaced."

Uber reportedly burned its whole 2026 AI coding budget in 4 months.

Github Copilot, Reddit

One developer who went from ~$39 subscription to pay-as-you-go got bill of ~$47,000.

03 Β· THE HIDDEN METER

Every AI Session Has a Meter Running

The shift

From "is the answer right?" β†’ to "is the answer right, arrived at cheaply, on the first try?"

04 Β· THE REAL COST EQUATION

Cost β‰  Price Per Token

cost = (price per token) Γ— (tokens per task) Γ— (attempts) # Factor 1 is the vendor's. Factors 2 & 3 are yours β€” and where the real money moves.
1
Price / token
Advertised. Vendor-controlled.
2
Tokens / task
Your prompt, context, scaffolding.
3
Attempts
Retries, re-asks, re-derivation.
Factor 3 is bigger than it looks

Coding is the #1 use case for AI agents industry-wide, and "fixing errors" alone is ~10% of enterprise API traffic (Anthropic Economic Index). A meaningful slice of the industry's token spend is attempts β€” paying again for something that didn't work the first time.

05 Β· PART TWO β€” THE METHOD

Explore β†’ Plan β†’ Execute β†’ Verify

Ours, as files β€” skills/: spec Β· grill Β· plan Β· grill Β· implement Β· verify Β· pre-review Β· fix

plan: "Never skip planning for changes touching two or more files."
implement: "Never batch all changes then verify at the end."

Boris Cherny β€” the creator of Claude Code β€” starts most of his own sessions in Plan Mode. The people who built the tool don't trust it unplanned.

06 Β· THE ADVERSARIAL STEP

Grill: The Agent That Attacks Your Plan

Why a separate invocation

Asking the same session "is this plan good?" gets a yes β€” same model, same blind spots, looking at its own reasoning. That's not a review. That's a mirror.

The cheapest attempt-killer we've built: a rejected plan costs 5 minutes; a rejected implementation costs an afternoon and two reviews.

07 Β· THE MOST STEALABLE HABIT

The Cheapest Reviewer Is Your Own Diff

Feature works? Don't raise the PR yet β€” run the agent over your own diff first.

Review git diff main against our checklist.# reads only your changes, not the repo β€” edge cases, missed error paths, leftover debug logs
08 Β· TESTS

Tests: The Honesty Rules

Rule 1

Never let the agent write the tests and the implementation in the same session. An agent grading its own homework writes tests that certify its own bugs. Tests come first β€” from the spec, or a fresh session.

Rule 2

The loop exits on green, not on confidence β€” and feed the model failures only: the three tests that broke, not the four hundred that passed.

Bonus for every 15-year-old codebase: characterization tests on legacy code β€” pin down current behavior before touching it. Used to be a week nobody would approve; now it's an afternoon.

09 Β· THE CHEAP-TOKEN TRAP

Cheaper Per Token β‰  Cheaper Per Task

Per-token price says

Gemini 3.5 Flash $1.50/M vs 3.1 Pro ~$2.00/M β€” Flash looks like the win.

Per-task cost says

Flash: $1,552 vs Pro: ~$887 on the same benchmark β€” 75% more expensive. Cheap models burn more tokens per task.

And it's the whole field, not one vendor: $2.73 per task at the top (Claude Fable 5) down to cents for open-weight models β€” a spread of roughly two orders of magnitude, same benchmark, same month.

Cost per Intelligence Index task, Claude Fable 5 at $2.73 down to gpt-oss-20b at $0.02
Artificial Analysis, cost-per-task, Jul 3 2026.

The unit that matters is the completed task β€” in either direction: don't buy a Ferrari for the grocery run, don't buy per-token "savings" that triple the attempts.

10 Β· MODEL TIERING

Pay for Reasoning Only When Needed β€” Every Vendor Has a Ladder

ModelInputOutputUse for
Haiku 4.5$1/M$5/MLookups, file discovery
Sonnet 5$2β†’3/M$10β†’15/MDaily implementation
Opus 4.8$5/M$25/MArchitecture, hard debugging
Fable 5$10/M$50/MAbove Opus β€” hardest reasoning
GPT-5.6 Luna/Terra/Sol$1→2.5→5/M$6→15→30/MOpenAI's cheap→default→flagship
GLM-4.6 / MiniMax M2 / Kimi K2.6 open-weight$0.26–0.95/M$1–4/MCheap tier, self-hostable
Haiku 4.5 β€” the workhorse

~$0.13 spent per SWE-bench Pro point β€” cheapest correct-fix ratio of any current model.

Our rule Β· ~/.claude/rules/model-routing.md

Default to the mid tier. Escalate to flagship only when reasoning depth justifies 5–25Γ— the cost.

11 Β· BEYOND ONE VENDOR

Same Arithmetic, Different Tools

ToolAccessThe tradeoff
Claude Code / Codex CLIOne vendorPredictable, but capped on heavy days
OpenCode open-source75+ providers, switch mid-sessionOne UI, any vendor's pricing underneath
OpenRouter300+ models, one keyCross-vendor arbitrage; proxy hop for caching
Local (Ollama / LM Studio)Whatever fits your hardware$0/token, but not free β€” see the next slide

Pick the tool for the constraint that binds: data residency β†’ local Β· flexibility β†’ OpenRouter/OpenCode Β· out-of-the-box quality β†’ Claude Code/Codex.

12 Β· DEVICE COST

The Bill Isn't Only Tokens

13 Β· FEED LESS, NOT MORE

Bigger Window β‰  Better Recall

Accuracy drops as token count climbs β€” even well inside the limit. Context rot is real; the fix is a smaller haystack, not a bigger window.

14 Β· CACHING β€” THE 90% LEVER

The Single Biggest Zero-Quality-Loss Lever

The provider already computed your static prefix last call. Keep it warm β†’ reuse it at a fraction. Output is byte-identical; only the bill and latency change. ~90% off the cached input is the number all three majors converge on.

ProviderTTLWriteRead (Cache hit)
Claude5 min / 1 hr1.25Γ— (2.0Γ— / 1hr)0.10Γ— Β· 90% off
GPT-5.xup to 24 h1.0Γ—, no fee0.50Γ— Β· 50% off
Gemini 3.x60 min1.0Γ— + storage0.10Γ— Β· 90% off
Caching lever chart
15 Β· MEMORY COMPOUNDS

Reuse Beats Re-Derivation

One real session β€” this repo's own memory index.

23,909
Tokens β€” reading 50 indexed observations
485,629
Tokens β€” original work that produced them
95%
Fewer tokens β€” same starting knowledge
Same idea pointed backward

Mine your own chat logs and PR review comments for recurring corrections β€” same nit on three PRs is a pattern, not three nits. Encode it once in CLAUDE.md/rules; the model stops repeating the mistake, and "number of attempts" from Slide 4 stops multiplying.

The infra that makes it systematic

Skills (Claude Code, OpenCode's plugin system) package a repeatable workflow instead of re-explaining it every time. Memory plugins persist facts and decisions across sessions, so a new conversation starts with what a prior one learned instead of from zero.

Capture once. Read forever. Don't re-derive β€” forward or backward.

16 Β· MAKE THE METER VISIBLE

You Can't Cut What You Can't See

Every agent writes local logs, so tracking is always possible. Pick the tracker that reads your agent's logs.

AgentNativeLogsTracker (with the con)
Claude Code/cost, /context, SDKlocal filesccusage βœ… 5-hr-block view Β· ❌ Claude-centric
Codex CLIin-session totals (light)~/.codex/sessions/*.jsonltokscale βœ… cross-agent Β· ❌ newer
OpenCodeno tracking commandSQLite / JSONopencode-stats βœ… 365-day Β· ❌ OpenCode-only
All / enterpriseβ€”β€”Dynatrace / Portkey βœ… governance Β· ❌ overhead
The habit

Glance at usage before escalating to the flagship model Β· review the weekly report before fanning out 20 subagents Β· watch the 5-hour block on subscription tiers.

Every cut on the next slide came from this β€” Headroom cut once device load was measured; the idle graph MCP pruned once its context tax was measured.

17 Β· MY TOOLKIT β€” WHAT I RUN, WHAT I CUT

Marketing Shows the Pros. These Are the Cuts.

Three layers stack: output (write less) Β· input (read less) Β· routing (cheaper provider).

ToolLayerVerdict β€” with the con
Ponytailoutput / codeβœ… run β€” YAGNI ladder, shortest diff (6–20% lines, 23–53% cost)
cavemanoutput / proseβœ… run β€” ~75% fewer tokens; overlaps Ponytail by design
RTK (rtk-ai/rtk)input / shellβœ… run β€” Rust, <10ms, 60–90% off Bash output; Read/Grep bypass
Headroominput / files❌ cut β€” 60–95% off, byte-perfect, but ~600MB ML daemon = device-drag
OmniRouterouting❌ cut β€” 237-provider gateway β†’ quality drift + ToS-ban pattern
graphify / CRGindex⚠️ project-local only β€” behind resource guards; cut as global daemon
branchdiff minereviewβœ… run β€” pipes just the diff, nth-time awareness skips re-raised nits
The rule that decided most of it

Ban risk lives on the wire β€” a tool only risks a ban if it sits between you and the provider and mutates the payload. Rule-injection (Ponytail) = zero. Proxies (Headroom, OmniRoute) = real. That's why my stack has zero proxies.

18 Β· BEYOND THE BILL

Two Reasons This Isn't Only About Money

⚑ Energy & water

AI data centers alone: 945 TWh by 2030 β€” nearly triple Pakistan + Bangladesh + Nigeria's combined electricity use. Every wasted token is a real watt.

πŸ“‰ The subsidy is ending

OpenAI reportedly spends ~$2 per $1 earned on inference β€” nobody sustains that as a strategy, only a land grab. Anthropic and GitHub Copilot already moved to usage-based billing in 2026; prices rise 30–50% within 12–24 months.

"Won't tokens just get cheaper?" Cheaper shrinks factor 1, not factor 3 β€” a wrong implementation still costs two reviews. And cheaper never meant less: Jevons paradox.

19 Β· THE SUBSIDY ENDING, VISUALIZED

How Did We Get So Poor

Before AI, the funnel only grew: idea β†’ execute β†’ usage, small group to more at every stage. After AI, that funnel flips β€” everyone ideates, execution and real usage shrink.

How did we get so poor
The subsidy ending, visualized.
Before AI vs after AI: idea, execute, usage headcount by stage inverts
Idea β†’ execute β†’ usage, before and after.
20 Β· AI OUTPUT VS. OUTCOME AND IMPACT

Output β‰  Outcome β‰  Impact

AI's headline effect isn't better decisions β€” it's more Output (code, summaries, predictions, instantly). But Output, Outcome, and Impact are three different things, and AI only ever hands you the first one:

Ten AI-drafted PRs is Output, verifiable in seconds. Whether they cut defect rates is Outcome. Whether that's a calmer on-call rotation six months later is Impact. More Output doesn't automatically buy more Outcome, and more Outcome doesn't automatically buy more Impact β€” that gap is exactly where judgment lives.

21 Β· APPLY THIS WEEK

Checklist

All slides β€” click to jump