Learn Claude Code offers a progressive tutorial series on AI coding agents, guiding users through practical implementations. By exploring five versions of an AI agent, users can grasp core concepts and insights to understand the intricacies of modern AI technology. Gain hands-on experience in building agents like Claude Code and expand your knowledge in this evolving field.
Learn Claude Code
This independent educational project, developed by shareAI Lab, aims to unravel the workings of AI coding agents by guiding users in building their own from the ground up. Although this project is not affiliated with Anthropic, it draws inspiration from what is regarded as one of the most capable AI coding agents, Claude Code.
The repository features a detailed tutorial that demystifies the architecture and functionality of AI coding agents, including Kode, Claude Code, and Cursor Agent. Through a progressive learning structure, it introduces five versions of an AI agent, each consisting of approximately 1100 lines of code, gradually adding complexity and refining core concepts:
| Version | Lines | Features Added | Core Insight |
|---|---|---|---|
| v0 | ~50 | 1 bash tool | Bash is all you need |
| v1 | ~200 | 4 core tools | Model as Agent |
| v2 | ~300 | Todo tracking | Explicit planning |
| v3 | ~450 | Subagents | Divide and conquer |
| v4 | ~550 | Skills | Domain expertise on-demand |
This learning experience includes not only practical code implementations but also theoretical insights. Examples can be initiated easily with predefined scripts to explore various functionalities:
pip install anthropic python-dotenv
# Configure your API
cp .env.example .env
# Edit .env with your API key
# Run any version
python v0_bash_agent.py # Minimal agent
python v1_basic_agent.py # Core agent loop
python v2_todo_agent.py # + Todo planning
python v3_subagent.py # + Subagents
python v4_skills_agent.py # + Skills
At the core of every coding agent lies a simple loop that utilizes a model to execute tool calls until completion. The design philosophy emphasizes that while the model constitutes a significant portion of the system (80%), efficient coding practices are also crucial (20%).
The repository includes an Agent Builder Skill, enabling users to scaffold new agent projects with specific complexity levels, allowing for customized learning experiences:
# Scaffold a new agent project
python skills/agent-builder/scripts/init_agent.py my-agent
# Specific complexity level
python skills/agent-builder/scripts/init_agent.py my-agent --level 0 # Minimal
python skills/agent-builder/scripts/init_agent.py my-agent --level 1 # 4 tools (default)
Key concepts explored include the importance of structured planning, the use of recursive subagents, and the integration of skills for on-demand domain expertise. Comprehensive technical tutorials and original articles are also available in both English and Chinese, catering to a broader audience.
For those looking to extend their knowledge further, related projects such as Kode, which offers a full-featured open source agent CLI, and shareAI-skills, featuring production-ready skills for AI agents, can serve as valuable resources.
This repository serves as a template for developers looking to tailor their own agent projects, fostering a deeper understanding of AI coding agents and their architectures.
No comments yet.
Sign in to be the first to comment.