← all repositories
shareAI-lab/learn-claude-code

Build the harness, not the "agent"

A 20-chapter tutorial that strips away the hype and teaches you to build the infrastructure that lets a model actually do things.

65.2k stars Python Coding AssistantsAgents
learn-claude-code
Velocity · 7d
+190
★ / day
Trend
steady
star history

What it does This repo is a from-scratch tutorial for building a Claude Code–style agent harness in Python. It walks through 20 chapters (s01_agent_loop through s20_comprehensive), each adding one layer to a single, unchanging core loop: the LLM decides, the code executes, the results loop back. The lessons cover tools, context compaction, subagent spawning, task systems with dependency graphs, async team coordination, permission governance, and MCP routing.

The interesting bit The authors are openly hostile to the “prompt-plumbing industry” — drag-and-drop workflow builders, no-code agent platforms, and orchestration libraries that “string LLM API calls together with if-else branches.” Their argument, backed by a long history lesson (DQN, OpenAI Five, AlphaStar, Tencent Jueyu), is that agency comes from model training, not your glue code. Your job is to build the vehicle, not the driver.

Key highlights

  • 20 narrative chapters with runnable code.py, translations (EN/中文/日本語), and diagrams
  • Core pattern is a ~15-line Python loop that never changes; all complexity lives in the harness mechanisms layered around it
  • Covers practical harness engineering: sandboxing, approval workflows, worktree-isolated parallel execution, memory persistence, hook extensions
  • Explicitly modeled on Claude Code’s design philosophy: “give the model tools, knowledge, context management, and permission boundaries — then get out of the way”
  • Older 12-lesson track still exists in docs/, agents/, web/ during transition

Caveats

  • Two overlapping tutorial tracks currently coexist; the README warns that “legacy and current chapter numbers do not always match”
  • The philosophical framing is strong enough that you may need to mentally filter for the actual engineering content

Verdict Worth your time if you’re building real coding agents and want to understand why Claude Code is structured the way it is, not just copy its features. Skip it if you’re looking for a drop-in framework — this is explicitly educational material, not a product.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.