cd /news/ai-agents/the-discovery-tax-why-coding-agents-… · home › topics › ai-agents › article
[ARTICLE · art-140110] src=blog.jarv.dev ↗ pub= topic=ai-agents verified=true sentiment=↑ positive

The Discovery Tax: Why Coding Agents Waste 2,500 Tokens Before Writing Code

A developer-built task runner called run ships with a built-in MCP server that cuts Claude Code's test-discovery overhead from roughly 6 tool calls and 2,500 tokens to 1 tool call and about 100 tokens, according to the tool's author. The author attributes the savings to replacing file-by-file discovery (README, Makefile, package.json) with a structured registry of tool names, typed parameters and defaults defined in a Runfile. The tool is installable via Homebrew, yay or cargo.

by read2 min views1 publishedSep 26, 2026

The Discovery Tax #

Every Claude Code session starts the same way. You say “run the tests.” The agent says “I’ll look for how to run tests in this project.”

Then it reads your README. Then your Makefile. Then your package.json. Then it tries make test. Wrong. npm test. Wrong project. It cat s the Makefile again, picks a different target, runs it with the wrong arguments. Eventually it gets there.

Six tool calls. 2,500 tokens of context. Gone — before any real work begins.

That’s the discovery tax. You pay it every session. The agent forgets everything and starts over. Every time.

What it actually costs #

It’s not just the wasted tokens. It’s the compound effect:

  • Context pressure. On long sessions you’re already fighting the context window. Burning 2,500 tokens on discovery means you hit compression sooner.
  • Confidence degradation. Each failed attempt leaves error messages in the context. The agent second-guesses itself. It starts hedging. “Let me try another approach…” You’ve seen this — the agent starts confidently, hits two errors, and suddenly every response begins with “I apologise for the confusion.”
  • Your time. You’re sitting there watching it fumble through files you could have pointed it at in seconds.

The refund #

What if the agent already knew your project’s tools before it started?

That’s what MCP is for. Instead of discovering tools by reading files, the agent gets a structured registry: tool names, descriptions, typed parameters, defaults. No reading. No guessing. No retries.

I built a task runner called run with a built-in MCP server. You define your tasks in a Runfile:

test(filter = "") {
    cargo test --workspace --no-fail-fast $filter
}

deploy(env) ./scripts/deploy.sh $env

Add it to your Claude Code config:

{
  "mcpServers": {
    "run": { "command": "run", "args": ["--serve-mcp"] }
  }
}

Now the same interaction looks like this:

You:    run the tests
Agent:  [tool] mcp:run test → success

One tool call. ~100 tokens. Same result next session.

The maths #

Without MCP With MCP
Tool calls to run tests ~6 1
Context consumed ~2,500 tokens ~100 tokens
Next session Starts from scratch Same registry
Reliability Varies by session Deterministic

Over a day of coding sessions, that’s thousands of tokens and dozens of tool calls you’re not wasting on rediscovery.

The discovery tax is zero.

For the full picture — auto-truncation, security sandboxing, the deterministic skills layer — see the deep dive.

brew install nihilok/tap/runtool
yay -S runtool
cargo install run
── more in #ai-agents 4 stories · sorted by recency
── more on @claude code 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/the-discovery-tax-wh…] indexed:0 read:2min 2026-09-26 · —