# swift-coding-agent

A Swift reimplementation of a Claude Code-style coding agent, rebuilt one stage at a time to test which architectural choices actually make a coding agent work well.

swift-coding-agent explores the architecture behind coding agents by rebuilding a Claude Code-style command-line agent from scratch in Swift, documented in a nine-part learning series. Its working theory is that coding agents benefit more from a small set of well-designed tools and a tight loop than from large orchestration layers, since Claude Code itself ships few tools, such as a search tool and a file editor, and largely trusts the model rather than adding scaffolding.

Each stage of the project isolates one mechanism to see what it contributes: an initial stage adds the agent loop and a bash tool, later stages add tool dispatch for reading, writing, and editing files with path safety, and todo tracking with reminder injection, with a second, git-tagged phase planned to add product-level features such as context and memory management. The loop itself stays fixed across stages; only the available tools change.

Website: https://ivanmagda.dev/posts/s00-bootstrapping-the-project/
