shareAI-lab

learn-claude-code: Learn to Build LLM Agent Harnesses

A hands-on Python tutorial for building the harness around an LLM coding agent, from a basic tool loop to permissions, memory, teams, and workflows. Suited to developers who want to understand agent infrastructure by studying small runnable examples.

View on GitHub Compare
Stars
78k
Forks
12.5k
Stars, last 30 days
+1,844

Our take

Health score

63/100

How it is scored
Activity
43
Community
72
Issues
66
Pull requests
70

+1,844 stars in the last 30 days

Project history

Daily GitHub snapshots since Oct 7, 2026. History covers stars and forks; health signals are not tracked historically.

Selected snapshot

Stars

80,166

Forks

12,827

Change since Nov 9, 2026: +86 stars·+16 forks

Overview

learn-claude-code is a progressive tutorial for building the software surrounding an LLM agent: the tools, context management, permissions, and coordination mechanisms that let a model operate in a coding environment. Its central teaching approach is to start with a small agent loop and add one harness mechanism at a time, rather than treating a large orchestration framework as the agent itself.

The repository is most useful as a learning resource, not as a ready-made coding agent. Its current course has 17 lessons with standalone Python examples, and its README distinguishes that track from a legacy 12-lesson version. It is aimed at developers who want to understand or prototype agent infrastructure and can work with an Anthropic API key.

Key Features

  • Seventeen progressive lessons, each focused on a specific agent-harness mechanism.
  • Runnable Python examples covering tool use, permissions, hooks, planning, subagents, and context compaction.
  • Lessons on persistent memory, task graphs, background work, scheduling, and agent-team coordination.
  • Examples of MCP tool integration, an integrated harness, workflow execution, and goal-based continuation.
  • English, Chinese, and Japanese chapter materials, according to the README.
  • A web app for exploring the course, alongside standalone chapter code.

Use Cases

  • A developer new to LLM agents can follow the lessons to understand how a model calls tools and receives results.
  • An engineer prototyping a coding agent can use the examples to study permissions, context handling, and task persistence before choosing a production architecture.
  • An educator or team lead can use the course structure to teach harness concepts in small, runnable steps.
  • A developer extending an agent with external tools can study the MCP lesson and how those tools fit into a shared tool pool.

Getting Started

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_KEY
python s01_agent_loop/code.py

Start with the repository README for the course map, setup details, and guidance on the current and legacy tracks.

Alternatives

  • ai-engineering-from-scratch: Covers a broad AI engineering curriculum, including agents and protocols, rather than focusing on building a Claude Code harness.
ProjectLanguageLicenseStarsStatus
learn-claude-codePythonMIT78kNot checked yet
ai-engineering-from-scratchPythonMIT62.9kActive

Considerations

  • Running the examples requires Python dependencies and an Anthropic API key; the README's quick start uses pip and an .env file.
  • The repository is a tutorial and set of examples, so it should not be assumed to provide a production-ready agent or deployment safeguards.
  • The README identifies the root-level 17-lesson course as current and docs/ and agents/ as a legacy transition track. Readers should avoid mixing their lesson numbering.
  • The concepts are centered on coding-agent harnesses. Applying them in other domains requires adapting tools, knowledge, permissions, and interfaces.

Found this useful?

Share it with someone who would like learn-claude-code.

Comparisons