Open Source
Explore the latest AI open-source projects from GitHub and HuggingFace.
Explore the latest AI open-source projects from GitHub and HuggingFace.
learn-claude-code is an open-source educational repository from shareAI-lab that teaches developers how to build a production-grade AI coding agent from first principles, progressing through 12 carefully structured sessions that each introduce exactly one new mechanism to the core agent loop. Subtitled "Bash is all you need", the project demystifies how tools like Claude Code actually work by having learners construct a nano Claude Code-equivalent from scratch in Python and TypeScript. ## The Core Insight: One Loop, Twelve Layers The fundamental thesis of learn-claude-code is that sophisticated AI agents are not mysterious: they are structured accumulations of simple, composable mechanisms layered onto a single core pattern. That pattern is the agent loop: receive a user message, call the LLM, evaluate the response, execute any requested tools, update the context, and repeat. By introducing one mechanism per session while keeping every previous mechanism running, the repository shows learners exactly what each layer contributes to agent capability. After session 12, the learner has built a multi-agent team capable of parallel task execution with git worktree isolation — not by following a tutorial, but by understanding why each component exists. ## Session Progression The twelve sessions advance from a bare-bones agent loop (session 1) through increasingly sophisticated capabilities. Sessions 2 and 3 introduce planning infrastructure with a TodoManager that gives the agent structured task management. Sessions 4 and 5 add knowledge loading and skill injection, enabling the agent to load relevant context before tackling a task. Sessions 6 and 7 focus on context compression: a 3-layer compact system that summarizes older content to prevent context window overflow while preserving recent exchanges verbatim. Sessions 8 and 9 introduce task persistence with dependency graphs stored as JSON, allowing the agent to resume interrupted workflows and track which subtasks block others. Sessions 10 and 11 implement team coordination protocols: JSONL mailbox messaging between agent instances, a shutdown/plan-approval finite state machine, and autonomous self-organization behaviors. Session 12 adds git worktree isolation that gives each parallel task its own branch and working directory, enabling true concurrent execution without merge conflicts. ## Why This Matters for Production Teams The patterns taught in learn-claude-code are not academic exercises: they are the same architectural decisions that production agent frameworks make. Understanding how context compression works internally helps teams configure their agents more effectively. Understanding the agent loop demystifies error behavior. Understanding multi-agent coordination protocols helps architects design robust pipelines. The repository explicitly positions itself as preparation for building with the Kode Agent CLI and Kode Agent SDK, the team's production-ready tools built on the same architectural foundations. ## Documentation and Accessibility The repository ships with documentation in English, Chinese, and Japanese, reflecting an international developer community. An interactive Next.js-based web platform provides step-through visualizations of each session's architecture, making abstract loop diagrams concrete. Each session includes a fully runnable Python reference implementation requiring only an Anthropic API key to execute. ## Technical Stack The codebase is primarily TypeScript (60%) and Python (38%), mirroring the stack used in production AI development. The Python implementations serve as the canonical reference for each session's concepts, while TypeScript powers the web visualization platform and aligns with how most production agent tooling is actually built. ## Community and Ecosystem With 20,900 GitHub stars and 4,100 forks, learn-claude-code has become one of the most popular educational AI agent repositories on GitHub. The MIT license makes it freely usable for commercial training programs, bootcamps, and internal team education. Related repositories from shareAI-lab include claw0, a companion teaching repo for always-on assistant patterns, and mini-claude-code for teams wanting an even more minimal starting point.