Agent Usage
Lessons learnedClaude CodeCursor

Four rules from Karpathy that fix most agent coding mistakes

PT
piash tanjin · 1 min read

andrej-karpathy-skills is a single CLAUDE.md built from Andrej Karpathy's posts about where coding models go wrong: unchecked assumptions, overcomplicated code, and edits to things nobody asked to change. It boils that down to four rules.

The rules

  • Think before coding. State your assumptions, and when a request can mean two things, say so instead of silently picking one.

  • Simplicity first. The minimum code that solves the problem. No speculative features or one-use abstractions.

  • Surgical changes. Touch only what the task needs, match the existing style, and mention dead code rather than deleting it.

  • Goal-driven execution. Turn the task into something checkable, such as a failing test, then make it pass.

Install

As a Claude Code plugin:

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

Or drop the file into one project:

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

There's a Cursor rule in the repo too.

Why it works

The last rule does most of the work. An agent with a clear finish line, like a test that has to pass, stops wandering. If you only adopt one habit, give every task a way to prove it's done.

Comment
Written bypiash tanjin
View profile

Discussion (0)

Join the discussionAnyone can read. Sign in to comment, reply or upvote. You'll come straight back to this post.
Continue

No comments yetStart the discussion. A question about one specific step is a great first comment.