Build a Minimal Coding Agent in 9 Lines of Python (No Dependencies)
__tosh · reddit · 2026-08-08
A developer explored the absolute minimum implementation for an AI coding agent and open-sourced the project smol. It strips out all non-essential features to provide a base experience similar to Claude Code or Codex.
Key highlights:
- Extremely Minimal: Only 9 lines of Python code with zero third-party dependencies (stdlib only).
- Compatibility: Works with any OpenAI Responses compatible API endpoint.
- Cost & Context: No system prompt, features good caching via stable append-only history, and displays context window usage percentage.
- Single Tool: Relies on just one tool: sh (for shell execution).
The author also provided a 20 line version in Go, with a Clojure version coming soon. This is a great educational resource for understanding how agents work under the hood.
More from coding & agent
- Lightning AI Launches Hermes Agent: Focuses on Reliability and Self-Improvement — LightningAI · 2026-08-08
- Multi-Agent Auto-Research Harness Produces Physics Paper with GPT Pro and DeepSeek — aiamblichus · 2026-08-08
- OpenOntology Teases OSS Release: Empowers Haiku to Outperform Opus in Agentic Search — anselm · 2026-08-08
- JSALT Insights: Multimodal LLMs Should Drop Modality-Specific Encoders — rdesh26 · 2026-08-08
- Building a Fully Automated Satirical News Station on a Single RTX 3090 — sysadmin420 · 2026-08-08
- The AI Agent Landscape: 13 Categories Reshaping Workflows — goyalshaliniuk · 2026-08-08