Modern QA2026Token Economics: Why Skills Win on Cost
Log inJoin

Course01 Agent Skills for Browser Automation⊞ Tile viewNew!

Cutting-edge · Chapter 01

Token Economics: Why Skills Win on Cost

Updated Aug 2026

The Context Window is a Shared Resource

Every token in the context window competes for the same limited space. A coding agent typically needs context for:

Consumer Typical Tokens Priority
System prompt 2,000-5,000 Fixed
Conversation history 10,000-50,000 Grows
File contents (code being edited) 5,000-30,000 Essential
Tool definitions (MCP, built-in) 2,000-15,000 Fixed per tool
Agent reasoning 5,000-20,000 Essential
Total budget ~200,000

When you add browser automation, you're competing with code editing, test analysis, and reasoning for that same budget.

MCP Token Cost: The Tool Schema Tax

Every MCP tool exposes a JSON schema that's loaded into every API request:

{
  "name": "browser_click",
  "description": "Click an element on the page",
  "inputSchema": {
    "type": "object",
    "properties": {
      "selector": {
        "type": "string",
        "description": "CSS selector for the element to click"
      },
      "timeout": {
        "type": "number",
        "description": "Maximum wait time in milliseconds",
        "default": 30000
      },
      "force": {
        "type": "boolean",
        "description": "Force click even if element is not actionable",
        "default": false
      }
    },
    "required": ["selector"]
  }
}

A typical Playwright MCP server exposes 15-25 tools. Each tool definition costs 200-500 tokens. That's 3,000-12,500 tokens just for the tool schemas — loaded on EVERY API call.

Plus, MCP responses often include accessibility trees (structured DOM representations):

[role="main"] Main Content
  [role="navigation"] Nav
    [role="link"] "Home" [ref=1]
    [role="link"] "About" [ref=2]
  [role="heading"] "Welcome" [ref=3]
  [role="textbox"] "Search..." [ref=4]
  [role="button"] "Submit" [ref=5]
  ... (hundreds of elements)

A single accessibility snapshot can cost 2,000-10,000 tokens depending on page complexity.

MCP Total Cost Per Turn

Tool schemas:          ~5,000 tokens  (fixed, every turn)
Accessibility tree:    ~5,000 tokens  (per page interaction)
Tool call/response:    ~200 tokens    (per command)
─────────────────────────────────────
Total per interaction: ~10,200 tokens

Over a 20-step test:

20 steps × 10,200 tokens = ~204,000 tokens (may exceed context window!)

Skill Token Cost: The Markdown Injection

A browser-automation SKILL.md (Playwright CLI's generated skill, or Vibium's vibe-check before it) is ~100 lines, which translates to roughly 800-1,200 tokens — loaded once when the skill is invoked, then persists in context.

Skill Total Cost Per Turn

SKILL.md injection:    ~1,000 tokens  (once, not every turn)
Skill description:     ~50 tokens     (in tool listing, every turn)
Bash command:          ~30 tokens     (per command)
Command output:        ~100 tokens    (per command, just text)
─────────────────────────────────────
Total per interaction: ~130 tokens    (after initial injection)

Over a 20-step test:

Initial:    ~1,050 tokens
20 steps:   20 × 130 = ~2,600 tokens
Total:      ~3,650 tokens

Side-by-Side Comparison

Metric MCP (Playwright) CLI skill Ratio
Fixed overhead per turn ~5,000 tokens ~50 tokens ~100x cheaper
Per interaction (naive arithmetic) ~10,200 tokens ~130 tokens ~78x cheaper
Real measured task (Microsoft benchmark) ~114,000 tokens ~27,000 tokens ~4x cheaper

Note the gap between the naive per-step arithmetic and the measured end-to-end number, because it's an architect-level insight: in a real task the CLI agent still reads snapshots from disk when it needs them — the savings come from reading state on demand instead of receiving it on every action. The mechanism is "the agent decides what enters context," not "state never enters context." Measured savings: ~4x per task (Microsoft's own benchmark, ~27k vs ~114k tokens), with longer sessions reporting up to 10x — still the difference between finishing a test session with room to reason and compacting context halfway through.

Why This Matters for Test Automation

A typical test automation session involves:

  • Reading test specifications
  • Writing test code
  • Running browser interactions
  • Analyzing results
  • Debugging failures
  • Generating reports

If browser interactions consume 50-100% of your context budget (MCP approach), the agent can't effectively do the other tasks. It starts "forgetting" earlier parts of the conversation as the context compresses.

With the skill approach, browser interactions consume ~2% of the context budget, leaving the agent free to:

  • Hold an entire test suite in context
  • Reason about multi-page flows
  • Compare expected vs actual results with full detail
  • Maintain conversation history across long sessions

Microsoft Settled the Argument

In early 2026 Microsoft shipped @playwright/cli — a CLI purpose-built for coding agents, with a --skills flag that generates a SKILL.md — and began recommending it over their own MCP server for coding-agent workflows, citing the 4x token reduction (27k vs ~114k per task). Snapshots and screenshots go to disk; the agent reads them on demand.

This isn't a third-party opinion — it's the team that builds the world's most popular browser-automation MCP server concluding that, for coding agents, the CLI-skill transport wins.

When MCP Token Cost Is Justified

MCP's higher token cost buys you:

  1. Structured page understanding — The accessibility tree gives the agent semantic knowledge about what's on the page (role, labels, relationships)
  2. Iterative exploration — The agent can repeatedly query page structure to find elements
  3. Rich error context — MCP returns structured errors with element state information
  4. Session continuity — MCP maintains browser session state on the server side

For exploratory testing where you don't know what you're looking for, this is valuable. For scripted test automation where you know the selectors and flow, it's waste.

Interview Talking Point

"When we evaluated browser automation approaches, token economics was the deciding factor. Our test sessions run dozens of browser commands alongside code analysis and test writing — with MCP streaming full page state into context on every action, that budget disappears fast. With the CLI-skill approach, page state lands on disk and the agent reads it only when it needs it. Microsoft's own benchmark puts the difference at about 4x per task — 27k versus 114k tokens — and they now recommend the CLI over their own MCP server for coding agents. The important nuance: the savings come from reading state on demand, not from never seeing state."