What I learned building an opinionated and minimal coding agent
4 days ago
- #minimalism
- #LLM
- #coding-agent
- The author discusses their journey with LLM-assisted coding, transitioning from basic tools like ChatGPT to more advanced coding agents like Claude Code and opencode.
- They highlight the importance of context engineering in coding agents, emphasizing the need for control over what goes into the model's context for better outputs.
- The author critiques existing coding harnesses for lacking transparency and flexibility, particularly in inspecting interactions and building alternative UIs.
- They share their experience with self-hosting LLMs, noting challenges with libraries like the Vercel AI SDK and tool calling.
- The author decided to build their own minimal coding agent harness, named pi, focusing on simplicity and predictability.
- Key components of pi include pi-ai (a unified LLM API), pi-agent-core (agent loop), pi-tui (terminal UI framework), and pi-coding-agent (CLI tool).
- The author details the challenges of creating a unified LLM API, including provider-specific quirks and token tracking issues.
- They emphasize the importance of cross-provider context handoff and serialization/deserialization for seamless model switching.
- The author discusses their approach to terminal UI development, opting for a simple, linear chat interface with differential rendering to minimize flicker.
- pi-coding-agent features a minimal system prompt and toolset, focusing on essential tools like read, write, edit, and bash.
- The author advocates for a 'YOLO' approach by default, granting the agent full access to the filesystem and command execution without safety rails.
- They reject built-in to-dos, plan modes, MCP support, background bash, and sub-agents, favoring external file-based solutions and tmux for complex tasks.
- Benchmark results show pi performing competitively against other coding harnesses, validating the author's minimal approach.
- The author concludes by expressing satisfaction with pi's performance and inviting contributions, while maintaining a focused and maintainable project scope.