learn-claude-code: Build AI Coding Agents from Scratch with Python
This repository profile is provided by osrepos.com, an open source repository discovery platform.

Summary
The learn-claude-code repository offers a progressive tutorial to demystify AI coding agents like Claude Code, Kode, and Cursor Agent. It teaches users how modern AI agents work by building them from scratch, starting with a minimal 16-line Bash agent. This project emphasizes the core concept of "Model as Agent" through five evolving versions.
Repository Information
Topics
Click on any tag to explore related repositories
Use at your own risk
OSRepos shares public repositories for knowledge and discovery only. Any installation, execution, configuration, or use of code from these repositories is the user's own responsibility. Always review the repository, source code, dependencies, licenses, and security implications before running or installing anything. OSRepos is not responsible for issues, damages, or losses resulting from third-party repositories.
Introduction
The learn-claude-code repository by shareAI-lab provides a comprehensive, progressive tutorial for understanding and building AI coding agents. This project aims to demystify how powerful agents like Claude Code, Kode, and Cursor Agent function, guiding you through the process of creating one from the ground up. Starting with a remarkably concise 16-line Bash agent, the tutorial evolves through five versions, each introducing a fundamental concept to build a sophisticated AI agent. The core philosophy, "Model as Agent," is central to this learning journey, demonstrating that the model's capabilities, combined with simple tools, are the secret to effective agent design.
Installation
Getting started with learn-claude-code is straightforward. Follow these steps to set up the environment and run the agent versions:
# Install dependencies
pip install -r requirements.txt
# Configure your API
cp .env.example .env
# Edit .env with your API key (supports Anthropic, OpenAI, Gemini, etc.)
# Run any version
python v0_bash_agent.py # Minimal
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
Examples
The repository presents a unique learning path through five distinct agent versions, each building upon the last:
- v0: Bash is All You Need (~50 lines, ~16 lines for mini version): Introduces the simplest agent with just one Bash tool, demonstrating that the core agent logic can be incredibly compact. It uses recursive self-calls for subagents.
- v1: Model as Agent (~200 lines): Expands to four core tools (bash, read, write, edit), showcasing the complete agent loop within a single function.
- v2: Structured Planning (~300 lines): Integrates a Todo tool to enable explicit planning and manage complex tasks with constraints.
- v3: Subagent Mechanism (~450 lines): Introduces a Task tool to spawn isolated child agents, maintaining clean context management.
- v4: Skills Mechanism (~550 lines): Adds a Skill tool and
SKILL.mdfiles, providing on-demand domain expertise and treating knowledge as a first-class citizen.
The core pattern for every coding agent is elegantly simple:
while True:
response = model(messages, tools)
if response.stop_reason != "tool_use":
return response.text
results = execute(response.tool_calls)
messages.append(results)
Additionally, the repository includes an Agent Builder Skill to help scaffold new agent projects:
# Scaffold a new agent project
python skills/agent-builder/scripts/init_agent.py my-agent
# Or with 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)
Why Use learn-claude-code?
This repository is an invaluable resource for anyone looking to truly understand the mechanics behind modern AI coding agents. By building agents from scratch, you gain deep insights into:
- Fundamental Agent Concepts: Learn the core principles of tool use, planning, subagents, and skills that power sophisticated AI systems.
- Practical Implementation: Get hands-on experience with Python code that demonstrates these concepts in a clear, incremental manner.
- Demystifying AI: Break down the complexity of AI agents into manageable, understandable components, proving that "the model is 80%, code is 20%."
- Foundation for Custom Agents: Use this project as a template to fork and customize for your own agent development needs.
It's an educational journey that reshapes your understanding of what makes a true AI agent.
Links
- GitHub Repository: https://github.com/shareAI-lab/learn-claude-code
- Related Projects:
- Deep Dive Documentation:
Related repositories
Similar repositories that may be relevant next.

LobeHub: Your Chief Agent Operator for AI Team Orchestration
August 8, 2026
LobeHub acts as a Chief Agent Operator, streamlining the management of your AI team. It enables hiring, scheduling, and reporting on agents for 24/7 operations, allowing users to maintain control without constant online presence. This platform transforms individual AI tools into a cohesive, productive team.

QwenPaw: Your Personal AI Assistant for Local and Cloud Deployment
August 7, 2026
QwenPaw is a powerful personal AI assistant designed for easy installation and deployment, either on your local machine or in the cloud. It supports multiple chat applications and offers highly extensible capabilities, making it a versatile tool for various AI-driven tasks. With its robust memory system and security features, QwenPaw aims to be an intuitive and private partner in your digital life.

ReMe: An Advanced Memory Management Kit for AI Agents
August 7, 2026
ReMe is an innovative, local-first memory layer designed for AI agents, transforming conversations and resources into file-based long-term memory. It continuously indexes, links, and consolidates this information, enabling advanced recall and supporting the development of self-evolving agents. This kit helps agents remember and refine their experiences effectively.

Hermes WebUI: A Powerful Web Interface for Your Autonomous AI Agent
June 1, 2026
Hermes WebUI provides a lightweight, dark-themed web application for interacting with Hermes Agent, offering full parity with the CLI experience. This self-hosted interface allows users to manage sessions, browse workspaces, and control their AI agent from any web browser or phone, enhancing accessibility and user experience. It integrates seamlessly with existing Hermes Agent setups, requiring no additional configuration.
Source repository
Open the original repository on GitHub.
8 counted GitHub visits