Skill routing cuts agent input tokens

One agent, two ways to carry its instructions: a monolithic prompt inlining every skill on every turn, vs skill composition — a small index plus on-demand loading of only the skills each task needs. Same tasks, same conversation dynamics; only the instruction context differs. Source & harness on GitHub.

Total tokens the API re-reads across all agent turns of each task (context is re-sent every turn, so instruction weight compounds with turn count). Bars start at zero.
Monolithic prompt Skill-composed
Data table

The system prompt is 12× smaller with a skill index

What each condition carries on every single turn. The composed condition ships name + description per skill and loads full bodies only when a task needs them.

Success rate holds or improves under skill composition SIMULATED

These success rates come from a documented interference model (more co-resident unrelated instructions → more degradation), not live model runs. Run python -m benchmark.runner run with an API key to replace them with measured rates — this chart re-renders from whatever results/results.json contains.
Monolithic prompt Skill-composed

Methodology & reproduce

Setup. A library of 6 skills (PDF extraction, spreadsheets, API integration, SQL analytics, data viz, report writing — ~700 tokens each) and 10 agentic tasks that each genuinely require 1–3 of them, with an estimated agent-turn count per task.

Accounting. Per turn the API re-reads system prompt + task + accumulated history. Both conditions share identical conversation dynamics (); the skill-composed condition additionally pays a per-load tool-call overhead. Token counts are computed from the actual prompt files in the repo ().

git clone https://github.com/aabhimittal/Agentic-skill-composition-benchmark
cd Agentic-skill-composition-benchmark
python -m benchmark.runner measure            # deterministic token accounting
python -m benchmark.runner measure --exact    # exact counts via count_tokens API
python -m benchmark.runner run --trials 5     # live success-rate runs (needs ANTHROPIC_API_KEY)

Caveats. Savings grow with library size and shrink when a task needs most of the library. Prompt caching reduces the absolute cost of both conditions but not the cached-read and cache-invalidation asymmetry; success-rate deltas are the contested claim — measure them yourself with run mode.