How shareai-lab/learn-claude-code works
Learn Claude Code is an educational site and companion collection of progressively richer Python harness examples, not a deployed agent service. A learner opens a versioned lesson, then explores its explanation, runnable simulation, source, and architecture deep dive; the repository’s examples teach the agent loop and harness capabilities such as tools, permissions, knowledge loading, context management, and coordination. The version page-to-client relationship and the client’s rendered panels are visible in excerpts. Other example-to-capability relationships are based on README descriptions or are left unverified where implementation excerpts are absent.
Main entry points: s01_agent_loop/code.py Agent loop · s02_tool_use/code.py Tool execution · s10_task_system/code.py Persistent tasks · s15_integrated_harness/code.py Integrated harness
Components 19
Learning site
- Version lesson
web/src/app/[locale]/(learn)/[version]/page.tsx - Lesson panels
web/src/app/[locale]/(learn)/[version]/client.tsx - Version diff
web/src/app/[locale]/(learn)/[version]/diff/diff-content.tsx - Loop simulator
web/src/components/simulator/agent-loop-simulator.tsx
Harness examples
- Agent loop
s01_agent_loop/code.py - Tool execution
s02_tool_use/code.py - Permission boundaries
s03_permission/code.py - Lifecycle hooks
s04_hooks/code.py - On-demand skills
s07_skill_loading/code.py - Context compaction
s08_context_compact/code.py - Agent memory
s09_memory/code.py
Agent coordination
- Persistent tasks
s10_task_system/code.py - Background work
s11_background_tasks/code.py - Agent teams
s13_agent_teams/code.py
Runtime extensions
- MCP plugins
s14_mcp_plugin/code.py - Integrated harness
s15_integrated_harness/code.py - Workflow runtime
s16_workflow_runtime/code.py - Goal loop
s17_goal_loop/code.py
Other components
- Learner
Connections 18
- Learner → Version lesson: opens lesson
web/src/app/[locale]/(learn)/[version]/page.tsx - Version lesson → Lesson panels: renders
web/src/app/[locale]/(learn)/[version]/page.tsx - Lesson panels → Loop simulator: renders simulator
web/src/app/[locale]/(learn)/[version]/client.tsx - Learner → Version diff: opens comparison
- Learner → Agent loop: studies example
README.md - Agent loop → Tool execution: adds tools
README.md - Tool execution → Permission boundaries: adds boundaries
README.md - Agent loop → Lifecycle hooks: extends harness
- Agent loop → On-demand skills: loads knowledge
README.md - Agent loop → Context compaction: manages context
README.md - Context compaction → Agent memory: extends continuity
- Agent loop → Persistent tasks: persists goals
README.md - Persistent tasks → Background work: adds async work
- Persistent tasks → Agent teams: coordinates agents
- Tool execution → MCP plugins: adds integrations
- Agent loop → Integrated harness: combines mechanisms
- Integrated harness → Workflow runtime: adds workflows
- Integrated harness → Goal loop: extends autonomy