Learn Claude Code — Detailed Introduction
Learn Claude Code is an independent educational project from shareAI-lab that demystifies modern AI coding agents by providing small, progressively more capable reference implementations and tutorials. The repository is designed for developers and researchers who want to understand how an agent architecture is assembled: how a model is used as an agent, how tools are exposed, and how planning, subagents, and reusable skills are implemented in practice.
Key goals and highlights
- Teach by building: five progressive example agents (v0 → v4) that gradually add concepts and abstractions so learners can follow incremental complexity.
- Hands-on code: ~1,100 lines across versions with runnable Python examples demonstrating core loops, tool use, and skill loading.
- Compatibility: examples and skills are intended to work with Kode CLI, Claude Code, Cursor, and any agent that implements the Agent Skills Spec.
- Practical focus: shows concrete patterns (tools, todo/planning, subagents, skills) that make agents useful in coding workflows.
- Independent & transparent: the repo contains a clear disclaimer that it is not affiliated with Anthropic and documents corrections to earlier speculative analyses.
What’s inside
- v0_bash_agent.py — Minimal agent (~50 lines) demonstrating that a single bash tool + loop can form an agent.
- v1_basic_agent.py — Core agent loop with 4 tools (bash, read, write, edit) and ~200 lines of code.
- v2_todo_agent.py — Adds an explicit planner/todo manager to structure multi-step tasks.
- v3_subagent.py — Introduces subagents and task isolation for divide-and-conquer workflows.
- v4_skills_agent.py — Adds a Skill mechanism and SkillLoader to request domain expertise on-demand.
- skills/ — Example skills and an agent-builder meta-skill to scaffold new agents.
- docs/ — Technical tutorials and deep dives in English and Chinese (v0–v4 explanations, context caching economics, etc.).
Quick start
pip install anthropic python-dotenv
cp .env.example .env
# set your API key in .env
python v0_bash_agent.py # Minimal
python v1_basic_agent.py # Core loop
python v4_skills_agent.py # Full skills exampleCore pattern (conceptual)
The repository emphasizes a concise core agent pattern:
while True:
response = model(messages, tools)
if response.stop_reason != "tool_use":
return response.text
results = execute(response.tool_calls)
messages.append(results)This captures the common architecture: the model calls tools until the task is complete; tools execute and return results back to the agent.
Utility & integrations
- Includes an agent-builder script to scaffold new agent projects at different complexity levels.
- Describes how to install example skills into Kode CLI and Claude Code via provided plugin URLs.
License, provenance, and metadata
- License: MIT.
- Repository clarifies it is an independent educational project and contains an explicit disclaimer regarding Anthropic/Claude Code.
- The repository is actively presented as a teaching/template resource for building production-like agents (recommendation to fork and adapt).
Who is this for
Developers and researchers learning how to build agent architectures, implement tool interfaces, structure multi-step planning, or create reusable skills for coding agents. It's suitable both as a reference implementation and as a scaffold to bootstrap new agent projects.
