← All free guides · texaaitech.com
4 From the reel · Karpathy Skills

Make Claude code like Karpathy would want.

One free GitHub repo, one CLAUDE.md file, zero lines of code. Drop it into your project and Claude Code follows 4 rules that stop the most common AI coding mistakes, so you waste fewer credits on rewrites.

238k+GitHub stars
1 fileCLAUDE.md
4 rulesfor Claude Code

Checked on 1 December 2026. The repo is very active, so the star count keeps growing.

The andrej-karpathy-skills repository page on GitHub
texa.aitech
SHARED BY
texa.aitech
AI tools · Tech tips · Creator workflows
Where it comes from

Built on Andrej Karpathy's notes

Andrej Karpathy

Andrej Karpathy

Founding member of OpenAI and former Director of AI at Tesla, one of the best-known names in AI. He wrote publicly about the mistakes AI models make when they write code. This repo turns those notes into 4 simple rules that Claude reads before it starts working.

The CLAUDE.md file itself was written by developer Jiayuan (repo multica-ai/andrej-karpathy-skills), based on Karpathy's observations.

The problem it fixes
Wrong guessesThe AI assumes things about your project and keeps going without asking.
Too much codeIt writes 1000 lines and extra layers when 100 lines would do.
Side damageIt changes or deletes code and comments that had nothing to do with the task.
The 4 rules

What Claude starts doing

These four rules are the whole file. Each one targets one of the mistakes above.

01

Think Before Coding

Don't assume. Don't hide confusion. Show the tradeoffs.
  • Says its assumptions out loud, and asks when it is not sure.
  • If your request can mean two things, it shows both instead of picking one silently.
  • Pushes back when there is a simpler way.
  • Stops and asks when it is confused.
02

Simplicity First

Minimum code that solves the problem. Nothing extra.
  • No features you did not ask for.
  • No extra layers or "flexible" settings for one-time code.
  • If 200 lines could be 50, it rewrites it.

The check: would a senior engineer call this overcomplicated? If yes, simplify.

03

Surgical Changes

Touch only what is required. Clean up only its own mess.
  • Doesn't "improve" nearby code, comments or formatting.
  • Doesn't refactor things that aren't broken, and matches your existing style.
  • Mentions unrelated dead code instead of deleting it.
  • Removes only the leftovers that its own change created.

The check: every changed line should trace back to your request.

04

Goal-Driven Execution

Define what success means, then test until it is true.

Instead of a vague task, Claude turns it into a goal it can check, and keeps going until the check passes:

Instead of…Claude does…
"Add validation"Writes tests for bad inputs, then makes them pass
"Fix the bug"Writes a test that shows the bug, then makes it pass
"Refactor X"Makes sure the tests pass before and after

For bigger tasks it writes a short plan where every step has a "verify" check.

Install

Add it in one minute

Option A · recommended

Claude Code plugin (works in all your projects)

Type these inside Claude Code, one by one

/plugin marketplace add forrestchang/andrej-karpathy-skills
/plugin install andrej-karpathy-skills@karpathy-skills
Option B · one project

Put CLAUDE.md in your project folder

New project · Mac / Linux / Git Bash

curl -o CLAUDE.md https://raw.githubusercontent.com/forrestchang/andrej-karpathy-skills/main/CLAUDE.md

New project · Windows PowerShell

irm https://raw.githubusercontent.com/forrestchang/andrej-karpathy-skills/main/CLAUDE.md -OutFile CLAUDE.md

Already have a CLAUDE.md? Add the rules to the end (Mac / Linux)

echo "" >> CLAUDE.md
curl https://raw.githubusercontent.com/forrestchang/andrej-karpathy-skills/main/CLAUDE.md >> CLAUDE.md

Already have a CLAUDE.md? (Windows PowerShell)

Add-Content CLAUDE.md "`n"; Add-Content CLAUDE.md (irm https://raw.githubusercontent.com/forrestchang/andrej-karpathy-skills/main/CLAUDE.md)
Using Cursor? The repo also has a ready Cursor rule in .cursor/rules/karpathy-guidelines.mdc; see CURSOR.md in the repo.

Test it · ask Claude Code

Add input validation to the signup form. Before you write code, tell me your assumptions and your success criteria, then write the tests first and make them pass.

Open the repo on GitHub ↗

Is it working?

Signs you'll notice

BeforeAfter
Big diffs full of changes you never asked forOnly the requested changes
Rewrites because the first version was overcomplicatedSimple code the first time
Questions come after the mistakesClarifying questions come first
Credits burnt on retriesFewer retries, fewer wasted credits
Tradeoff: these rules make Claude a bit more careful and slower. For tiny fixes like a typo, you don't need the full process.
texa.aitech

Save this page. Code smarter.

Shared by texa.aitech. Follow @texa.aitech for more GitHub repos and AI tools worth your time.