# /karpathy-guidelines: Four rules against common LLM coding mistakes

Source: https://trendhub.net/skills/multica-ai-andrej-karpathy-skills/karpathy-guidelines
Skill folder: https://github.com/multica-ai/andrej-karpathy-skills/tree/main/skills/karpathy-guidelines
Pack: Andrej Karpathy Skills (https://trendhub.net/skills/multica-ai-andrej-karpathy-skills)
Works with: Claude Code (plugin), Claude Code (CLAUDE.md, one project)

This skill gives a coding agent four working rules drawn from Andrej Karpathy's observations on LLM coding pitfalls. The agent states its assumptions and asks when unsure, writes the smallest code that solves the task, edits only lines tied to your request, and turns each task into a check it can verify before calling the work done.

## When to use it

- Your agent builds the wrong thing because it guessed what you meant
- Reviews keep finding refactors and abstractions nobody asked for
- You want smaller, cleaner pull requests from an agent

## How it works

1. **Think before coding**: Before writing code it states its assumptions, lays out competing interpretations and stops to ask when something is unclear.
2. **Simplicity first**: It writes the minimum code for the request: no extra features, single-use abstractions or configuration nobody requested.
3. **Surgical changes**: It leaves adjacent code, comments and formatting alone, matches the existing style and removes only what its own change made unused.
4. **Goal-driven execution**: It rewrites a task as a verifiable goal, such as a failing test to make pass, and states a short plan with a check for each step.

## What it steers the agent away from

- Silently picking one reading of an ambiguous request
- Writing 200 lines where 50 would do
- Deleting dead code or comments it was not asked to touch

## What it can touch

Instructions only: no scripts, no shell commands and no network access of its own. It changes how the agent plans and edits code in your project.

## Questions

### Does it work outside Claude Code?

The SKILL.md loads in agents that support the Agent Skills format, and the repository ships the same rules as a Cursor project rule and a CLAUDE.md file.

### How do I know it is working?

The README suggests watching for smaller diffs, fewer rewrites, clarifying questions before implementation and pull requests without drive-by refactoring.
