Skip to main content
skill CX Codex

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

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add dotslashsimran/simcraft --skill from-scratch -a claude-code
Open on GitHub

What 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-code

2Manually: put the files in place

~/.claude/skills/from-scratch/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/from-scratch/

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

Similar skills

All skills for AI and ML →

From the same set24

The whole set →
image-gen The image-gen Claude Code skill generates and edits images from requests. It activates for illustrations, icons, thumbnails, textures, and image series that need a consistent subject. CX Codex +1 ★ 541repo stars teach-back The teach-back Claude Code skill checks understanding by asking for an explanation in the learner’s own words. It probes gaps one question at a time, then creates a cheat sheet and review questions. CX Codex +1 ★ 541repo stars brand-kit This Claude Code skill captures a company's visual identity from its website and saves a reusable brand kit. It runs before creating branded videos, stickers, or graphics. CX Codex +1 ★ 541repo stars next-step The next-step Claude Code skill turns a large goal or an unstructured task dump into one next action. It activates for planning requests or when someone is unsure how to begin. CX Codex +1 ★ 541repo stars video-script The video-script Claude Code skill drafts short talking-head, explainer, and product-demo videos. It activates for requests to write or revise a script, hook, or YouTube, TikTok, Reels, or LinkedIn video. CX Codex +1 ★ 541repo stars repo-timelapse The repo-timelapse Claude Code skill turns a repository’s Git history into a video of the project changing over time. It runs on requests to show project growth or animate commits. CX Codex +1 ★ 541repo stars skill-router The skill-router Claude Code skill selects a matching skill or builds a sequence for a task. It kicks in when a request is vague or could call for several skills. CX Codex +1 ★ 541repo stars bisect-anything The bisect-anything Claude Code skill tracks a regression to a commit, dependency version, or config value. It activates for requests to find what broke a test or when a problem began. CX Codex +1 ★ 541repo stars

Project sponsors

Companies that keep this analytics open