How to Build a Coding Agent

tosh1 pts0 comments

GitHub - nicolaygerold/howtobuildacodingagent · GitHub

/" data-turbo-transient="true" />

Skip to content

Search or jump to...

Search code, repositories, users, issues, pull requests...

-->

Search

Clear

Search syntax tips

Provide feedback

--><br>We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Cancel

Submit feedback

Saved searches

Use saved searches to filter your results more quickly

-->

Name

Query

To see all available qualifiers, see our documentation.

Cancel

Create saved search

Sign in

/;ref_cta:Sign up;ref_loc:header logged out"}"<br>Sign up

Appearance settings

Resetting focus

You signed in with another tab or window. Reload to refresh your session.<br>You signed out in another tab or window. Reload to refresh your session.<br>You switched accounts on another tab or window. Reload to refresh your session.

Dismiss alert

{{ message }}

nicolaygerold

howtobuildacodingagent

Public

Notifications<br>You must be signed in to change notification settings

Fork

Star<br>10

main

BranchesTags

Go to file

CodeOpen more actions menu

Folders and files<br>NameNameLast commit message<br>Last commit date<br>Latest commit

History<br>1 Commit<br>1 Commit

.amp/plugins

.amp/plugins

.pi

.pi

core-loop

core-loop

docs

docs

.gitignore

.gitignore

README.md

README.md

View all files

Repository files navigation

Context Engineering: How We Got Here

Workshop material. Every section has a short explainer in docs/ with ASCII diagrams, and a runnable demo — plugins for pi and Amp that live in this repo and load automatically when you run either agent here.

The one idea

An LLM predicts the next token from its weights and its context. You don't control the weights. So for you, the entire output is a function of the input — the prompt plus every tool result the agent pulls into its window.

Context engineering is deciding what goes into that window. This workshop walks through how that job moved: from the user to the harness, and now into the model itself.

The arc

2024 2025 2026<br>─────────────────────────────────────────────────────────────────────▶<br>╭───────────╮ ╭────────────╮ ╭───────────────╮ ╭─────────╮ ╭─────╮<br>│ core loop │─▶│ compaction │─▶│ file-based │─▶│ handoff │─▶│ RLM │<br>│ (agents │ │ v1: lossy, │ │ compaction & │ │ targeted│ │ ??? │<br>│ are a │ │ lost your │ │ plan mode: │ │ extract-│ ╰─────╯<br>│ loop) │ │ instructions│ │ user does the │ │ ion │<br>╰───────────╯ ╰────────────╯ │ harness's job │ ╰─────────╯<br>▲ ╰───────────────╯ │<br>╰─────────────────────────────────╯<br>compaction is back: models got good<br>enough that lossy is recoverable

Agenda

Topic<br>Explainer<br>Demo

The core loop of an agent<br>docs/01-core-loop.md<br>core-loop/main.go (Thorsten's agent, runnable), pi's agent-loop.ts

Harness engineering<br>docs/02-harness-engineering.md<br>this repo's plugins — see the doc

Compaction: why v1 failed, why it's back<br>docs/03-compaction.md<br>two versions: .pi/extensions/compaction.ts (modern, ported from Codex, auto-loads) vs. .pi/demos/naive-compaction.ts (2024-style, load with pi -e)

File-based compaction<br>docs/04-file-based-compaction.md<br>.pi/extensions/checkpoint.ts

Plan mode<br>docs/05-plan-mode.md<br>.pi/extensions/plan-mode/, .amp/plugins/plan-mode.ts

Handoff<br>docs/06-handoff.md<br>.amp/plugins/handoff.ts, .pi/extensions/handoff.ts

Recursive Language Models (RLM)<br>docs/07-rlm.md<br>.pi/extensions/rlm.ts

Read tool vs. bash<br>docs/08-read-vs-bash.md<br>.pi/extensions/read-vs-bash.ts (context-cost meter), pi --tools bash vs. pi --tools read,bash

Edit tools vs. apply_patch<br>docs/09-edit-vs-apply-patch.md<br>.pi/extensions/apply-patch.ts

Diagrams are ASCII, inline in each doc.

Setup

Install pi: see pi.dev. Pi loads project extensions from .pi/extensions/.

Install Amp: see ampcode.com. Amp loads project plugins from .amp/plugins/.

Run either agent from this repo's root. The demo plugins load automatically.

Repo layout

docs/ explainers, one per topic, ASCII diagrams inline<br>core-loop/ Thorsten Ball's 400-line agent in Go, runnable<br>.pi/extensions/ pi demo extensions<br>.amp/plugins/ Amp demo plugins

About

No description, website, or topics provided.

Resources

Readme

Uh oh!

There was an error while loading. Please reload this page.

Activity

Stars

10<br>stars

Watchers

watching

Forks

forks

Report repository

Releases

No releases published

Packages

Uh oh!

There was an error while loading. Please reload this page.

Contributors

Uh oh!

There was an error while loading. Please reload this page.

Languages

TypeScript<br>89.4%

Go<br>10.6%

You can’t perform that action at this time.

docs plugins extensions loop compaction agent

Related Articles