Skip to content

About

Build your own Claude Code in 5 days by guiding OpenClaw with simple explanations, structured design docs, and test-driven implementation.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

Build Your Own Claude Code in 5 Days

Build your own 24/7 AI coding assistant from scratch using OpenClaw

中文版

What is this?

A step-by-step tutorial that guides you to build an AI coding assistant similar to Claude Code from scratch.

No programming experience required - we explain every concept in plain language, then let OpenClaw (AI agent) write the code for you.

What will you get?

An AI assistant that can:

  • Chat with you in the terminal
  • Read and modify files on your computer
  • Execute shell commands (run code, install packages)
  • Understand your project structure
  • Work safely (won't delete important files)
  • Available 24/7

5-Day Learning Path

Day Topic What You'll Learn Outcome
Day 1 Minimal Chat Framework How AI "talks" A CLI that can chat
Day 2 Tool System How AI "acts" AI can read/write files, run commands
Day 3 Permission System How to keep AI "safe" Dangerous operations get blocked
Day 4 Context System How to make AI "smarter" AI understands project, remembers conversation
Day 5 UX Polish How to make it "great" Streaming output, beautiful UI

Core Concepts (Plain English)

What is Claude Code?

Imagine you have a super assistant that you can tell in natural language:

  • "Read this file and explain what it does"
  • "Fix this bug"
  • "Run the tests"

And it will actually do it, not just tell you how.

How does it work?

┌─────────────────────────────────────────────────────────────┐
│                        You (User)                           │
│                          │                                  │
│                    "Read config.js"                         │
│                          ↓                                  │
│  ┌─────────────────────────────────────────────────────┐   │
│  │              CLI Program (what we build)             │   │
│  │                                                      │   │
│  │  1. Receive your request                             │   │
│  │  2. Send to Claude API                               │   │
│  │  3. Claude says: "I need to use ReadFile tool"       │   │
│  │  4. CLI executes ReadFile, reads the file            │   │
│  │  5. Send result back to Claude                       │   │
│  │  6. Claude summarizes and responds to you            │   │
│  └─────────────────────────────────────────────────────┘   │
│                          ↓                                  │
│                 "config.js contains..."                     │
└─────────────────────────────────────────────────────────────┘

Four Core Modules

  1. Chat Engine: Communicate with Claude API
  2. Tool System: Let AI perform actual operations
  3. Permission System: Ensure AI doesn't do dangerous things
  4. Context System: Let AI understand your project

Documentation Structure

build-your-own-claude-code/
├── README.md                    # You are here
├── docs/
│   ├── en/                      # English docs
│   │   ├── day1/
│   │   │   ├── README.md       # Concepts (for humans)
│   │   │   ├── DESIGN.md       # Specs (for OpenClaw)
│   │   │   └── TEST.md         # Test criteria
│   │   ├── day2/
│   │   ├── day3/
│   │   ├── day4/
│   │   ├── day5/
│   │   └── reference/
│   │       ├── ARCHITECTURE.md
│   │       └── GLOSSARY.md
│   └── zh/                      # 中文文档
│       └── ...

Getting Started

Prerequisites

  1. A computer (Mac/Linux/Windows)
  2. OpenClaw (your AI agent)
  3. An LLM API Key - supports multiple providers:
    • OpenAI (or any OpenAI-compatible API)
    • Anthropic (Claude)
    • Kimi (Moonshot)
    • Minimax
    • DeepSeek
    • Any OpenAI-compatible endpoint

Pro Tip: OpenClaw will configure the project to use the same model it's currently running on. This means your "my-claude" will use the same API as your OpenClaw!

First Step

Go to Day 1: Minimal Chat Framework to begin your journey!

How to Use

Documents for Humans (README.md)

  • Plain language explanations
  • Diagrams and analogies
  • Helps you understand "why"

Documents for OpenClaw (DESIGN.md)

  • Precise technical specifications
  • Code structure and interface definitions
  • OpenClaw can directly follow this to write code

Test Documents (TEST.md)

  • Clear test criteria
  • Tells you and OpenClaw when this phase is "done"
  • Ensures each phase's output is usable

Tips

  1. Follow the order: Each day builds on the previous
  2. Understand before doing: Read README before letting OpenClaw start
  3. Testing matters: Verify all tests pass before moving on
  4. Ask when stuck: Let OpenClaw explain if something is unclear

Ready? Let's start with Day 1: Minimal Chat Framework!

License

MIT

About

Build your own Claude Code in 5 days by guiding OpenClaw with simple explanations, structured design docs, and test-driven implementation.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors