gitmyhub

andrej-karpathy-skills

★ 179k updated 2mo ago

A single CLAUDE.md file to improve Claude Code behavior, derived from Andrej Karpathy's observations on LLM coding pitfalls.

A single CLAUDE.md config file with four guiding principles that make AI coding assistants like Claude less likely to over-engineer, make silent assumptions, or touch code they shouldn't.

setup: easycomplexity 1/5

This repository provides a single configuration file — called CLAUDE.md — designed to make AI coding assistants like Claude Code behave more reliably and produce cleaner results. It was inspired by observations from AI researcher Andrej Karpathy about common pitfalls when using large language models (LLMs, meaning AI systems that generate code or text) for programming tasks.

The file installs four guiding principles into your AI assistant. The first, "Think Before Coding," tells the AI to state its assumptions out loud, ask for clarification when confused, and present tradeoffs instead of silently picking one approach. The second, "Simplicity First," pushes the AI to write the minimum amount of code needed — no extra features, no unnecessary abstractions, no speculative flexibility. The third, "Surgical Changes," means the AI should only touch the specific lines relevant to your request and leave everything else alone. The fourth, "Goal-Driven Execution," transforms vague requests like "fix the bug" into verifiable goals with clear success checks, so the AI can loop independently until done.

You would use this when you are working with an AI coding assistant and keep experiencing issues like the AI over-engineering solutions, making silent assumptions, touching code it shouldn't, or producing bloated pull requests. You can install it as a Claude Code plugin (making it available across all projects) or simply drop the CLAUDE.md file into a specific project folder. It also includes a setup for Cursor, another AI coding tool.

Where it fits