2 ms·
Agent in 50 Lines
- andai 5mo agoHi HN. I found this tutorial for making a minimal AI agent and wanted to share it with you. The gist is that current models don't really need tools, they can just use bash. So you can make an agent in 50 lines of code! I followed this tutorial today and made my own coding agent in 50 lines. That's kind of blowing my mind. It's not just a toy though. Turns out you can do real work with just Bash! I just tested it on a real project, I asked it to fix some bugs in my game. It did just fine. Fixed the TS errors too. In my version I added the one missing line of code, the outer loop that turns it into an actual interactive agent! Enjoy https://gist.github.com/a-n-d-a-i/bd50aaa4bdb15f9a4cc8176ee387b212#file-agent-py-L110 https://gist.github.com/a-n-d-a-i/bd50aaa4bdb15f9a4cc8176ee3... (I vendored in my tiny llm lib, so it's 150 lines dependency free.)
- andai 5mo agoSee also excellent write up on Pi agent harness by its author, where I first heard this idea "bash is all you need". What I learned building an opinionated and minimal coding agent https://news.ycombinator.com/item?id=46844822 https://news.ycombinator.com/item?id=46844822 https://mariozechner.at/posts/2025-11-30-pi-coding-agent/ https://mariozechner.at/posts/2025-11-30-pi-coding-agent/