Code quality skillCommunity

Karpathy Guidelines Skill

Four rules based on Andrej Karpathy's notes on LLM coding mistakes, as a skill: say your assumptions, keep it simple, change only what you must.

Works in
  • Claude Code

By Jiayuan Zhang (forrestchang) · forrestchang/andrej-karpathy-skills · MIT

Last updated

Install

Run

npx skills add forrestchang/andrej-karpathy-skills --skill karpathy-guidelines

This installs the repo's latest version. We reviewed commit 2c60614; use the Manual tab to install exactly that.

What it can touch

Runs scripts
No. Instructions only.
Needs network
No.
allowed-tools
Not set. It asks for no extra tool permissions; your tool's usual prompts apply.
Licence
MIT
Last reviewed
How we check a skill is safe
Check it yourself

Agent skills checklist

0 of 10 checked

Who made it

Before reading a line of it, know whose code you are about to run.

What's inside

The part people skip. Read what your agent will read.

What it can reach

Give it the least access that still does the job.

Keeping it that way

What you checked today is only what runs tomorrow if you pin it.

Your ticks are saved in this browser only.

Early in 2026, Andrej Karpathy posted a list of the mistakes LLMs make when they write code: they assume instead of asking, overbuild, and change code nobody asked them to touch. Jiayuan Zhang turned that list into four rules and published them as a skill. It's one of the most starred skill repos on GitHub, and it's short enough to read in two minutes.

What it does

Four rules, each with a one-line summary in the skill:

  1. Think before coding. State your assumptions. If a request can mean two things, say so instead of picking one. If something is unclear, stop and ask.
  2. Simplicity first. The least code that solves the problem. No features, abstractions or configuration nobody asked for.
  3. Surgical changes. Touch only what the task needs. Match the existing style. Clean up after your own change, and leave other dead code alone (mention it instead).
  4. Goal-driven execution. Turn the task into something you can check, like a test that should pass, then loop until it does.

The third rule has the test we like best:

The test: Every changed line should trace directly to the user's request.

From SKILL.md by Jiayuan Zhang, MIT.

An example

You ask: "Add a check that the email field isn't empty." Without the rules, it's common to get the check plus a new validation helper, a reformatted file and a renamed variable. With them, the agent adds the check, writes a test for an empty email, runs it, and mentions (without fixing) the unused import it noticed on the way.

When to use it, and when not to

Use it on any codebase you care about, especially someone else's or one with a style of its own. It's a good default for newer developers because it makes the agent's changes small enough to read and understand.

For throwaway scripts and quick prototypes, the extra questions may not be worth it.

What we checked

We read every file in the skill's folder at the commit linked above: just SKILL.md. We also read the repo's README.md, plugin files and Cursor rule. There are no scripts, no network access and no allowed-tools; the only link is to Karpathy's post, for you to read. The repo has no LICENSE file, but the README, the plugin manifest and the skill's own frontmatter all state MIT. Our full checklist is in the guide to checking a skill before you install it.

Rule four pairs well with the verification before completion skill, which makes the agent show the check passing before it says it's done.

FAQ

Did Andrej Karpathy write this skill?

No. Jiayuan Zhang (forrestchang on GitHub) wrote it, based on a post in which Karpathy described the mistakes LLMs make when they write code. The skill links to that post.

Is it a skill or a CLAUDE.md file?

Both. The repo started as a CLAUDE.md you drop into a project and now also ships the same rules as a skill, plus a Cursor rule. The skill loads only when you're writing, reviewing or refactoring code; a CLAUDE.md is read in every session.

Won't it slow my agent down?

On small tasks it can, which the skill admits: it says its rules favour caution over speed and to use judgement on trivial changes. On larger ones it usually saves time, because the agent asks before building the wrong thing.

Can I use it alongside other coding skills?

Yes. It sets general habits rather than a workflow, so it sits comfortably next to a planning, testing or review skill.

See all skills