Every token you send to an LLM costs money. And a shocking amount of what we send is waste.
License headers. Debug print statements. Duplicate imports. Trailing whitespace. Editor directives like # noqa and // @ts-nocheck. Blank line after blank line after blank line.
None of it helps the model understand your code. All of it burns context and budget.
So we built compact -- a new tool for the WasmBox sandboxed tool registry that strips token waste from code while keeping every comment, every docstring, and every line of actual logic intact.
The results on real codebases:
- A typical Python module: 148 lines -> 108 lines. 33% fewer tokens.
- A Go auth package (3 files): 30% savings per file.
- A TypeScript model layer: 24% savings.
- Across a mixed codebase: 28% average reduction.
What does 28% actually mean?
At scale, with an agent loading a 500-file codebase into Claude Sonnet at $3/M input tokens:
$0.42 saved per load
$42/day for an agent doing 100 loads
$1,260/month -- just from stripping waste
And it's not only about cost. Context windows are finite. At 128K tokens, you can fit 128 files raw -- or 177 files after compacting. That's 38% more code the model can see at once. More context = better answers.
How it works:
cat src/main.py | wasmbox run compact
cat src/main.py | wasmbox run compact -- --stats
find src/ -name '*.py' -exec echo "===FILE:{}===" \; -exec cat {} \; | wasmbox run compact -- --tree
compact auto-detects 13 languages (Python, Rust, Go, TypeScript, JavaScript, C, C++, Java, Zig, and more). It ships with SHA-256 verification so you can prove the agent sent compacted output, not modified output. And it runs fully sandboxed -- stdin/stdout only, no filesystem, no network.
Built in Rust, compiled to WebAssembly (109KB), runs anywhere via WasmBox. One dependency. 107 tests.
Install:
wasmbox registry add
https://qstorage.quilibrium.com/wasmbox
wasmbox install compact
WasmBox CLI:

Tangled
metaend.eth.xyz/wasmbox-cli
Flatpak-style launcher for sandboxed WebAssembly tools. Install, verify, and run .wasm binaries with explicit capability grants. Single binary, loc...
Tool Registry:
https://tangled.org/metaend.eth.xyz/wasmbox-registry
Tokens are the new bandwidth. Stop wasting them.
#AI #LLM #DevTools #WebAssembly #Rust #AIAgents #TokenOptimization #OpenSource