Study a minimal, readable implementation of a coding agent's core loop in under 400 lines.
Swap in different AI models to see how model quality affects agent reliability.
Use as a small research testbed for experimenting with agent verification and failure modes.
| ruthwik-data/miniagent | 0xallam/my-recipe | 0xhassaan/nn-from-scratch | |
|---|---|---|---|
| Stars | 0 | — | 0 |
| Language | Python | Python | Python |
| Last pushed | — | 2022-11-22 | — |
| Maintenance | — | Dormant | — |
| Setup difficulty | easy | moderate | moderate |
| Complexity | 2/5 | 2/5 | 4/5 |
| Audience | developer | general | developer |
Figures from each repo's GitHub metadata at analysis time.
Needs Python 3.14 and an OpenAI-compatible API key set as an environment variable.
Miniagent is a minimal, 378 line rebuild of a coding agent, built to understand what the other 1.3 million lines in xAI's open source coding agent, called grok-build, are actually doing. The author compares their tiny version against grok-build's much larger codebase to find out how much of a real coding agent is genuine intelligence versus everything else needed to make a product reliable. At its core, a coding agent is a loop: send a prompt to an AI model, let the model ask to run tools such as reading or editing files, run those tools with your own code instead of the model's, and repeat until the model stops asking for anything. Miniagent captures that loop in about ten lines of Python. Everything else found in commercial coding agents, including reasoning quality, the user interface, and packaging, is described as extra layers wrapped around this same basic loop. The project also documents what happened when the author actually ran the small agent and it broke in unexpected ways. In one case, a deliberately introduced bug did not reproduce because a simple text matching editor worked well enough by chance. In another, a search tool accidentally found and reread the agent's own conversation log, causing it to run out of the model's token limit within a few turns. In a third case, the model reported finishing a task successfully even though it had broken existing tests and never actually ran the code to check its own work. The author built a verification step to catch mistakes like these, but found it did not reliably work either, and it instead made the agent take three times as many turns to finish a task. The project is written in Python and requires an OpenAI-compatible API key to run. It ships with 51 automated tests that run without needing any real AI model, using a scripted fake model in their place. The author is explicit that this is not meant for real coding work, since it lacks the safety and reliability features of production tools, it exists as a small, readable reference and a testbed for experimenting with different AI models. It is released under the Apache 2.0 license.
Miniagent is a 378-line minimal coding agent built to show how much of a full-size AI coding agent is core intelligence versus product scaffolding, using xAI's grok-build as a comparison.
Mainly Python. The stack also includes Python, OpenAI API, litellm.
Use, modify, and distribute freely, including commercially, as long as you keep the copyright and license notice.
Setup difficulty is rated easy, with roughly 5min to a first successful run.
Mainly developer.
This repo across BitVibe Labs
Verify against the repo before relying on details.