building-a-coding-agent-from-scratch-course
Learn harness engineering by building Claude Code from scratch. Free, open-source course: 8 articles, 6 videos, 1 codebase.
Install / Use
npx skills add decodingai-magazine/building-a-coding-agent-from-scratch-courseInstalls into whichever agent you are using.
Other
Other agent config
Quality Score
Category
AI & Machine LearningSupported Platforms
Our assessment of building-a-coding-agent-from-scratch-course
building-a-coding-agent-from-scratch-course scores 91/100 on our quality scale, 301st of 953 AI & Machine Learning skills we index (top 32%).
Its Other is 26 KB long, well organised into 22 sections with 2 code examples: a thorough specification that gives an agent plenty to work with.
With 1,126 GitHub stars, it is one of the more widely adopted skills in the catalogue.
Maintenance, license and trust
- The repository was last updated 13 days ago, so building-a-coding-agent-from-scratch-course is actively maintained.
- Our last check on 2026-10-20 found the source still online.
- It is released under the Apache-2.0 license, a permissive license that allows use, modification and commercial use with attribution.
- Its trust signals score 100/100, with no cautions. These come from repository metadata, not a code audit โ read the skill file before letting an agent act on it.
Safety scan
No issues foundOur scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review of the same text found nothing harmful.
AI review by kimi-k2.7-code on 2026-09-24. Automated pattern scan on 2026-09-24. It catches known dangerous patterns, not every risk โ read a skill before letting an agent act on it.
building-a-coding-agent-from-scratch-course compared with similar skills
All 4 of these similar skills score higher than building-a-coding-agent-from-scratch-course; compare them before choosing.
| Skill | Score | Stars | Updated | Format |
|---|---|---|---|---|
| building-a-coding-agent-from-scratch-course (this skill)by decodingai-magazine | 91 | 1.1k | 13d ago | Other |
| claude-memby thedotmack | 100 | 113.8k | today | CLAUDE.md |
| Understand-Anythingby Egonex-AI | 100 | 91.0k | today | CLAUDE.md |
| headroomby headroomlabs-ai | 100 | 79.0k | today | CLAUDE.md |
| CowAgentby zhayujie | 100 | 47.8k | today | CLAUDE.md |
Frequently asked questions
- How do I install building-a-coding-agent-from-scratch-course?
- Run
npx skills add decodingai-magazine/building-a-coding-agent-from-scratch-course. The install tabs above show the steps for each supported agent. - Which AI agents does building-a-coding-agent-from-scratch-course work with?
- It is written for Claude Code, as a Other file. Other agents that read the same format can often use it too.
- Is building-a-coding-agent-from-scratch-course safe to use?
- Our scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review of the same text found nothing harmful. It is Apache-2.0-licensed and scores 100/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
- Is building-a-coding-agent-from-scratch-course still maintained?
- The repository was last updated 13 days ago, so building-a-coding-agent-from-scratch-course is actively maintained.
Skill content
View source on GitHub<p align="center"> <img src="assets/demo-skills.png" alt="The demo skills listed inside the decode TUI after typing /demo-" width="800"> </p> <p align="center"><i>Type <code>/demo-</code> and the six demos are one keystroke away.</i></p>Try the finished agent first โ 5 minutes, $0:
git clone https://github.com/decodingai-magazine/building-a-coding-agent-from-scratch-course.git cd building-a-coding-agent-from-scratch-course make install cp .env.example .env # set LLM API key uv run decodeThen type
/demo-and pick a demo โ see what they do below. Full setup guide.
๐ About This Course
In LangChain's Terminal-Bench experiment, changing only the harness (with the same model) moved a coding agent from ~30th place into the top 5: the harness, not the model, is what makes a coding agent good.
The agent is ~20 lines. The course is everything else.
agent = Agent(
build_model(settings.llm_provider), # gemini | openrouter | modal
deps_type=AgentDeps, # cwd, event sink, permission gate
output_type=[str, DeferredToolRequests], # final answer, or tools paused for approval
)
register_tools(agent) # read, edit, bash, grep, ...
async with agent.iter(prompt, message_history=history) as run:
async for node in run: # model request โ tool calls โ repeat
stream_events(node)
That's the entire tool-calling agent. Everything else in this repo: the tools, skills, the permission layer, sandbox, steering queue, memory, compaction, session recording & replay, remote execution, the subagent fan-out, the evals, is the harness. That's what you're here to build.
<p align="center"> <img src="assets/tui-session-start.png" alt="A fresh decode session: Opik tracing on, a Modal-served Qwen model, skill autocomplete, steering keys in the footer" width="90%"/> <br/> <i>A fresh session powered by Qwen 3.6 35B hosted on Modal</i> </p>We spent months under the hood of Claude Code (via its leaked source), OpenCode, Pi, and Aider, then distilled it into 8 articles and 4 videos where you'll build decode, your own coding agent, from scratch. One headless core hooked to two modes: an interactive TUI and Modal serverless functions running N copies in parallel, fired by CLI, webhook, or cron.
<p align="center"> <img src="assets/architecture.png" alt="Diagram of a coding agent harness: two interfaces (Interactive TUI with steering queue and priority gate; Remote Modal runtime running N headless harnesses via CLI, webhook, or cron) drive one Headless Harness made of a Context Window with compaction, an LLM-to-Tools Agent Loop, and six modules (LLM Providers, Memory, Skills, Sandbox, Permissions, LSP Server). An Evals and Observability layer (benchmarks, regressions, replays via Opik and Kitaru) sits underneath." width="620"> </p> <p align="center"><i>The architecture of the harness of the coding agent you will build during this course.</i></p>๐ฎ See It Work
The finished agent ships with demo skills under .decode/skills/. Open the TUI, type /demo-, pick one, and watch the harness you're about to build do real work:
๐ค You'll Walk Away Knowing How To
- Design a coding agent harness from scratch
- Implement a headless coding agent loop
- Attach the headless harness to multiple modes: TUI and remote
- Deploy the headless harness on Modal and fire N parallel attempts at one task from the CLI, a webhook, or a cron job
- Record every run with Kitaru and replay it with the model or prompt swapped, tool outputs served from the recording, against the original as baseline
- Implement guardrails and safety nets for the agent's behavior by adding a permission layer and local & remote sandboxing
- Build essential context engineering techniques: memory, compaction, skills
- Hook up an LSP server for faster feedback loops
- Implement an agents catalog: build, plan, code reviewer and exploration agents
- Spawn parallel subagents via fan-out strategies
- Add observability
- Design an eval harness for benchmarking the agent and checking for regressions
Tech Stack
The code is written in Python, with the following frameworks and libraries:
- Agent Framework: Pydantic AI
- LLM Providers: Modal (open weights you serve yourself via SGLang), OpenRouter (open weights as a service), or Gemini (proprietary).
- Session Recording & Replays: Kitaru
- Observability & Evals: Opik
- Sandboxing: local Docker & remote Modal sandboxes
- Deploying: Modal as headless agents (fired by hand, by cron, or by webhook)
Otherwise, we build all the functionality from scratch, to teach you the foundations that last, not frameworks that abstract away the hard parts.
๐ก The code tells you what. The lessons tell you why.
For the full experience, go through the articles and videos that cover what the code can't. The why behind every decision.
- Why we have a headless harness and two interface modes: TUI + Remote.
- What the essential components of a coding agent are, and what is optional.
- Why we plugged in 9 tools, no more, no less.
- Why we record every run, and what a replay buys you that a re-run doesn't.
- What guardrails are actually useful.
- Why compaction fires at ~80% of the window instead of at the limit.
- Why you need both benchmarks and regression tests.
๐ Course Outline
<table> <tr> <th align="center">Lesson</th> <th align="center">Written Lesson</th> <th align="center">Video Lesson</th> <th align="center">Running the code</th> </tr> <tr> <td align="center"><b>1</b><br/>Building a Coding Agent From Scratch</td> <td align="center"><a href="https://www.decodingai.com/p/building-a-coding-agent-from-scratch-system-design" target="_blank"><img src="assets/architecture.png" width="300" alt="Lesson 1 โ the harness architecture"/></a><br/><i><a href="https://www.decodingai.com/p/building-a-coding-agent-from-scratch-system-design" target="_blank">Article 1</a></i></td> <td align="center" rowspan="2"><a href="https://www.youtube.com/watch?v=sJpop1juVBQ" target="_blank"><img src="assets/thumbnail_video_1.jpg" width="600" alt="Video 1 โ the video version of lessons 1 and 2"/></a><br/><i><a href="https://www.youtube.com/watch?v=sJpop1juVBQ" target="_blank">Video 1</a></i></td> <td align="center"><a href="running_the_code/01_install_and_usage.md">01_install_and_usage.md</a> ยท <a href="running_the_code/02_modal_endpoints.md">02_modal_endpTruncated for display โ read the full file on GitHub.
Related Skills
claude-mem
113.8kPersistent Context Across Sessions for Every Agent โ Captures everything your agent does during sessions, compresses it with AI, and injects relevant context back into future sessions. Works with Claude Code, OpenClaw, Codex, Gemini, Hermes, Copilot, OpenCode + More
Understand-Anything
91.0kGraphs that teach > graphs that impress. Turn any code into an interactive knowledge graph you can explore, search, and ask questions about. Works with Claude Code, Codex, Cursor, Copilot, Gemini CLI, and more.
headroom
79.0kCompress tool outputs, logs, files, and RAG chunks before they reach the LLM. 20% fewer tokens for coding agents, 60-95% fewer tokens for JSON, same answers. Library, proxy, MCP server.
CowAgent
47.8kOpen-source personal AI assistant & Agent Harness. Plans tasks, runs tools and skills, self-evolves with memory and knowledge. Multi-agent, multi-model, multi-channel. Lightweight, extensible, one-line install.
Languages
Trust signals
From repository metadata: license, adoption, age and documentation. Not a code audit โ see the Safety scan above for what the skill file itself contains.
