explaingit

nicolaygerold/howtobuildacodingagent

Analysis updated 2026-05-18

25TypeScriptAudience · developerComplexity · 3/5Setup · moderate

TLDR

Workshop material teaching how AI coding agents manage their context window, with written explainers and runnable demo plugins for the pi and Amp agent tools.

Mindmap

mindmap
  root((coding agent workshop))
    What it does
      Explains context engineering
      Nine topic walkthrough
      Runnable demo plugins
    Tech stack
      TypeScript
      Go
      pi
      Amp
    Topics
      Core agent loop
      Compaction
      Plan mode
      Handoff
      RLM
    Use cases
      Learn agent design
      Compare tool designs

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Learn how coding agents decide what goes into a model's limited context window.

USE CASE 2

Study why early context compaction techniques failed and why they work again with newer models.

USE CASE 3

Compare tool design choices, like a read tool versus shell commands, using working demo plugins.

USE CASE 4

Run a small, fully readable 400-line coding agent in Go to see the core agent loop end to end.

What is it built with?

TypeScriptGopiAmp

How does it compare?

nicolaygerold/howtobuildacodingagent8thpark/geodecodeweb-dev/spark-ui
Stars252525
LanguageTypeScriptTypeScriptTypeScript
Setup difficultymoderatemoderate
Complexity3/52/5
Audiencedevelopervibe coderdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · moderate Time to first run · 30min

Requires installing the pi or Amp agent tool separately, then running it from the repo root to auto-load the demo plugins.

In plain English

This repository is workshop material for learning how AI coding agents are actually built, focused on a single idea: everything an AI language model outputs is a function of what gets fed into its context window, since the model itself cannot be changed by the person using it. The workshop is about the practice of deciding what information goes into that window, and how responsibility for that decision has shifted over time between the person typing the prompt, the surrounding agent tooling, and now increasingly the model itself. Each of the nine topics has a short written explainer with plain ASCII diagrams, plus a runnable demo. The topics move through the history and current state of the field: the basic loop that all agents run on, engineering the tooling layer around a model, why early attempts at compacting long conversations failed and why the technique is coming back now that models are more capable, compacting context by writing it out to files instead, letting the agent plan before acting, handing off work between agent sessions, an experimental recursive approach to extracting relevant context, and practical comparisons between different tool designs, such as a plain read tool versus a shell command, or dedicated edit tools versus a generic patch-apply tool. The demos are built as plugins for two specific coding agent tools, called pi and Amp, and they load automatically the moment either tool is run from inside this repository. One demo is also a small, runnable 400-line agent written in Go, included so learners can see the entire core agent loop laid out plainly rather than buried in a larger codebase. To use it, you install either pi or Amp separately, then simply run the agent from the root of this repository so its project-level extensions and plugins are picked up automatically. The repository is organized into a docs folder with the written explainers, a folder holding the standalone Go agent, and separate folders for the pi and Amp demo plugins.

Copy-paste prompts

Prompt 1
Explain the difference between file-based compaction and the original v1 compaction approach in this repo.
Prompt 2
Walk me through the core-loop/main.go agent so I understand a minimal coding agent's structure.
Prompt 3
Show me how the plan-mode plugin changes an agent's behavior compared to acting immediately.
Prompt 4
Help me compare the read-vs-bash demo to understand context cost tradeoffs for different tools.

Frequently asked questions

What is howtobuildacodingagent?

Workshop material teaching how AI coding agents manage their context window, with written explainers and runnable demo plugins for the pi and Amp agent tools.

What language is howtobuildacodingagent written in?

Mainly TypeScript. The stack also includes TypeScript, Go, pi.

How hard is howtobuildacodingagent to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is howtobuildacodingagent for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.