tokentrim drops a few cost-optimized subagents into Claude Code. Search, reading, tests and trivial edits get routed to cheap Haiku — your expensive model only does the hard 10%. No /model dance, no new tool to learn.
"Find every call site of useAuth and read the 3 biggest."
grep + 3 full files land in your main context — all at frontier price.
trim-scout finds it, trim-reader digests — cheap, and your main context stays lean.
Illustrative of the mechanism, not a benchmark — real savings depend on your codebase and how Claude routes.
Each is pinned to the cheapest model that can do its job. Claude routes automatically — cheap by default, climbing only when the task earns it.
Find files, symbols, usages — returns paths only, never whole files.
Reads big or many files in its own context and hands back a tight digest.
Runs tests/build/lint and reports only pass/fail + the failing lines.
Trivial mechanical edits — rename, typo, import path, version bump.
Looks up a version, an API signature, or digests a docs page.
The workhorse — everyday features, tests, moderate refactors, diff reviews.
The hard 10% — architecture and subtle, cross-cutting bugs. Returns a plan.
The heavy hauler — huge long-horizon jobs that must stay coherent. Use sparingly.
Paste this into Claude Code · Cursor · Codex — or any AI agent — and it installs tokentrim for you.
# paste me into your AI agent ↓ Set up tokentrim for me — a pack of cost-optimized Claude Code subagents that route grunt work (search, reading, tests, trivial edits) to cheap Haiku so my expensive model only does the hard parts (github.com/ahkamboh/tokentrim). Do this: 1. git clone https://github.com/ahkamboh/tokentrim ~/tokentrim 2. Ask me: install to THIS project or globally? then run bash ~/tokentrim/install.sh --project (from my project root) OR bash ~/tokentrim/install.sh --global 3. Confirm .claude/agents/trim-*.md lists 8 agents.
Or do it yourself: git clone … && bash tokentrim/install.sh --project