claude-skill

claude-code-from-scratch – Rebuild Claude’s Core in 4k Lines

Recreate Claude’s 500k‑line codebase with a 4k‑line TypeScript/Python skeleton and an 11‑chapter guide. Ideal for founders who want to master coding agents.

From the repo · “Build your own Claude Code from scratch. 🔍 Claude Code 开源了 50 万行代码,读不动?用 ~4000 行 TypeScript / Python 从零复现核心架构,11 章分步教程带你理解 coding agent 精髓”

2,786 stars+34★ this week555 forksPythonGuide quality 9/10 · reviewed Oct 14Updated 7/9/2026100% free · open source
What it does

Create a custom coding agent from scratch using Claude Code's open-source architecture, replicating its core functionality with approximately 4,000 lines of code in Python or TypeScript.

When to use it
  • •When you need a tailored coding assistant for your specific development workflow
  • •To understand the inner workings of Claude Code and modify it to suit your requirements
  • •As a learning resource to grasp the fundamentals of coding agents and their architecture
Ready-to-paste prompt
To start building the coding agent, begin with the first chapter of the tutorial and execute the command `python chapter1.py` to initiate the setup process
Heads up: Before starting, ensure you have a good understanding of Python and TypeScript, as well as the necessary dependencies installed, and be aware that the project involves working with a large codebase of approximately 4000 lines
Saves to your device
Use with Claude
New

Skip the builder — one click puts this in Claude, Cursor, Antigravity and more.

⚡ Runs out of the box

A prompt/skill package — nothing to install beyond adding it to your AI tool.

Try it instantly — no install
Claude Code
mkdir -p ~/.claude/skills/claude-code-from-scratch && curl -fsSL https://workflowstacks.com/api/skills/claude-code-from-scratch/claude-skill -o ~/.claude/skills/claude-code-from-scratch/SKILL.md
Open in another AI app

Opens the app with this repo with the prompt ready to go — no copy-paste needed.

Connect the whole catalog (MCP)
claude mcp add --transport http workflowstacks https://workflowstacks.com/api/mcp

Adds a WorkflowStacks connector to Claude Code: search and load any skill here by chatting.

How claude-code-from-scratch – Rebuild Claude’s Core in 4k Lines works
Codeflow
Free to inspect

Claude-code-from-scratch – Rebuild Claude’s Core in 4k Lines is a large Python project (~16k lines across 62 code files, plus 22 test files). It is a full software project: use it through its install path rather than reading it end to end. Last commit 3 months ago, MIT license, has a test suite.

Size
Large codebase
~16k lines · 62 code files · ~2 h to skim
Setup
Developer setup
A real software project. Use it via its install path; don't expect to read it all.
Runs on
Node.js
Needs API keys (.env)
Python 41%TypeScript 37%JavaScript 19%HTML 3%
Where to start reading
  1. 1
    README.md
    Start here — what it does and how to install it
  2. 2
    CLAUDE.md
    The instructions the AI actually follows
  3. 3
    src/cli.ts
    Where the program starts running
  4. 4
    package.json
    Dependencies and the commands it exposes
  5. 5
    .env.example
    The API keys and settings you must provide
What's in each folder
src/Core code — the actual logic12 files
docs/Documentation17 files
steps/Folder51 files
python/Folder24 files
en/Folder18 files
test/Tests — proof it works25 files
.claude/Editor / agent settings4 files
assets/Images & static assets3 files
READMEHas testsDocumentedNo CIMIT licenseUpdated 4 mo ago
Quick Actions
Details
Creator
Windy3f3f3f3f
Language
Python
Category
claude-skill
Published
3/31/2026

Are you the creator of this tool? and earn 85% of every sale.

Show it off in your README:

Featured on WorkflowStacks
[![Featured on WorkflowStacks](https://workflowstacks.com/api/badge/claude-code-from-scratch.svg)](https://workflowstacks.com/skills/claude-code-from-scratch?utm_source=github&utm_medium=badge)
🔥 Hot this week, in your inbox
Skills like this, every Monday.

The five fastest-growing open-source AI skills, ranked by GitHub star growth. One email a week, unsubscribe anytime.