mini-coding-agent
About
Raschka wrote mini-coding-agent as the runnable companion to his essay on the components of a coding agent, with the constraint that the entire harness fit in one readable file with no dependencies beyond the Python standard library. The loop sends prompts to a local Ollama model (qwen3.5:4b by default) that must answer with either a tool call or a final answer; tools cover repo-context gathering, file operations, and shell commands, each validated and gated by an approval mode (ask, auto, never) so risky actions require consent. The implementation demonstrates the standard efficiency patterns directly: a stable prompt prefix for cache reuse, clipped outputs and deduplicated reads for context reduction, durable transcripts with distilled working memory, and subagents scoped to bounded subtasks. Sessions persist under .mini-coding-agent/sessions and resume by ID. Readers use it alongside the essay to understand agent internals rather than to ship code with it — fifteen commits and a default six-step cap signal its educational scope.