Show HN: Pu.sh – a full coding-agent harness in 400 lines of shell

90 points
1/21/1970
3 days ago
by nahimn

Comments


ricardobeat

Really like the looks of it, but minifying the code to achieve the “400 lines” marketing gimmick is a huge turn-off.

It’s also a security nightmare, and ensures it remains 100% vibe coded. Would rather have a readable source with an honest line count.

3 days ago

StableAlkyne

Agreed. It would be one thing if it was a regular bash project that got minified via a script or something, since at least you could tell what it's doing.

This is just spaghetti. Maybe it's spaghetti that runs, but code of this quality does not engender confidence.

3 days ago

sudb

I think it's fine that it's minified, code-golf style, but yes I agree that this would be much more convincing and useful with an unminified source.

3 days ago

cachius

Isn’t unwrapping and commenting just one prompt away?

3 days ago

StableAlkyne

Assuming the agent doesn't forget or misinterpret anything.

It would be much better to just have a deterministic minification script.

3 days ago

malicka

… no, you shouldn’t use AI for simple reformatting of code without the newlines. We have syntax parsers and reformatters for this. Use them, then put that into the LLM for commenting, if you really want to.

3 days ago

nahimn

Caught by surprise by the people who want to read the code -- and thank you for the great ideas.

Slapped together an 'unminified version' that has been ran against the test suite.

Hopefully has more educational value

https://github.com/NahimNasser/pu/blob/main/pu-unminified.sh

2 days ago

petcat

I'm not even sure why it stopped at 500 line limit. If it's just a shell script then why not make it one line?

3 days ago

mjuarez

Could you post the initial 6KB version? I'd love to have a version that I can actually read and understand. I don't care if it's 2K LOC.

3 days ago

TacticalCoder

> Could you post the initial 6KB version? I'd love to have a version that I can actually read and understand. I don't care if it's 2K LOC.

I don't think that even with APL you could get an average of three characters per line of code to get a 6 Kb file in 2 K LOC.

3 days ago

greenavocado

Maybe in Wényán lang?

3 days ago

nahimn

heh... i'm afraid i didn't commit it -- as it was in the original pi-autoresearch yolo'ing phase.

2 days ago

kkovacs

I love this. This is the grown-up brother of my one-liner bash+python at

https://github.com/kkovacs/kkrc/blob/ecff1f65d5ccfa24d5f6695...

:)

3 days ago

cachius

3 days ago

petcat

your 500 LOC requirement has made this thing completely and unnecessarily inscrutable and unreadable.

Pass.

3 days ago

Imustaskforhelp

Interested in something like this if the code can be more readable, it would be interesting to see it in languages like lua etc. too in future.

3 days ago

Amber-chen

I like the small-surface-area approach. The question I’d use to evaluate this is how well the harness records/replays tool calls and failure modes, since that is where debugging agent behavior usually gets messy.

3 days ago

migrevdolseg

this inspired me to build something similar.

i like the idea but i wanted slightly different constraints:

- one file

- zero dependencies (other than node)

- <1k loc

- ascii only

- suckless configuration

- works with ollama models

- more readble sourcecode

- pretty markdown output

- toggle-able read-only mode

https://willhanlen.com/~~/outbox/26/5/ai.js/?code

took me only a few hours. amazing times we live in!

2 days ago

hkt

I love it. I think I'm going to have fun with this and possibly learn a bit, too. I'm pondering a container based dev environment at the moment and might throw it in with busybox and see how far I get :)

3 days ago

tecoholic

Kudos. I set on this exact journey a couple of days back and Pi is what I started reading for inspiration as well. I really can't stand the text boxes and the animations of the mainstream harnesses.

3 days ago

flog

I'd love to learn how to build something like this, but unfortunately the code is unreadable.

If author could write a heavily commented version that would be amazing.

3 days ago

freakynit

I built full agentic-loop from scratch with full MCP support and session save and resume capabilities just this week. The intent was to learn by building full system from scratch, and share the learnings with others.

Working demo: https://asciinema.org/a/983581

Code: https://github.com/freakynit/agentic-loop

Tutorial: https://building-an-agent.pagey.site/

12 hours ago

zackham

if you are looking for a customizable agent harness that provides everything except a tui (cli, acp, embeddable python package) i built and use this for a handful of projects where i needed a vendor-agnostic replacement for claude agent sdk: https://github.com/zackham/aloop

3 days ago

0gs

why the LOC limit? just because?

3 days ago

nahimn

Originally a metric to drive prioritization and constraints on the project (amongst others, like zero deps, etc) -- but clearly ended up getting abused

2 days ago