Learn Claude Code: dissecting an agent harness, lesson by lesson
shareAI-lab/learn-claude-code · 77,597★ · 12,474 forks
Everything worth knowing about shareAI-lab/learn-claude-code: an open-source course that builds, from a minimal loop, the components of a coding-agent harness.
What Learn Claude Code is
Learn Claude Code does not distribute Claude Code and does not claim to be a production-ready substitute. It is an educational repository from shareAI that teaches how to build an agent harness: the environment that gives a model tools, knowledge, observation, action interfaces, and permissions.
The README’s central thesis is deliberately blunt: the capacity to reason and act comes from the model’s training; the surrounding software does not create it. The harness engineer’s job is to build the operating environment. That is why each chapter adds one mechanism around the same loop: ask the model for a response, execute the tool calls, feed the results back, and repeat while there are calls left.
The current curriculum contains twenty runnable Python chapters, from s01_agent_loop to s20_comprehensive. It starts with Bash and the tool loop, and works up to permissions, hooks, planning, subagents, on-demand skill loading, context compaction, memory, error recovery, persistent tasks, background processes, scheduling, teams, worktree isolation, and MCP.

The origin: from a minimal clone to a harness-engineering course
The repository was created on June 29, 2025 by the GitHub organization shareAI, which describes itself as a group building for agents and lists Singapore as its location. Its repository presents itself as a “0 to 1” learning project, not as an internal Anthropic implementation.
The narrative takes Claude Code as a reference point because, according to the project itself, it shows a design where the model decides and the harness supplies tools, context, boundaries, and a workspace. The metaphor is explicit: the model is the driver and the harness is the vehicle. That explains both the name and the project’s central tension: it reproduces observable, documented patterns from a coding agent, but the didactic code deliberately simplifies production mechanisms.

The README acknowledges an important transition: the root folders s01_* through s20_* are the current canonical course; docs/, agents/, and the web app preserve the older twelve-lesson path for existing links and readers. Their chapter numbers should not be mixed.
Philosophy and principles
- Model and harness have different responsibilities. Intelligence is attributed to the trained model; the harness supplies actions, information, observation, and controls.
- A stable loop, composable capabilities. Chapters expand the tool registry and the outer layers without rewriting the main loop.
- A readable minimum before premature hardening. The repository deliberately omits or simplifies abstractions, defensive checks, and parts of error handling so that each lesson isolates one idea.
- Context and permissions are part of the product. On-demand skill loading, compaction, memory, action approval, and isolation are not incidental details: they define what the model can do and with what information.
- Coordination needs explicit state. The second half of the course uses persisted task graphs, asynchronous mailboxes, message contracts, and isolated working directories, instead of trusting a single context to remember everything.

How it works
The base pattern is an agent_loop(messages) function: it calls the model’s API with a system message and the tool catalog; if the response contains tool_use, it runs the TOOL_HANDLERS handlers, appends their results to messages, and queries the model again. If there is no call, it stops.
Around that mechanism, the course orders twenty pieces:

- Execution and control:
s01the loop,s02the tool registry,s03permissions, ands04pre- and post-tool hooks. - Complex work:
s05TodoWriteplanning,s06subagents with fresh context,s07skill loading, ands08history compaction. - Continuity and recovery:
s09memory,s10system-prompt assembly, ands11failure classification, retries, and fallback paths. - Long-running and collective work:
s12an on-disk task graph,s13background processes,s14scheduling,s15–s17teams and self-assignment, ands18task-bound worktrees. - Extension and synthesis:
s19integrates external tools via MCP;s20combines all the pieces into a full demonstration harness.

