Karpathy Skills: Four Rules That Keep AI Coding Agents Honest

Karpathy Skills: Four Rules That Keep AI Coding Agents Honest

AI coding agents are fast, but they still guess wrong, overbuild APIs, and edit code you never asked them to touch. The andrej-karpathy-skills repo turns Andrej Karpathy's public notes on those failure modes into a single set of guidelines for Claude Code and Cursor. The project has passed 233,000 stars on GitHub.

What it is

At its core this is one CLAUDE.md file: short behavioral rules you drop into a project (or install as a Claude Code plugin) so the agent stops running ahead on bad assumptions. The ideas come from Karpathy's observations on how models hide confusion, bloat abstractions, and rewrite unrelated comments. The same guidelines also ship as a Cursor rule, so you can use them outside Claude Code.

Key features

  • Think Before Coding. State assumptions, surface tradeoffs, and ask when something is unclear instead of silently picking an interpretation.
  • Simplicity First. Ship the minimum code that solves the request. No speculative features, single-use abstractions, or "flexibility" nobody asked for.
  • Surgical Changes. Touch only what the task needs. Match existing style, don't drive-by refactor neighbors, and clean up only the dead code your own edits created.
  • Goal-Driven Execution. Turn vague asks into verifiable goals ("write a failing test, then make it pass") so the model can loop until success criteria are met.

Why it matters

If you already use coding agents, these failure modes are familiar: wrong assumptions, 1,000-line solutions to 100-line problems, and diffs that wander into unrelated files. This repo is a practical fix for that, not another agent framework. The author notes the tradeoff up front: the rules bias toward caution over speed, so for a one-line typo you can loosen them.

Getting started

In Claude Code, add the marketplace with /plugin marketplace add forrestchang/andrej-karpathy-skills, then /plugin install andrej-karpathy-skills@karpathy-skills. For a single project, curl the raw CLAUDE.md into the repo root (or append it to an existing one). Cursor users can follow CURSOR.md, or copy .cursor/rules/karpathy-guidelines.mdc into their own workspaces. Merge the four principles with your project rules rather than treating them as a full replacement.

View the repo on GitHub: github.com/multica-ai/andrej-karpathy-skills

Multica (related agent platform) · Karpathy's original thread


You’re invited to Grok Bot
Scott invited you to try Grok Bot, free for 2 weeks. Hand off real work and everyday tasks, and come back to them done.