Skip to main content

100cc: Roll your own Claude Code With 100 Lines

I had lots of fun bootstrapping a coding agent without claude.

Coding agent is conceptually very simple and Claude Code is not great at observability. So why not roll your own?

I did it the old school way. Read the docs and write the code slowly and manually. The lines of code needed is surprisingly small to get things sky rocketed - 100 lines.

I’m not good at TUI and don’t want to learn about TUI. So my initial goal is just to play around with the API and re-implement claude -p. It was quick.


And then things got a bit wild.

Of course the next step is to have repl mode to make the program interactive. I’m never good at readline. So I just run bun start -p 'implement repl for this project' … and then I got the little > working!

And then I kept going…with the prevailing 1M context window I don’t even need a proper compaction implementation to keep it going. After three prompts to my custom little coding agent, it soon rewrote itself into this.



This is just amazing. I remember there’s a old saying that if we lost all the software in the world, we would have great trouble bootstrapping ourselves. That might not be true anymore if we magically keep the LLM running at that time. It took so little effort to bootstrap coding agent itself. 

 https://github.com/yujqiao/100cc 

PS: as all novel ideas, this is not a novel idea. I found https://www.mihaileric.com/The-Emperor-Has-No-Clothes/ by searching after finishing this

Comments

Popular posts from this blog

Show Me Less Output

The last time I saw someone showing off AI-generated reports, trying to present it as something insightful and helpful, I was really  annoyed . It is NOT HELPFUL at all, to show me more output. Before the LLM era, it was considered as productive if one comes up with a long report full of charts. The trouble of composing long paragraph and mangling data used to stop one from writing useless reports. Word count, lines of code, were considered as productivity signals to some extent. Even if one tried to hack the signal, like a best-selling author who can go on forever about a simple opinion, it required lots of labor. However, now everyone is equipped with the latest shinny model that is trained to complete text. Surely the signal hacker will try to throw slop grenade everywhere to blow off everyone to appear productive. If your point can be made with one chart, do not draw two. More output is not a sign of productivity. If anything, less output is.