explaingit

bozhoudev/14days-build-claude-code-cli

Analysis updated 2026-05-18

172MDXAudience · vibe coderComplexity · 3/5LicenseSetup · moderate

TLDR

A 14-day hands-on tutorial for building your own AI coding agent from scratch in Python, modeled on how Claude Code works internally.

Mindmap

mindmap
  root((14 Days Build Claude Code CLI))
    What it does
      Teaches agent internals
      Rebuilds a code harness
      Python from scratch
    Tech stack
      Python
      DeepSeek endpoint
      MCP plugin system
    Use cases
      Learn coding agent design
      Follow daily tutorial path
      Build a free agent CLI
    Audience
      Vibe coders
      Learners
    Structure
      Days 1 to 7 core CLI
      Days 8 to 14 advanced
      Reference snapshots

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Learn how AI coding tools like Claude Code work by rebuilding one step by step.

USE CASE 2

Follow a structured 14-day path from a basic CLI agent to a multi-agent system with plugins.

USE CASE 3

Build a cheap or free coding agent using a DeepSeek-compatible endpoint instead of paid APIs.

What is it built with?

PythonMDXMCP

How does it compare?

bozhoudev/14days-build-claude-code-clifreecodecamp/contributemli/docs
Stars17213823
LanguageMDXMDXMDX
Setup difficultymoderateeasyeasy
Complexity3/51/51/5
Audiencevibe coderdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · moderate Time to first run · 1h+

Uses a DeepSeek-compatible endpoint by default so it can be followed without paying for Claude API calls.

Use freely for any purpose, including commercial use, as long as you keep the copyright notice.

In plain English

This is a 14-day tutorial project for building a code agent from scratch in Python. A code agent is a program that can read files, edit code, run terminal commands, and talk to an AI model to complete programming tasks. The goal here is not to produce a polished product but to understand how the outer layer around an AI model, called a harness, is actually structured. The tutorial uses Claude Code as the design reference. The author studied a publicly available source snapshot of Claude Code to understand how it handles things like tool calls, permissions, file editing, session memory, and subagents, then rebuilt those ideas in Python so learners can run and modify each piece themselves. The AI model used in the examples is configurable, by default it points to a cost-friendly DeepSeek endpoint that is compatible with the Anthropic API format, so you can follow along without paying for Claude API calls, though switching to Claude or any other compatible service is straightforward. The 14 days are split into two halves. The first seven days build a working single-agent CLI that can accept prompts, call the model, use tools, read and edit files safely, run bash commands with a permission system, and save sessions. The second seven days extend it with plan mode, skills, subagents, context compression, a simple multi-agent coordinator, isolated work directories called worktrees, and a plugin system called MCP that lets you add external tools. Each day has a tutorial document and a reference snapshot directory under packages/ with a working implementation you can run directly. The learning path involves building in your own project folder while consulting those snapshots, not copying each day's folder wholesale. A web-based version of the tutorial also lives in the repository under agent-code-learn/ and can be previewed locally with npm. The project is not affiliated with Anthropic and is released under the MIT license.

Copy-paste prompts

Prompt 1
Walk me through Day 1 of this tutorial to build the first working single-agent CLI.
Prompt 2
Explain how the permission system for running bash commands is implemented in this project.
Prompt 3
Show me how to swap the default DeepSeek endpoint for the Claude API in this tutorial's code.
Prompt 4
Help me understand how the subagent and context compression features work by Day 14.

Frequently asked questions

What is 14days-build-claude-code-cli?

A 14-day hands-on tutorial for building your own AI coding agent from scratch in Python, modeled on how Claude Code works internally.

What language is 14days-build-claude-code-cli written in?

Mainly MDX. The stack also includes Python, MDX, MCP.

What license does 14days-build-claude-code-cli use?

Use freely for any purpose, including commercial use, as long as you keep the copyright notice.

How hard is 14days-build-claude-code-cli to set up?

Setup difficulty is rated moderate, with roughly 1h+ to a first successful run.

Who is 14days-build-claude-code-cli for?

Mainly vibe coder.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.