30 sec7 min coredeep dive optional
Learn Claude Code is a 77,000-star repository that teaches agent harness engineering by rebuilding a working Claude Code-style agent in 17 progressive lessons, from one tool and one loop up to multi-agent task graphs.
- Each lesson adds exactly one harness mechanism: the loop, tool dispatch, permissions, hooks, planning, subagents, skills, compaction, memory, task graphs, and more.
- The thesis is blunt: agency comes from model training, and developers build the harness the model operates through.
- Python and MIT, clone-and-run in three commands, with deep-dive folds inside the complex chapters.
- Its subagent, hook, and skill lessons map directly onto the real Claude Code features our series covers.
Every developer who uses Claude Code eventually asks what is actually underneath. Learn Claude Code, from the shareAI-lab team at shareAI-lab/learn-claude-code, answers the question the hard way: you build the thing. Seventeen lessons, each adding one mechanism, until a working agent harness exists that plans, uses tools, spawns subagents, and manages its own context.

At 77,552 stars with 12,469 forks, this is among the most-starred learning repositories in the entire agent ecosystem, and the reason is the angle: not how to use coding agents, but how one is constructed. This guide maps the course, its central argument, and where the agent harness course fits against our own Claude Code series.
The thesis: agency is trained, the harness is built
The repository opens with an argument rather than a syllabus, and the argument organizes everything else. Agency, the ability to perceive and reason and then act on it, comes from model training, not from orchestration code. The historical evidence it marshals runs from DeepMind’s Atari agents through OpenAI Five and AlphaStar to the current coding agents: every one of them is a model that learned its behavior, operating inside an environment built for it. What developers build is the environment half, the harness, and the repository’s framing is that this is a real engineering discipline with its own concerns, not a failure to be doing model training.
The corollary is a swipe at the no-code agent platform industry, which the repo dismisses as procedural pipelines with a language model wedged in as a text-completion node. Whatever you think of the sharpness, the distinction is load-bearing for the course: if agency is in the model, then harness engineering means giving that agency a well-built world to operate in, and each lesson builds one wall of that world. The framing also explains why the course targets Claude Code specifically: a harness is best learned against a model that can actually drive it, and the product supplies both a reference behavior to aim for and a public feature set to compare against.
What harness engineers actually do
The repo names the job’s five responsibilities, and they double as its curriculum map. Implement tools, atomic and clearly described actions. Curate knowledge, loaded on demand rather than upfront. Manage context, through subagents, compaction, and task persistence. Control permissions, sandboxing and approval boundaries. And collect trajectory data, because every action sequence your harness runs is potential training signal for the next model generation, a concern that ties harness work back to the training world it distinguishes itself from.
Read that list against any production agent team’s backlog and the match is close, which is the course’s quiet credibility: the lesson sequence is not arbitrary, it is the job description decomposed.
The seventeen lessons, one mechanism at a time
The track runs from s01 to s17, each lesson adding one mechanism with its own motto, and the early sequence is worth spelling out because it moves from obvious to subtle fast:
| Lesson | Mechanism | What it teaches |
|---|---|---|
| s01 | The agent loop | One tool plus one loop is already an agent; everything else is refinement |
| s02 | Tool dispatch | New tools register as handlers without touching the loop |
| s03 | Permissions | Set boundaries before granting freedom: what runs, what stops, what needs approval |
| s04 | Hooks | Extension points wrap around the loop instead of rewriting it |
| s05 | Planning | Listing steps before starting, the todo-list discipline |
| s06 to s09 | Subagents, skills, compaction, memory | Fresh message lists for subtasks, on-demand knowledge, making context room, remembering selectively |
| s10 to s13 | Task graph, background ops, schedules, teammates | File-backed task decomposition, async execution, timed triggers, multi-agent coordination |
The later lessons continue through to a goal loop in s17. The pedagogical discipline is strict, one mechanism per lesson, and it is the agent harness course’s best decision: because each lesson changes exactly one thing, you can see what each mechanism contributes, the same isolation discipline the best systems courses use.
The mottos are the review sheet
Each lesson carries a one-line motto, and the mottos are doing real pedagogical work: they compress each mechanism into a design rule you can recall under pressure. Boundaries before freedom is a permission philosophy. Hook around the loop, never rewrite it is an extensibility rule that production codebases violate at their peril. Load knowledge on demand is the entire argument for skills as a format. Context always fills up is not a warning but a design constraint, the way memory always fills up was for every computing generation before this one.
Read as a set, the mottos also form the fastest available review of agent harness engineering: if you can state the rule, you remember why the mechanism exists, and if you cannot, the lesson number tells you where to return. Few courses at any price ship a self-quizzing summary this tight, and it is worth copying the habit for any system you learn. An hour spent reciting the mottos against the mechanism list, before opening any code, is the cheapest retention test in the whole agent harness genre.
Where it meets the real Claude Code
The mapping to the product is the payoff for readers of our series. Lesson four’s hooks are the same extension-point concept as our Claude Code hooks guide. Lesson seven’s on-demand skills are the mechanism behind our skills walkthrough. Lesson six’s subagents with fresh message lists is the design our subagents guide covers from the user side, and lesson nine’s memory trio, selection, extraction, consolidation, is what makes the product’s context behavior feel considered rather than magical.
Reading the feature documentation after building the small version is a different experience: the settings and flags stop being a configuration surface and become the visible edges of mechanisms you have written yourself. That is the specific value this repository adds to a series like ours, and why it complements rather than competes with it. Treat our guides and this agent harness course as two views of one machine, the operator manual and the exploded diagram.
How to run it
The quick start is three commands, with an API key as the only credential:
git clone https://github.com/shareAI-lab/learn-claude-code
cd learn-claude-code
pip install -r requirements.txt
cp .env.example .env # configure ANTHROPIC_API_KEYChapters are read in order, s01 through s17, with complex chapters carrying deep-dive folds you open when you want depth and simple chapters staying light on diagrams. A legacy twelve-lesson track still exists for continuity, and the README warns against mixing chapter numbers between tracks, a small detail that signals how actively the course is maintained. There is also a web platform edition, and the repository is trilingual, with English, Chinese, and Japanese READMEs.
Is the argument against orchestration platforms fair?
Partly, and the unfair part is worth separating. The fair core: wiring prompt calls together with hardcoded branching produces brittle pipelines, and calling the result an agent oversells it, because the adaptive behavior users expect comes from the model, not the glue. Where the argument overreaches is in dismissing every abstraction above raw code: orchestration structure is legitimate when it encodes real domain logic, approval flows, compliance boundaries, deterministic steps that must not be improvised, and the line is whether the structure expresses requirements or substitutes for capability. The repository’s own lesson three makes exactly this distinction in miniature, permission boundaries are structure the model must respect. A fair synthesis: build harnesses when you want the model’s agency to operate, build pipelines when you need guaranteed deterministic behavior, and know at every joint which one you are in.
What comes after the seventeen lessons?
The repository points forward along two continuations. The first is the Kode line: an open-source coding agent CLI and an SDK for embedding agent capabilities into applications, positioned as the beyond-the-course artifacts from the same ecosystem. Working from the course’s harness into a maintained agent codebase is the natural next step, because you arrive knowing what every subsystem is for. The second continuation is the sister tutorial on always-on assistants, which extends the session-bound model toward persistent operation. For readers who want the systems depth in a different direction, a serving-engine build course complements this one cleanly: one teaches the agent side of the stack, the other the inference side, and together they cover most of what an agent platform engineer touches.
How does this compare with reading Claude Code’s own source?
Claude Code is open source, so the comparison is fair, and the difference is pedagogical compression. The product’s codebase is a real system with production weight: every mechanism this course teaches exists there, plus the hardening, edge cases, and platform support that shipping requires. Reading it cold teaches you what production looks like but buries the mechanisms under scale. The course is the compression: seventeen small implementations, each isolated so the mechanism is visible. The efficient path uses both, course first for the map, product source second for the territory, and engineers who try to shortcut directly into the large codebase usually learn the file layout rather than the ideas. One caution in the reverse direction: the course’s harness is deliberately minimal, so resist shipping it as-is; it exists to be understood, then grown.
Who should take this course, honestly?
Three profiles get the full value. Engineers building or evaluating agent products, because after lesson three you can interrogate any agent platform’s permission model and know what you are looking at. Developers deep in Claude Code who want the mental model to match their daily tool, which our series supplies from the user side and this course supplies from the inside. And engineers preparing for agent-infrastructure interviews, where being able to explain compaction, subagent isolation, and task persistence from implementation experience is a differentiator. Who should skip it: anyone whose relationship to agents is purely as a user, and teams who need production agent infrastructure this quarter, who should adopt a maintained framework and revisit the course for literacy later. The prerequisites are working Python and API-key-level comfort; the course teaches the rest.
What does the first lesson’s loop actually consist of?
Lesson one reduces an agent to its irreducible core, and the reduction is worth stating because everything else in the course is an elaboration of it. The loop sends the conversation, including tool results, to the model. The model responds, either finishing the task or requesting a tool. The harness executes the requested tool, appends the result, and repeats. Bash is the first tool because it is the most general action surface a computer offers, and one tool plus that loop is genuinely enough to observe agentic behavior, which most people do not believe until they watch it run. The subsequent lessons never break this shape; they wrap it with dispatch, permission, hooks, and planning, exactly as the mottos promise. If you retain nothing else from the course, retain the loop, because every agent system you will ever debug is that loop with decoration, and the decoration is where the bugs live, which is why the course teaches the plain loop first and dresses it slowly.
Does building a small harness change how you evaluate agent products?
It does, and the change is mostly immunological. Once you have implemented permission boundaries, you know exactly what to ask a vendor: what can the agent execute without approval, where are the boundaries enforced, and what happens at the edge. Once you have implemented compaction, a product’s claims about unlimited context resolve into a question about which information gets destroyed and when. Once you have implemented subagent isolation, multi-agent marketing translates into message-list separation and coordination costs, both of which have failure modes the demo never shows. The course does not position itself as procurement training, but that is a fair share of its practical value: after seventeen lessons, agent product claims become readable as engineering claims, with testable content rather than aspirational adjectives. That literacy alone justifies the course for anyone with an agent budget to spend or a vendor pitch to survive.
Is the trajectory-data responsibility premature for most teams?
The fifth responsibility, collecting action sequences as future training signal, is the course’s most forward-looking claim, and the honest answer is that it is early for most teams but not wrong. Today, the practical version is modest: log what your agent did, keep the logs queryable, and you already have debugging material that most teams lack. The stronger version, structuring those trajectories for fine-tuning the next model generation, matters when you operate enough volume for the data to be worth a training run, which describes fewer organizations. What the lesson correctly anticipates is the direction of travel: harness and training are converging, and the repository’s own framing, agency is trained while harnesses are built, quietly predicts that well-instrumented harnesses become part of the training pipeline. Building the logging habit now is cheap and ages well either way, and it is the one part of the agent harness job description that grows more valuable every model generation rather than less Put differently, the five responsibilities of the harness engineer age at different speeds: tools and permissions are stable engineering, context management improves with each framework release, and trajectory value compounds with model capability, so the job you are learning gets more interesting, not less..
How long does the full seventeen-lesson track take?
The honest planning figure is two to four evenings per cluster of mechanisms, so roughly three to five weeks of part-time study for the full agent harness track, faster for engineers already fluent in async Python. The early lessons run fast because each adds one small piece; the middle lessons on compaction and memory take longer because they interact, and the multi-agent lessons at the end reward a second pass. Budget extra time for modifying each lesson’s code after running it, because the modification step is where the mechanism stops being demo material and becomes knowledge, and skipping it halves the course’s value in exchange for a week saved.
If you use Claude Code daily and want to understand your tool rather than operate it, this is the highest-leverage week of study available: seventeen lessons, one mechanism each, ending with an agent harness you wrote and a mental model that no vendor can blur. Pair it with our feature guides for the product side of everything you build, and finish with the lesson on task graphs, because that is where the multi-agent future everyone is announcing actually has to live.