AI/TLDR

Karpathy Coding Guidelines

Four rules that stop a coding agent guessing, bloating and drive-by refactoring

Agent Skills & PluginsOpen source
Updated
27 Jan 2026
License
MIT

What's new

27 Jan 2026

Covered on AI/TLDR as a single drop-in CLAUDE.md encoding four rules for steering Claude Code — think first, keep it simple, make surgical changes, and verify against explicit success criteria.

Overview

This project packages four coding-agent principles into a rule file, shipped as a Claude Code plugin (with marketplace metadata and a `skills/karpathy-guidelines` skill), a drop-in `CLAUDE.md`, and a committed Cursor project rule. It is derived from Andrej Karpathy's public observations about how LLMs fail at coding: they make wrong assumptions and run with them, they don't manage their own confusion or surface tradeoffs, they overcomplicate code and bloat abstractions, and they change or remove code they don't sufficiently understand.

Each principle targets one of those failures. **Think Before Coding** requires stating assumptions explicitly, presenting multiple interpretations instead of silently picking one, pushing back when a simpler approach exists, and stopping to name what is unclear. **Simplicity First** bans features beyond what was asked, abstractions for single-use code, unrequested configurability, and error handling for impossible scenarios. **Surgical Changes** forbids improving adjacent code, refactoring what isn't broken, or deleting pre-existing dead code — every changed line must trace to the request, and only orphans your own edit created get cleaned up. **Goal-Driven Execution** converts imperative tasks into verifiable ones ("write a test that reproduces the bug, then make it pass"), on the reasoning that strong success criteria let the model loop independently while weak ones force constant clarification.

The repo is candid about the tradeoff: the guidelines bias toward caution over speed, and the README says to use judgment on trivial changes rather than applying the full rigor to a typo fix. It also names the signals that it is working — fewer unnecessary changes in diffs, fewer rewrites from overcomplication, clarifying questions arriving before implementation instead of after mistakes, and clean minimal PRs with no drive-by refactoring.

What it does

  • Installs as a Claude Code plugin from its own marketplace, making the skill available across every project
  • Also usable as a plain `CLAUDE.md` you curl into a project, or appended to an existing one
  • Ships a committed Cursor project rule (`.cursor/rules/karpathy-guidelines.mdc`) so the same guidelines apply in Cursor
  • Four principles with concrete tests attached — "would a senior engineer call this overcomplicated?", "does every changed line trace to the request?"
  • A transformation table for turning imperative instructions into verifiable goals, plus a plan-with-verification-steps format
  • Designed to be merged with project-specific instructions rather than replacing them; English and Simplified Chinese READMEs

Getting started

Pick the plugin route if you want the guidelines everywhere, or the CLAUDE.md route to scope them to one repository.

Install as a Claude Code plugin

From inside Claude Code, add the marketplace, then install the plugin.

texttext
/plugin marketplace add forrestchang/andrej-karpathy-skills
/plugin install andrej-karpathy-skills@karpathy-skills

Or drop the file into a new project

One curl writes the rule file at the repo root.

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

Or append to an existing CLAUDE.md

The guidelines are written to be merged with whatever project rules you already have.

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

Add your own project rules underneath

Keep the four principles generic and put anything repo-specific in its own section.

texttext
## Project-Specific Guidelines

- Use TypeScript strict mode
- All API endpoints must have tests
- Follow the existing error handling patterns in `src/utils/errors.ts`

Use it in Cursor

The repository includes a committed Cursor rule so opening the project in Cursor applies the same guidelines; CURSOR.md documents how to reuse it in other projects.

Commands and code are distilled from the project's own documentation — always check the official repo for the latest.

When to use it

  • Stop a coding agent from silently choosing one reading of an ambiguous request instead of asking
  • Keep agent-authored PRs small and reviewable by banning drive-by refactoring of untouched code
  • Give a team one shared baseline `CLAUDE.md` that project-specific rules extend rather than replace
  • Turn vague tasks into test-first goals the agent can loop on without supervision

How Karpathy Coding Guidelines compares

Karpathy Coding Guidelines alongside other open-source agent skills & plugins tools AI/TLDR tracks, ranked by GitHub stars.

ToolStarsWhat it does
Superpowers★ 284kA composable skills plugin that installs a spec-first, TDD, subagent-driven development methodology into Claude Code, Codex, Cursor, Gemini CLI and other coding harnesses.
Skills for Real Engineers★ 258kMatt Pocock's everyday agent skills for coding agents, covering alignment grilling, planning, code review and research — small, composable and meant to be edited.
ECC★ 256kAn installable plugin that adds 68 agents, 286 skills, hooks, rules, memory and an agent-config security scanner to Claude Code, Codex and other coding harnesses.
Karpathy Coding Guidelines★ 212kFour rules that stop a coding agent guessing, bloating and drive-by refactoring
Caveman★ 105kA skill plus local proxy that shortens an AI coding agent's prose while leaving code, commands and paths untouched — the rule file cuts what the agent writes, the proxy compresses what it reads.
Addy’s Agent Skills★ 93.3kA pack of production engineering skills for AI coding agents, with nine lifecycle slash commands — /spec, /plan, /build, /test, /review, /ship — installable into 70+ agents.
Humanizer★ 46.3kAn agent skill that rewrites AI-sounding prose against a list of 25 named writing patterns, grouped into five sections and applied without changing the claims in the text.
Claude for Financial Services★ 34.8kAnthropic reference agents, skills and MCP connectors for investment banking, equity research, private equity and wealth management, as Cowork plugins or Managed Agents.