HeadlinesBriefing favicon HeadlinesBriefing.com

Measuring Code Mode: 26 Calls to One Script, $0.02

Hacker News •
×

Anthropic published on code execution with MCP showing a 98.7% token reduction. Cloudflare shipped "Code Mode" with similar results: 2,500+ API endpoints, 1.17M tokens down to ~1,000. Our swarm already uses a rubric (system.agent.context_mode) telling agents to use scripts for 10+ items or bulk fan-out.

We measured this using workflow-triage script that scans all automations — 24 workflows, 60 schedules — making 26 tool calls internally but returning only one summary object to the agent. Measured results: script uses 1 call, 25,811 characters (~6,450 tokens), 13.12s, $0.02. Raw sequential calls would be 26 calls, ~3.26M characters (~815,000 tokens), 2–6.5 min, $2.44 floor — a ~126x reduction, 99.2% fewer characters reaching context.

Methodology: script numbers 100% measured. Raw path extrapolated from sampled runs (312 runs across 4 workflows averaging 3,447 chars/run) applied to 920 total runs. Didn't run all 26 raw calls to avoid polluting context. Note: API limit:25 doesn't cap results (returned 227 runs), making raw estimate a floor. Real agentic loop would cost more as each result stays in context.

The full script (id da3b5c7b-b9a6-4f9e-be9e-f682aca48ea0) reads workflows/schedules, computes stats, flags DEAD/FAILING/OK, returns markdown report. Uses concurrency pool of 6.