{"by":"nahimn","descendants":28,"id":47968112,"kids":[47968449,47969421,47968898,47969005,47968375,47968813,47970403,47968380,47968988,47968790,47977114,47970097,48020198,47969423,48045201,47995669,47974935,48043070,48047375,47972079,47972335,47982403,47971371,47970081,47968743,47968985,47972693,47969974],"score":92,"text":"I originally was just messing with pi-autoresearch. Gave it a sample task to build the most portable coding agent.<p>First cut was 6 KB of shell. Great for one-shots, unusable interactively. I was shocked it actually worked.<p>Started building up -- adding features — but with a self-imposed rule: no new dependencies, and sub 500 LOC. This thing had to be truly portable. Just sh, curl, awk. System primitives only.<p>Which means I did some genuinely disgusting things in awk, including JSON parsing and the OpenAI\nResponses tool loop with reasoning items carried across turns.<p>It&#x27;s now ~400 lines. In the box: Anthropic + OpenAI, 7 tools (bash, read, write, edit, grep, find, ls),\nREPL, auto-compaction, checkpoint&#x2F;resume, pipe mode, 90 no-API tests. Not in the box: TUI, streaming,\nimages, OAuth, Windows, dignity.<p>Two honest things:<p>1. I stole&#x2F;modified the system prompt and the architecture. Pi&#x2F;Claude&#x2F;Codex wrote the awk. I cannot read most of this code. This wasn&#x27;t possible for me a year ago.<p>2. Heavily inspired by Pi (pi.dev) — same 7-tool surface, same exact-text edit model. Credit where it&#x27;s\ndue. Pi is awesome -- you should probably use them.<p>The agent loop itself is tiny. Almost everything else in a &quot;real&quot; agent CLI is DX and hardening. You can\nprobably build your own harness exactly how you like it. Mario Zechner&#x27;s AI Engineer talk on taking back control of\nyour tools nudged me here.<p>The name is because it&#x27;s a .sh file. The other thing it sounds like is, regrettably, also accurate.","time":1777582512,"title":"Show HN: Pu.sh – a full coding-agent harness in 400 lines of shell","type":"story","url":"https://pu.dev/"}