A few months ago I noticed something stupid.
I was paying AI agents to forget.
They would read a file, do some work, lose the thread, read it again, run a command, dump half the terminal into the context, then ask for more information that was already there five minutes ago.
And I just kept thinking:
This cannot be the future.
Not because the models are bad. They are often amazing. Sometimes annoyingly amazing.
But the way we feed them context is messy.
We give them too much.
Then not enough.
Then the wrong thing.
Then the same thing again.
Then a giant log file as dessert.
At some point I stopped complaining and started building.
That became LeanCTX.
The first version was basically me trying to stop the bleeding. Cache repeated reads. Compress shell output. Give the model a smaller version of files when a smaller version is enough. Keep the useful parts of context alive across sessions.
Then the project started growing.
People used it.
People broke it.
People complained.
People sent weird edge cases.
People told me when my “optimization” was actually making the agent worse.
That last part was important.
Because it forced me to admit that token savings alone are a bad religion.
A smaller context is not automatically a better context.
If the model needs the full diff, give it the full diff.
If it only needs signatures, don’t send the whole file.
If a log has one useful error, don’t send 10,000 lines of emotional damage.
The point is not minimal context.
The point is useful context.
LeanCTX now has 48k installs and 1.6k GitHub stars, which still feels weird because in my head it is partly a serious infrastructure project and partly a late-night argument I had with my own terminal.
I made it open source because I want people to be able to use it, inspect it, question it, improve it, and build on it.
I don’t want this layer to be locked inside one AI coding tool.
If agents are going to become part of how software is built, then context should become a shared infrastructure layer.
Something that can sit under different tools.
Something that can help agents talk to each other.
Something that can remember what matters.
Something that can reduce waste.
Something that can make AI workflows more efficient and more transparent.
Maybe that sounds too grand for a tool that started because I was annoyed at repeated file reads.
But honestly, a lot of useful infrastructure starts as annoyance.
A log was too noisy.
A build was too slow.
A deploy was too manual.
A model kept rereading the same file like it had short-term memory loss and a corporate credit card.
So yes, LeanCTX saves tokens.
But the bigger thing I care about is this:
Can we build AI systems that waste less?
Less compute.
Less repeated context.
Less noise.
Less blind trust.
More signal.
More reuse.
More transparency.
More infrastructure that everyone can benefit from.
That’s why it’s open source.
Not because I have everything figured out.
Because I don’t.
And that’s exactly why I’d rather build it in the open.