The declared scope matters: the course does not implement the full semantics of MCP events, approval, session lifecycle, transport, and OAuth, nor does it claim that its JSONL mailbox protocol is the internal implementation of any commercial product.
Official and semi-official status
The project is independent and educational. GitHub hosts it under shareAI-lab; the README calls Claude Code a design reference and requires an ANTHROPIC_API_KEY in the initial example, but the sources retrieved do not establish that Anthropic publishes, endorses, or lists it in an official marketplace.
In practice it functions as semi-official material only in the colloquial sense that it explains patterns associated with Claude Code; no evidence of certification, commercial affiliation, or standard status was retrieved. Its implementations should be treated as learning examples, not as documentation of Claude Code’s internal behavior.
The ecosystem
shareAI’s repositories
A query to the GitHub API retrieved twelve public repositories from the organization. Those explicitly related to this course are:
shareAI-lab/Kode-CLI— a coding-agent CLI that the README proposes as a next step; 5,203 stars.shareAI-lab/kode-agent-sdk— a library for integrating agent capabilities into applications; 389 stars.shareAI-lab/kbench— evaluation tools for agent harnesses; 14 stars.shareAI-lab/shareAI-skills— a collection of skills for building agents and systems; 307 stars.shareAI-lab/claw0— a sibling tutorial about a persistent harness with heartbeat, scheduling, messaging, memory, and personality; 3,234 stars.shareAI-lab/mini-claude-code— another learning resource for building a similar agent from scratch; 371 stars.shareAI-lab/ai-cloud-station— a cloud development environment that includes AI-assisted coding tools; 114 stars.
These relationships come from the README’s links or the organization’s own descriptions; they do not prove a technical dependency among all of them.
Ports, forks, and community materials
The forks API and repository search surface concrete derivatives:
wulawulu/learn-claude-code-rs, a Rust port that declares coverage of the loop, tools, subagents, memory, teams, worktrees, and MCP; 125 stars.Chris-debug-0225/learn-claude-code-java, a Java version aimed at learning the essential architecture of a coding agent; 100 stars.i5ting/learn-claude-code-js, a JavaScript version that only keeps Chinese text; 98 stars.zzjzz9266a/learn-claude-code-ts, a fork described as a TypeScript version; 9 stars.7shi/learn-ollama-code, a fork that adapts the example to Ollama; 4 stars.sixdog06/learn-claude-code-java, a Java fork with a Chinese description; 2 stars.
The main repository also ships README files in Chinese, English, and Japanese. Ports and forks are community work: a fork’s existence does not imply shareAI’s support or functional equivalence with the original.
Repo numbers
Measured: August 8, 2026, GitHub API.
| Metric | Value |
|---|---|
| Stars | 73,551 |
| Forks | 11,923 |
| Real subscribers | 296 |
| Open issues reported by the API | 67 |
| Primary language | Python |
| License | MIT |
| Created | June 29, 2025 |
| Last code push | July 28, 2026 |
| GitHub releases | None retrieved |

The top contributors returned by the API were Gui-Yue and CrazyBoyM with 34 contributions each, followed by Bill-Billion with 27 and chablino with 7. No total commit count is reported because no verifiable pagination was retrieved to calculate one.
The API returns watchers_count as identical to the star count; that’s why the table uses subscribers_count for real subscribers. open_issues_count can also include open pull requests, so it does not necessarily equal issues alone. The updated_at date returned by the API is August 8, 2026; it is transcribed as API metadata, not as proof of activity beyond the last retrieved push.
How to contribute
The contribution guide defines a restrictive process to protect the project’s teaching character:
- Link the change to a specific issue and limit each pull request to one problem.
- Keep the pedagogical code minimal: do not add production hardening, abstractions, error-handling layers, or a test framework unless the lesson is specifically about that.
- Keep each chapter’s three language READMEs in sync and keep their code blocks identical.
- Modify the current
sNN_topic/folders, not the older mirrors. - Declare AI assistance and take responsibility for the change.
The project closes, without detailed review, bulk agent-generated pull requests, ones that expand the didactic structure, and ones not linked to an issue. It is a review policy, not an accusation against the use of agents.
Quick-start guide
Installation and first run
The current curriculum requires Git, Python, and a configured Anthropic key. The exact published sequence is:
git clone https://github.com/shareAI-lab/learn-claude-code
cd learn-claude-code
pip install -r requirements.txt
cp .env.example .env # set ANTHROPIC_API_KEY
python s01_agent_loop/code.py

The first program runs the minimal example: a loop plus Bash. The README recommends starting with s01_agent_loop/ and continuing in order through s20_comprehensive/, because each chapter assumes the previous ones.
Common workflows
- Understand the minimal pattern: run
python s01_agent_loop/code.py, read the chapter’sREADME.md, and compare the loop againstTOOL_HANDLERS. - Study context management: run
python s08_context_compact/code.py; the chapter gathers compaction strategies for long sessions. - See the full integration: run
python s20_comprehensive/code.py, which assembles the pieces covered in earlier lessons around the same loop. - Open the legacy web platform:
cd web && npm install && npm run dev; it is served athttp://localhost:3000, but presents the older twelve-lesson path, not the current twenty.
Essential configuration
.env: created from.env.exampleand holds theANTHROPIC_API_KEYsetting the quick start requires.requirements.txt: pins the examples’ Python dependencies.sNN_topic/code.py: the runnable, self-contained implementation of a given lesson.sNN_topic/README.md,README.en.md, andREADME.ja.md: the explanation and translations that must be kept coordinated when contributing.web/: the legacy platform application; not to be confused with the canonical root folders.
Common pitfalls and fixes
- Mixing old and new chapters: the README warns that numbering does not always match. For new learning, use only
s01_agent_loop/throughs20_comprehensive/; reservedocs/,agents/, andweb/for the legacy course. - Treating the example as a production product: the declared scope excludes several full layers of permissions, hooks, session lifecycle, and MCP. Use it to understand designs, not to copy it without reviewing your own security and reliability requirements.
- Trying to fix an intentional simplification: before opening an issue or pull request, check the contribution guide; many omissions are an explicit part of the lesson.
- Changing only one translation: when modifying a chapter’s code or README, update all three READMEs and keep their code blocks identical.
Integrations and migration
The final lesson explains an integration via MCP, where external services enter the same tool set as the agent. The course also teaches terminal tools, memory, tasks, background execution, and worktrees; these are patterns for integrating a harness with a local project.

