Modern QA2026Token Budget Analysis: Real Numbers
Log inJoin

Course01 Agent Skills for Browser Automation⊞ Tile viewNew!

Cutting-edge · Chapter 01

Token Budget Analysis: Real Numbers

Updated Aug 2026

Context Windows (July 2026)

As of July 2026 the frontier models — Claude Opus 4.8, OpenAI GPT-5.5, Google Gemini 3.1 Pro — ship context windows ranging from the 200K-token class up to 1M+. For the worked examples below we assume a 200K window with ~150K effectively usable after system prompts, tool definitions, and conversation overhead. The exact window matters less than the ratio: what fraction of it does browser state eat?

The Headline Number First

Microsoft's published benchmark for a typical browser automation task:

Transport Tokens per task
Playwright MCP ~114,000
Playwright CLI ~27,000
Savings ~4x (up to ~10x reported on long sessions)

The rest of this chapter explains where those tokens go — because in an architecture interview, quoting a benchmark is table stakes; explaining the mechanism is what gets you hired.

MCP Token Breakdown: A Real Playwright Session

Tool Schema Cost (Per API Call)

An MCP server exposes 15-25 browser tools, each with a JSON schema (~150-280 tokens apiece). Total: roughly 3,000-4,000 tokens of schemas loaded into EVERY API request, even on turns where the agent isn't doing browser work.

Accessibility Tree Cost (Per Page Read)

A typical web page accessibility snapshot, streamed inline with actions:

Page Complexity Elements A11y Tree Tokens
Simple (landing page) 20-50 ~500-1,500
Medium (form page) 50-200 ~1,500-5,000
Complex (dashboard) 200-500 ~5,000-15,000
Data-heavy (table) 500-2000 ~15,000-50,000+

A Realistic 20-Step Login Test via MCP

Step 1:  browser_navigate           → 200 tokens (call) + 100 (response)
Step 2:  [a11y tree streamed]       → 3,000 tokens (login form)
Step 3:  browser_type (email)       → 180 tokens + 80
Step 4:  browser_type (password)    → 180 tokens + 80
Step 5:  browser_click (submit)     → 160 tokens + 80
Step 6:  [a11y tree streamed]       → 5,000 tokens (dashboard)
Step 7:  browser_get_text (heading) → 150 tokens + 80
Step 8:  browser_screenshot         → 150 tokens + inline image data
Step 9:  browser_navigate (profile) → 200 tokens + 100
Step 10: [a11y tree streamed]       → 4,000 tokens (profile page)
...     (edit form, save, verify — three more tree streams)
Step 20: browser_close              → 120 tokens + 60

Tool schemas (loaded every turn):    ~3,400 × 20 = ~68,000 tokens
A11y trees (streamed, no opt-out):   ~20,000 tokens
Tool calls + responses:              ~4,000 tokens
────────────────────────────────────────────────────
TOTAL:                               ~92,000 tokens

Our estimate lands in the same order as Microsoft's measured ~114k per task (their benchmark includes agent reasoning turns as well). Either way: more than half of usable context gone on a simple login test.

Skill Token Breakdown: The Same Test via the Playwright CLI

Skill Loading Cost (Once)

Component Tokens
SKILL.md injection (from playwright-cli install --skills) ~1,000, once
Skill description in tool list ~50 per turn

The Same 20-Step Login Test via CLI

Step 0:  SKILL.md loaded                              → ~1,000 tokens (once)

Step 1:  Bash("playwright-cli open $URL")             → ~60 tokens
Step 2:  Bash("playwright-cli snapshot")              → ~40 (returns a file path)
Step 3:  Agent reads login-form snapshot YAML         → ~1,500 tokens (small page)
Step 4:  Bash("playwright-cli fill e3 'user@t.com'")  → ~60
Step 5:  Bash("playwright-cli fill e4 '********'")    → ~60
Step 6:  Bash("playwright-cli click e5")              → ~55
Step 7:  Bash("playwright-cli snapshot")              → ~40
Step 8:  Agent reads dashboard snapshot YAML          → ~4,000 tokens (bigger page)
Step 9:  Bash("playwright-cli goto $URL/profile")     → ~60
Step 10: Bash("playwright-cli click e12")             → ~55   (ref from snapshot)
Step 11: Bash("playwright-cli fill e14 '555-0100'")   → ~60
Step 12: Bash("playwright-cli click e15")             → ~55
Step 13: Bash("playwright-cli snapshot")              → ~40
Step 14: Agent reads confirmation snapshot YAML       → ~2,000 tokens
Step 15: Bash("playwright-cli screenshot")            → ~50   (returns a file path,
                                                               image NOT loaded)
