HeadlinesBriefing favicon HeadlinesBriefing.com

Minimal Coding Agent in 400 Shell Lines

Hacker News •
×

A developer created Pu.sh, a full coding agent harness built in just 400 lines of shell script. Starting as an experiment with pi-autoresearch, the creator built a portable coding agent with a strict self-imposed rule: no new dependencies and under 500 lines of code. The minimal approach relies only on sh, curl, and awk, forcing creative solutions within tight constraints.

The resulting tool supports Anthropic and OpenAI APIs with seven core tools: bash, read, write, edit, grep, find, and ls. Features include REPL functionality, auto-compaction, checkpoint/resume capability, and pipe mode. The implementation leverages awk for JSON parsing and handles OpenAI response loops with reasoning across turns—accomplishing complex functionality with minimal dependencies.

The creator acknowledges heavy inspiration from Pi (pi.dev), adopting the same seven-tool surface and exact-text edit model. While impressive, Pu.sh lacks TUI, streaming, images, OAuth, and Windows support. What's remarkable is how much of a "real" agent CLI consists of DX and hardening rather than core agent logic, demonstrating how developers can customize their own tool harnesses to specific needs.