To move from the material to your own software, the README points to Kode-CLI and kode-agent-sdk. For the persistent-assistant pattern, it links claw0. No guide was retrieved for migrating a Claude Code installation toward this repository, because Learn Claude Code is a course, not an installable replacement for Anthropic’s product.
How the community received it
The retrievable external evidence is limited, but it includes one concrete opinion and two direct submissions:
- On Hacker News, submission 46454313, posted by ddmng on January 1, 2026, linked directly to the repository and reached 4 points and 1 comment.
- Submission 47321215, by Oras on March 10, 2026, linked to the same repository along with the project’s description; it registered 1 point and 0 comments. It establishes reach, not an independent review.
- In the parent thread 47638810, user Imanari linked the
agents/folder and opined that it was excellent for explaining, layer by layer, a coding agent similar to Claude Code. The comment is an individual assessment. No verifiable figures for the parent thread were retrieved in the search response, so no points or comment total are attributed to it.
GitHub provides maintenance and friction signals typical of a course still evolving: issue #200 gathered 24 comments about documentation updates; #226 asked about a full documentation overhaul and received 12 comments; and #290 remains open with 10 comments about downloading or compacting context. These are technical and transitional topics about the material, not a representative survey.
The YouTube search did return related content, but it was mostly automated or visualization-based: “GitHub - shareAI-lab/learn-claude-code…”, from the channel GitHub Daily Trend AI Podcast, showed 17 views and ran five and a half minutes; “shareAI-lab/learn-claude-code - Gource visualisation”, by Gourcer, had 209 views and lasted seventeen seconds. The first result is an aggregation resource and the second a history visualization, not independent reviews.
No verifiable evidence of relevant threads on Reddit, public posts on X, a Product Hunt page, Dev.to or Hashnode articles, or npm or PyPI packages for this project was retrieved. The absence of retrieved evidence does not prove such mentions do not exist: Reddit, X, and Product Hunt limited automated search.
Learn Claude Code versus other proposals
| Proposal | Verified overlap | Verified difference |
|---|---|---|
shareAI-lab/mini-claude-code | shareAI material for learning to build an agent similar to Claude Code. | The retrieved description does not document a twenty-chapter curriculum; it presents itself as a separate learning project. |
shareAI-lab/Kode-CLI | Both belong to shareAI, and the course README proposes it as a follow-up step. | Kode-CLI is an agent CLI that supports skills and LSP; Learn Claude Code is the didactic material explaining harness components. |
shareAI-lab/kode-agent-sdk | Both are about building agent products around a harness. | The SDK is described as an integrable library; this repository is structured as Python chapters and explanations. |
wulawulu/learn-claude-code-rs | Declares the same didactic goal of covering the loop, tools, memory, teams, worktrees, and MCP. | It is a community Rust port; the main project uses Python and has its own curriculum, web app, and translations. |
Chris-debug-0225/learn-claude-code-java | Presented as a Java version for learning a coding agent’s architecture. | It is a community implementation in Java, not an official shareAI branch. |
Use cases and who this repository can help
- Engineers designing a coding harness can work through the course to separate model decisions from the tool, permission, context, and observation mechanisms they need to implement outside of it.
- Teams prototyping agent coordination can study the chapters on persistent tasks, mailboxes, protocols, self-assignment, and worktrees as small examples before adopting a larger architecture.

- People integrating external tools with an agent can use
s19_mcp_pluginas a conceptual starting point for discovering and routing MCP tools into a single action set. - Maintainers of multilingual technical tutorials can draw on the contribution policy as a concrete example of keeping code and translations synchronized without sacrificing pedagogical focus.
- Anyone who needs a production agent can find a map of components here, but will need to add the deliberately omitted controls and evaluate the model, credentials, limits, and security of their own environment.

Resources
- Repository: https://github.com/shareAI-lab/learn-claude-code
- Documentation and platform: https://learn.shareai.run/
- Getting started and installation: https://github.com/shareAI-lab/learn-claude-code#quick-start
- Contribution guide: https://github.com/shareAI-lab/learn-claude-code/blob/main/CONTRIBUTING.md
- Sibling persistent-harness repository: https://github.com/shareAI-lab/claw0
- Related CLI and SDK: https://github.com/shareAI-lab/Kode-CLI, https://github.com/shareAI-lab/kode-agent-sdk
- Hacker News threads: https://news.ycombinator.com/item?id=46454313, https://news.ycombinator.com/item?id=47321215, https://news.ycombinator.com/item?id=47638810
- Retrieved videos and visualizations: YouTube search https://www.youtube.com/results?search_query=shareAI-lab+learn-claude-code
Note: this article combines the repository’s README and contribution guide, the GitHub API, Hacker News, and the official platform, consulted on August 8, 2026. Figures correspond to that point in time.
Comments