Spend tokens where they matter. An agent skill that routes every coding task to the most token-efficient tool for the layer it stresses — instead of reflexively reading whole files, dumping raw command output into context, or writing more code than asked.
Token cost has four independent layers, and a different tool owns each. token-saviour picks one winner per layer — the best measured combination from a 9-tool benchmark on a realistic Python codebase:
| Layer | Tool | Measured |
|---|---|---|
| Code-read input (symbols, callers, call paths, architecture) | ||
−66% alone — the dominant costinput(tests, builds, git, grep, listings)rtk** prose output**(chatty replies, write-ups)caveman** code output**(implementations you write)PonytailStacked (serena + rtk + caveman): −69.6% total tokens on the comprehension suite. For code-generation work, swap caveman → Ponytail (≈ −64%).
The picks were re-validated (2026-07) against newer entrants — archex, Pare, lazy-cat — and every
incumbent held its layer. The runner-ups, the niches where they flip (e.g. Pare's structured
pytest
for test-dominated loops), and the full evidence live in skills/token-saviour/references/.
/plugin marketplace add vagkaratzas/token-saviour
/plugin install token-saviour@token-saviour
Or as a plain personal skill, no plugin system involved:
git clone https://github.com/vagkaratzas/token-saviour
mkdir -p ~/.claude/skills
cp -r token-saviour/skills/token-saviour ~/.claude/skills/
codex plugin marketplace add vagkaratzas/token-saviour
codex plugin add token-saviour@token-saviour
In Codex the skill is invoked with @token-saviour
. The VS Code Codex extension and the Codex
app read AGENTS.md
, which this repo ships — so it also works from the repo root with no
setup, and cp AGENTS.md ~/.codex/AGENTS.md
makes the always-on rules global.
Copy AGENTS.md
(compact, always-on ruleset) or skills/token-saviour/SKILL.md
(full playbook) into whatever instruction file your agent reads.
Classifies the task by the layer it stresses: reading code, reading command output, writing prose, or writing code.Routes to that layer's tool with concrete commands (serena MCP calls,rtk
proxies, caveman terse mode, Ponytail rules) — and degrades gracefully to plain Read/Grep/Bash when a tool isn't installed (install/verify commands in).references/tool_links.md
Refuses anti-patterns: two code-read tools at once, rtk for comprehension, caveman on code, Ponytail on prose, tooling-up trivial one-line lookups.Announces what it used:🪙 token-saviour: serena + rtk + caveman
.
serena—uv tool install -p 3.13 serena-agent
— the one code-read tool (LSP symbols; also does semantic edits/renames).rtk—brew install rtk
orcargo install --git https://github.com/rtk-ai/rtk
— add only for noisy command loops.caveman— seerepo— add only when prose brevity is the bottleneck.** Ponytail**—/plugin marketplace add DietrichGebert/ponytail
— add only when code-generation work is the bottleneck.
All numbers come from token-consumption-benchmark:
real tools, real artifacts, one tokenizer (tiktoken o200k_base
), per-task tables, and honest limitations (modeled-not-metered, small clean codebase, single run). Summary: references/benchmark_results.md.
MIT — see LICENSE.