explaingit

forrestchang/andrej-karpathy-skills

135,862Audience · developerComplexity · 1/5MaintainedLicenseSetup · easy

TLDR

A configuration file that teaches Claude Code (an AI assistant) to write simpler, more focused code by following four core principles: think before coding, keep it simple, make surgical edits, and verify with tests.

Mindmap

mindmap
  root((repo))
    What it does
      Fixes AI coding mistakes
      Teaches better practices
      Works with Claude Code
    Core principles
      Think Before Coding
      Simplicity First
      Surgical Changes
      Goal-Driven Execution
    Use cases
      Improve code quality
      Reduce unwanted edits
      Avoid over-engineering
    How to use
      Claude Code plugin
      Copy CLAUDE.md file
      Works with Cursor too

Things people build with this

USE CASE 1

Install as a Claude Code plugin to prevent your AI assistant from overcomplicating code or making unnecessary changes.

USE CASE 2

Copy the CLAUDE.md file into your project to guide Cursor or other AI tools to write simpler, more focused solutions.

USE CASE 3

Use the test-first approach to verify that AI-generated code actually solves your problem before accepting it.

USE CASE 4

Reduce time spent reviewing and fixing AI-generated code by setting clear expectations upfront.

Tech stack

Claude CodeCursor

Getting it running

Difficulty · easy Time to first run · 5min
Use freely for any purpose, including commercial use, as long as you keep the copyright notice.

In plain English

This project is a single configuration file called CLAUDE.md, designed to make Claude Code (an AI coding assistant) behave better when helping developers write software. It is based on observations from Andrej Karpathy about common pitfalls that large language models fall into when generating code. The problems it tries to fix are familiar to anyone who has worked with AI coding tools: the model makes silent assumptions, writes more code than necessary, edits files it was not asked to touch, and removes or changes things it does not fully understand. The solution is a short rulebook organized around four principles. Think Before Coding asks the model to surface its assumptions and ask questions when ambiguous. Simplicity First tells it to write the minimum code that solves the problem and avoid speculative abstractions. Surgical Changes restricts edits to only what was requested, even if nearby code looks improvable. Goal-Driven Execution reframes tasks as verifiable success criteria, often by writing tests first, so the assistant can loop until it gets things right. You would use it if you regularly work with Claude Code (or, with the included rule file, Cursor) and find the assistant overcomplicates things or makes unwanted changes. The repository is distributed either as a Claude Code plugin or as a CLAUDE.md file you copy into a project. There is also a Chinese-language version. The project is MIT-licensed.

Copy-paste prompts

Prompt 1
I'm using Claude Code with the CLAUDE.md rulebook. Help me set it up as a plugin so my AI assistant writes simpler code.
Prompt 2
My AI coding assistant keeps editing files I didn't ask it to touch. How do I use this repo's 'Surgical Changes' principle to fix that?
Prompt 3
Show me how to apply the 'Goal-Driven Execution' principle by writing a test first, then having Claude Code implement the solution.
Prompt 4
I want to use this rulebook with Cursor instead of Claude Code. What do I need to change in the CLAUDE.md file?
Prompt 5
My AI assistant keeps writing speculative abstractions I don't need. How does the 'Simplicity First' principle help me prevent that?
Open on GitHub → Explain another repo

Generated 2026-05-18 · Model: sonnet-4-6 · Verify against the repo before relying on details.