# Build Your Own Coding Agent

A hands-on book and Go codebase that teaches harness engineering by building a working terminal AI coding agent from scratch and experimenting with its providers, tools and permissions.

Build Your Own Coding Agent is a hands-on introduction to harness engineering: the discipline of building the scaffolding around a language model that turns it into a useful agent. Readers build a roughly 600-line terminal coding agent in Go that talks to Claude or another LLM, calls tools such as bash, read_file and write_file, asks for approval before each tool call, compacts long conversations with pluggable strategies, and supports slash commands and a styled TUI.

The book frames harness engineering as happening at three layers: building the agent loop and its abstractions, extending it with new tools or integrations, and configuring behavior through files such as AGENTS.md and mcp.json, arguing that most of what makes a tool like Claude Code or Aider feel good or bad lives in the harness rather than the underlying model.

It requires Go 1.21 or later and an Anthropic or OpenAI API key, and can be read online in English or Spanish.

Website: https://github.com/betta-tech/byo-coding-agent
