Back to directory

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

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.

More in Coding agents

See all 793
  • The City

    github.com

    A native macOS app that shows Claude Code runs as a city, with each project as a building, each team as a floor of robots, and every animation driven by a real event from the claude CLI's stream.

  • rig

    tryrig.ai

    A small, single-binary agent runtime that points at any OpenAI-compatible model, local or hosted, reads and edits a repository's code, runs its tests and remembers what it learned, with a loop implemented in a few hundred lines.

  • Jauvex

    jauvex.reindent.com

    An Electron desktop app that puts Claude Code, Codex and Grok coding-agent sessions side by side and lets you steer them by voice, with a small model handling fast routing decisions.