mini-claude-codeEnglish | 简体中文
Sister Projects: - mini-spring (simplified Spring framework) - mini-spring-cloud (simplified Spring Cloud framework) - mini-netty (simplified Netty framework)
mini-claude-code is a simplified Java implementation of the Claude Code programming agent that helps you quickly understand the core principles behind coding agents. The project extracts key mechanisms from the Agent Harness with extremely simplified code while preserving core functionality, including Agent Loop, tool dispatch, permission control, hooks, todo planning, subagents, skill loading, context compression, memory systems, task orchestration, background tasks, cron scheduling, multi-agent collaboration, team protocols, autonomous task claiming, and MCP plugins.
Each chapter breaks down one core mechanism of a coding agent, with each chapter on its own branch containing only the minimum code needed to understand that mechanism.
If this project helps you, please give it a STAR, thank you!
Requires Java 17 and Maven.
Before running demos with a real model, set these environment variables in your shell:
export ANTHROPIC_BASE_URL='Your Anthropic-compatible API Base URL, e.g. https://api.deepseek.com/anthropic'
export MODEL_ID='Your model ID'
export ANTHROPIC_API_KEY='Your API Key'
Each chapter has its own teaching branch. For example, to study s01:
git switch s01-agent-loop
Run a specific demo with Maven:
mvn -q compile exec:java -Dexec.mainClass=org.miniclaudecode.demo.S01AgentLoopDemo
Or use the provided script:
./run.sh s01
Read changelog_en.md
Pull Requests are welcome.
$ claude mcp add mini-claude-code \
-- python -m otcore.mcp_server <graph>