Show HN: Tilth – I spent tokens so my agents would stop wasting them (~4k Rust)
jahala Monday, February 09, 2026I'm an "ideas person" who messes around with AI on a low budget. I got tired of watching my tokens vanish and context windows filling up while agents fumbled around trying to find the right thing.
Agents don't flail like they used to with shell tools, but there are still weak/blind spots and back-and-forth episodes — especially when using tools in combination/sequence.
So I built "tilth" today. Or rather, AI built it — every line is Opus 4.6. I spent a lot of my precious tokens getting it to "not shit" (at least several of the different vendors' AI overlords assure me it's not shit). It's ~3,900 lines of Rust. I'm positive HN will let me know if its shit after all.
The idea: give agents code-aware reads with a token budget. Read a large file and you get a tree-sitter outline (function signatures, types, imports) instead of the raw text. Drill into specific line ranges when you need detail. Search for a symbol and definitions come first (via AST), ranked by proximity to what you're editing.
read — structural outline for large files, full content for small ones, line ranges to drill in
search — symbol (tree-sitter AST), literal text, or regex. Definitions before usages.
map — codebase overview in one call
files — glob matching with token estimates, respects .gitignore
session — tracks what the agent has looked at
Tree-sitter adds structural awareness for 10 languages on top. Uses ripgrep internals for search, memmap for large files. Runs as a CLI or MCP server over stdio. Single binary, no indexing, no cloud. MIT licensed.To try it:
cargo install tilth
tilth map .
tilth search "your_function_name" .
tilth read src/main.rs
tilth install claude-code
I hope it helps other people who, like me, would rather spend their tokens building things than watching an agent navigate.-- *tilth* — the state of soil that's been prepared for planting. Good tilth means structured ground where things can take root.
GitHub: https://github.com/jahala/tilth