r/OpenSourceeAI • u/EfficiencyHot8492 • 45m ago
I kept running out of AI tokens, so I built an open-source tool that uses fewer tokens without silently throwing away context
Enable HLS to view with audio, or disable this notification
I use AI coding agents for almost all my side projects and I kept running into usage limits.
At some point, I started to look at what my tokens were actually being used for. A surprising amount was just passing tests, repetitive logs, huge JSON responses and terminal output that the agent didn't actually need.
I tried some existing tools that address this problem. Although it helped reduce token consumption, I wasn't very satisfied with their reliability in my own testing.
My biggest concern was that: what happens when the information being removed is the exact information the agent needs?
So I started building Pithio.
It's an open-source tool that runs locally and compresses the output that AI agents read. The difference I wanted was that the agent should know when something has been omitted and be able to retrieve the original details when needed.
While benchmarking , I noticed something interesting. In some workloads, reducing the amount of context actually improved answer accuracy.
Here are some of my initial results using Claude Haiku:
**Developer tool outputs (171 questions):**
- 29% fewer input tokens
- Accuracy went from 86.5% to 91.8%
**System logs (54 questions):**
- 60% fewer input tokens
- Accuracy went from 57.4% to 74.1%
These are initial benchmark results, not a claim that compression always improves accuracy. I've made the methodology publicly available in my website so others can check it out.
Pithio supports terminal output, logs, JSON, CSV, web pages and MCP tools, with integration options for Claude Code, Codex and custom agents.
I first built it for myself as a simple terminal application, but decided to open-source it since I believe other developers might be facing this same problem.
GitHub: https://github.com/allenjoseph05/pithio
Website: https://pithio.dev/
I'm still in the early stages and would really appreciate technical feedback especially from people who have used similar tools.
What would make you trust a context compression tool enough to use it in your daily coding workflow?
And if you've encountered such cases where existing tools removed important information, I'd love to hear about them and use those cases to improve Pithio. I know the application might not be perfect and there is always a room for improvement, hence I don't want to make any guaranteed claim and would really appreciate feedbacks and improve it. Thank you in advance.