More screenshots
Works with the AI Agents you already use
toknix — Cut the Tokens Your Coding Agent Wastes
A single test run can hand your agent 60 lines of PASSED before it reaches the one failure that matters.
$1
toknix — Cut the Tokens Your Coding Agent Wastes
Example session with this skill installed
My Claude Code sessions are getting expensive and a lot of it seems to be test output. Install toknix, run my test suite through it, and show me what it saves.
- Read your context and instructions
- Compiled the toknix
Summary
toknix is installed and active. On your test suite it cut the output the agent reads from
82 lines to 14 (−87% tokens), kept the one failing test in full, and kept the exit code. Restart Claude Code once so the hooks load in every new session.
1. Install
sh toknix/install.sh --from toknix
toknix doctor
toknix 0.3.1
hook bash installed
hook read installed
hook session-start installed
hook prompt installed
hook agent installed
statusLine toknix
rules v1 in ~/.claude/CLAUDE.md
Your original settings.json and CLAUDE.md were backed up to ~/.toknix/backups/.
2. Your test run, through toknix
toknix run -- "python -m pytest -v"
tests/test_cart.py::test_coupon_case_insensitive FAILED
=================================== FAILURES ===================================
_________________________ test_coupon_case_insensitive _________________________
def test_coupon_case_insensitive():
> assert total([(50, 2)], coupon='save10') == 90
E AssertionError: assert 100 == 90
E + where 100 = total([(50, 2)], coupon='save10')
tests/test_cart.py:188: AssertionError
=========================== short test summary info ============================
FAILED tests/test_cart.py::test_coupon_case_insensitive - AssertionError
========================= 1 failed, 61 passed in 0.05s =========================
[toknix: 82 → 14 lines; full output: toknix recall 94450e; exit 1]
The 61 PASSED lines and the session header were dropped. The failure, the summary and exit 1 reached me unchanged. If you need the full output: toknix recall 94450e.
The bug itself: total() compares the coupon with "SAVE10" case-sensitively, so save10 gets no discount. Fix: if coupon and coupon.upper() == "SAVE10":.
3. What it saved so far
toknix gain
| Filter | Runs | Saved |
|---|---|---|
generic (unittest -v) | 1 | 10.2k tokens |
gitlog (git log) | 1 | 9.0k tokens |
pytest (pytest -v) | 1 | 1.3k tokens |
passthrough (pip install) | 1 | 0 |
| Total | 20.5k tokens saved directly, ≈ 46k ETU with cache re-reads |
Next steps
- Restart Claude Code so the hooks apply to every Bash, Read and subagent call.
- Open
toknix uito see each cut side by side with the original. - After a few days, run
toknix waste --days 7for a list of what else costs you tokens, each with a fix. - Want proof that quality held? I can set up a
tasks.jsonand runtoknix bench+toknix compare(this runs a real agent, so it costs real tokens: I will tell you the run count first).
Connects securely to your tools. The creator never sees your data.
About this skill
Your coding agent reads a lot of noise. You pay for every line.
On 9 real command outputs, toknix cut 77% of the tokens without dropping a single error line. One command to install, and your own savings report to prove it.
A single test run can hand your agent 60 lines of PASSED before it reaches the one failure that matters. git log dumps 1,500 lines. A 900-line file gets read whole to find one function. Then all of it sits in the context and is re-read, as cache, on every request that follows.
toknix sits between your agent and that noise. It is a small CLI (Python ≥ 3.9, standard library only, zero dependencies) that this skill installs and teaches your agent to use.
What it does
| ✂️ | Cuts waste | Filters test, build, install and git output. Blocks reads of lock files, node_modules and huge files. Reads one function instead of the whole file. |
| 📏 | Measures it | toknix gain, report, waste and a live local dashboard show what was saved, in tokens and in dollars. |
| ✅ | Proves quality held | A/B runs of a real agent on your own tasks, with an ACCEPT / REJECT / INCONCLUSIVE verdict. |
The numbers
| Measured on real outputs | Result |
|---|---|
| Tokens across 9 real command outputs | 22,535 → 5,105 (−77%) |
| Error lines kept | 54 / 54, always |
git log (1,500 lines) | −96% |
pytest -v with 2 failures | −72% |
| Reading one function vs the whole file | −78% to −83% |
toknix refs on a 2,000-file repo | 0.19 s |
Short outputs (40 lines or fewer) pass through untouched. Your exit codes are preserved. Anything that was cut is one toknix recall <id> away, byte for byte.
Features
- Smart output filters for pytest, jest, go test, cargo, gradle, make, npm, pip, git, docker and more. Failures, summaries and exit codes stay; passing tests, progress bars and download logs go.
- Error lines are never cut, even when they alone exceed the budget.
- Read guard: stops whole reads of generated, vendored and lock files, files over 800 lines, and the third identical read of an unchanged file, and tells the agent how to read instead.
- Code by name:
outline,symbol,refs,mapfor Python, JS/TS, Go, Java, Rust, PHP, Ruby, Dart, Kotlin and C#. - Cheaper subagents: Explore tasks go to Haiku, routine reading and implementing to Sonnet; design, planning and debugging keep your model. Never routes up, never overrides a model you chose.
- Cost reports from your own transcripts: cost by model, cache hit rate, top sessions, and a
wastereport with a fix for each item.toknix contextshows what your CLAUDE.md, MCP servers and skills cost on every request. - Status line for Claude Code: context used, session cost, tokens saved.
- A/B bench:
toknix bench+toknix comparerun your tasks in throwaway git worktrees and give a statistical verdict (bootstrap 95% CI).
Safe by design
- 🔒 Nothing leaves your machine. All data lives in
~/.toknix/. - ↩️ Clean uninstall. Every file it edits is backed up first;
toknix uninstallrestores them byte for byte. - 📦 Zero dependencies, full source bundled in the skill (MIT). No download needed to install.
- 🧪 488 tests, CI on Linux, macOS and Windows.
- Hooks never block your agent: on any error they exit silently.
Install
Ask your agent: "Install toknix from the skill and check it with doctor." Or run it yourself:
sh toknix/install.sh --from toknix
# then restart Claude Code
toknix doctor
Works on macOS, Linux and Windows (Git Bash). Full hooks for Claude Code; Codex CLI and Gemini CLI get the rules block and the commands.
- Token counts in
toknix gainare estimates (about 4 characters per token for text).report,wasteandcontextuse the exact usage numbers from your transcripts. - Full hook integration is for Claude Code. Codex CLI and Gemini CLI have no hooks yet: they get the rules block and call
toknix run/toknix outlinethemselves. Gemini transcripts are not read. - A permission rule like
Bash(npm test:*)may not match the rewrittentoknix run -- 'npm test', so Claude Code can ask where it did not before. Add a rule for the wrapped form. - Code outline is exact for Python (ast) and regex-based for JS/TS, Go, Java, Rust, PHP, Ruby, Dart, Kotlin and C#; minified code can confuse it. Swift, C and C++ are not supported.
- Subagent routing guesses the task from its description and prompt (English and Vietnamese keywords); a task it cannot place keeps your main model. Turn it off with
"route_subagents": false. - Windows works through Git Bash and is tested in CI, but has seen less real-world use than macOS and Linux.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before any payment.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 9 days ago
Requires
Permissions
Allowed Hosts
File Scopes
Terminal: installs the toknix CLI and runs your test, build and git commands through `toknix run` to filter their output. Read files: outline/symbol/refs read source files by name; reports read Claude Code transcripts in ~/.claude/projects to compute costs. Write files: the installer adds hooks to ~/.claude/settings.json and a rules block to ~/.claude/CLAUDE.md (and ~/.codex/AGENTS.md / ~/.gemini/GEMINI.md if present), backing each file up to ~/.toknix/backups first; `toknix uninstall` restores them byte for byte. Network: only during the one-time install (pip/uv may fetch the setuptools build backend); toknix itself makes no network calls and nothing leaves your machine. Environment variables: optional TOKNIX_RAW, TOKNIX_DEBUG, TOKNIX_HOME. `toknix ui` serves a read-only page on 127.0.0.1 only.