Steps 16-20: verification + close                     → ~300

Skill description (per turn): 50 × 20 =                ~1,000 tokens
Skill initial load:                                    ~1,000 tokens
Commands + responses:                                  ~1,000 tokens
Snapshot reads (3 of them, on demand):                 ~7,500 tokens
────────────────────────────────────────────────────
TOTAL (browser-specific):                              ~10,500 tokens

Note what the agent did not pay for: seventeen of the twenty steps returned a ref confirmation or a file path costing dozens of tokens. The agent read page state exactly three times — when it actually needed refs or verification — instead of having eight accessibility trees streamed at it whether it wanted them or not.

The Honest Caveat

Per-step arithmetic like the above can suggest ratios of 20-30x or more, and early CLI-skill advocacy (this course's own earlier editions included) leaned on such estimates. Resist the temptation. In real end-to-end tasks the CLI agent still reads snapshots on demand, still reasons in tokens, and still occasionally loads a screenshot — which is why Microsoft's measured full-task numbers come out at ~4x (27k vs 114k), stretching toward ~10x on long sessions where MCP's per-turn schema tax compounds. Quote the measured number; explain the mechanism; don't inflate.

Side-by-Side Summary

Metric MCP CLI Skill Difference
Typical task (measured) ~114,000 tokens ~27,000 tokens ~4x cheaper
Share of a 200K window ~57% ~13% far more headroom
Who controls what enters context The protocol The agent the actual win
Cost at $15/M input tokens ~$1.71/task ~$0.41/task ~4x cheaper
Long sessions schema tax compounds every turn flat per-command cost up to ~10x

What You Do with the Saved Context

The ~87K tokens saved on a typical task can hold:

Content Approximate Tokens What It Enables
10 source files (~200 lines each) ~30,000 Agent reads and modifies code
Full test suite definition ~10,000 Agent understands all tests
Error analysis + debugging ~20,000 Agent reasons about failures
Conversation history ~25,000 Agent remembers earlier context
Total additional capacity ~85,000 A richer, more capable agent

This is why Microsoft's positioning targets coding agents specifically: an agent that only drives a browser can afford MCP; an agent that drives a browser while reading your codebase, writing tests, and reasoning about failures cannot.

When Token Cost Doesn't Matter

If you're on a 1M+ context window (Gemini 3.1 Pro class), the context-exhaustion argument is much weaker. You can afford MCP's overhead and still have plenty of room.

However:

  • API cost still matters (you pay per token — 4x is 4x on the invoice)
  • Latency scales with tokens (more tokens = slower responses)
  • Quality can degrade with very long contexts (attention dilution)

And one trade-off cuts the other way: reading snapshots from disk adds round-trips, so CLI sessions can be slower in wall-clock time than MCP streaming even while being far cheaper in tokens. Token efficiency and latency are different axes — name both in an interview.

Interview Talking Point

"I anchor the skills-vs-MCP token argument to Microsoft's own benchmark: about 114,000 tokens for a typical browser task through Playwright MCP versus about 27,000 through the Playwright CLI — a 4x reduction, up to 10x on long sessions. The mechanism is that MCP loads tool schemas every turn and streams accessibility trees inline with every action, while the CLI writes YAML snapshots to disk and the agent reads them only on demand. I'm careful not to oversell it — the CLI agent still pays for the snapshots it reads, which is why the honest number is 4x rather than the 30x you'd get from naive per-step arithmetic. At $15 per million input tokens that's roughly $1.71 versus $0.41 per test task, and across hundreds of CI runs a day that compounds into a real budget line."