from-scratch — Claude Code skill: what it does, how to install
The from-scratch Claude Code skill teaches how a technology works by building a small version step by step. Before each run, the agent asks for a prediction, then checks it against the program’s output.
MIT ★ 541 updated 2026-11-09
npx skills add dotslashsimran/simcraft --skill from-scratch -a claude-codeWhat from-scratch does
The skill breaks a topic down to its central mechanism and guides the user through a working miniature implementation. It first asks what the user already knows, then lays out 4–8 steps. Each step adds one idea and ends with runnable code that prints a result.
Before executing a step, the agent waits for the user to predict the output. It then runs the code and compares the result with that prediction. The target is one file under 200 lines, using the standard library or numpy unless the idea needs more. Edge cases and error handling are deliberately left out. Once the toy version works, the agent can compare it with a real library or tool, then test understanding with questions.
What it helps with
- trace how attention combines token values
- build a small Git or HTTP server implementation
- see how a tokenizer handles text
- compare a learning implementation with a real library
Example prompts for the agent
- Teach me how attention works by building a small version from scratch.
- Help me understand Git by implementing its basic mechanism without a library.
- Explain RAG through a runnable miniature implementation.
How to install from-scratch
1Skills CLI (Vercel)
npx skills add dotslashsimran/simcraft --skill from-scratch -a claude-code2Manually: put the files in place
~/.claude/skills/from-scratch/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/from-scratch/
1Skills CLI (Vercel)
npx skills add dotslashsimran/simcraft --skill from-scratch -a codex2Manually: put the files in place
.agents/skills/from-scratch/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add dotslashsimran/simcraft --skill from-scratch -a cursor2Manually: put the files in place
.cursor/skills/from-scratch/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install dotslashsimran/simcraft skills/learning/from-scratch2Manually: put the files in place
.github/skills/from-scratch/SKILL.md1Skills CLI (Vercel)
npx skills add dotslashsimran/simcraft --skill from-scratch -a gemini-cli2Platform CLI
gemini skills install https://github.com/dotslashsimran/simcraft --path skills/learning/from-scratchManually: put the files in place
.devin/skills/from-scratch/SKILL.mdThe legacy .windsurf/skills/ path still works
Claude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about from-scratch
How do I install from-scratch in Claude Code?
Run npx skills add dotslashsimran/simcraft --skill from-scratch -a claude-code. The skill is placed at ~/.claude/skills/from-scratch/SKILL.md.
What does from-scratch do?
It teaches a software concept through a sequence of small, runnable implementations. The agent asks the user to predict each result before running the code, then compares the prediction with the output.
How does a from-scratch lesson work?
The agent explains one idea, writes code for that step and runs it on a small input. After the toy version works, it can compare the result with a real library or tool.
Source text
SKILL.md · MIT
--- name: from-scratch description: Learn how something really works by building the smallest working version of it from scratch, Karpathy style, one small step at a time, with the user predicting what each step will do before running it. Works for ML and AI ideas (attention, tokenizers, backprop, RAG, agents), systems (a database, an HTTP server, git, a shell) and anything else that can be coded. Use when the user says "teach me how X works", "build X from scratch", "I want to really understand X", "explain X from first principles", or "implement X without the library". --- # From scratch Reading about a thing gives you the words. Building it gives you the understanding. The fastest way to really get attention, a tokenizer, a vector database or git is to write the smallest version that works, in plain code, and watch it run. The goal is understanding, not a finished library. Small and readable beats complete. ## 1. Find the core Ask one question first: what does the user already know? (For example: "Comfortable with Python and numpy? Seen matrix multiplication before?") Then name, in one or two sentences, **the one mechanism that makes the thing work**. Examples: - Attention: every token scores every other token, and takes a weighted average of their values. - Git: files are stored by the hash of their contents, and a commit is a file that points at a tree and a parent. - RAG: turn text into vectors, find the nearest ones to the question, paste them into the prompt. Everything that isn't the core (speed, edge cases, config, error handling) is left out on purpose. Say what's left out and why. ## 2. Plan the build Break it into 4 to 8 steps. Each step adds one idea and ends with something that runs and prints a result. Target the whole thing at **under 200 lines**, one file, standard library or numpy only unless the idea needs more. Show the step list, then start step 1. ## 3. Each step 1. **Say the idea** in two or three plain sentences. 2. **Ask for a prediction** before running anything: "What do you think this prints?" or "Which word will get the highest score?" Wrong guesses are where the learning happens, so wait for one. 3. **Write the code** for that step only. Short functions, honest variable names, a comment only where the why isn't obvious. 4. **Run it** and show the real output. Use tiny inputs (3 tokens, 2 files, a 4-word vocabulary) so every number can be checked by eye. 5. **Compare with the prediction.** If it was wrong, explain what they missed, in one or two sentences. Never write two steps at once. The user can say "faster" to combine steps. ## 4. Check against the real thing When the toy works, run the same input through the real library or tool (PyTorch attention, real git, a real tokenizer) and show that the answers match, or explain exactly why they differ. This is what turns "I made a toy" into "I know how it works". ## 5. Lock it in End with: - A **one-paragraph explanation in the user's words**: ask them to explain it back first, then tidy what they wrote rather than replacing it. - **Three questions** that test the core idea, answers hidden until they try. (The `teach-back` skill can take it from here.) - **Where the real version is more complicated**, as a short list, so they know what they skipped. Keep the code file. It's their reference implementation. ## Rules - Never paste a big finished implementation. The steps are the lesson. - No magic: if a line uses something they haven't seen, either explain it in one sentence or replace it with something simpler. - Run every line of code you show. Never show output you didn't get.
© dotslashsimran · MIT · dotslashsimran/simcraft