Engineering
karpathy-guidelines avatar

karpathy-guidelines

Behavioral guidelines for LLMs to reduce coding mistakes, follow best practices, and improve output quality by enforcing simplicity, surgical changes, and goal-driven verification.

Introduction

This skill provides a set of behavioral guidelines designed to optimize the performance of AI coding agents, specifically addressing common pitfalls identified by Andrej Karpathy. The core philosophy centers on reducing unnecessary code bloat, preventing incorrect assumptions, and ensuring that every modification made by the AI is intentional, verified, and surgical. By forcing the agent to think before coding, surface tradeoffs, and define clear success criteria, users can expect more reliable code generation, cleaner pull requests, and a significant reduction in over-engineered abstractions.

  • Think Before Coding: Promotes explicit reasoning, requiring the agent to state assumptions, identify ambiguities, and request clarification rather than guessing or picking silent interpretations.

  • Simplicity First: Focuses on the "minimum viable code" approach, actively discouraging speculative features, unnecessary configurability, and bloated logic that exceeds the user's requirements.

  • Surgical Changes: Implements a strict policy of modifying only the necessary code, preserving existing style, and avoiding drive-by refactoring that complicates the codebase or introduces unintended side effects.

  • Goal-Driven Execution: Transforms abstract tasks into concrete, verifiable success criteria, encouraging the use of test-driven development to ensure that code changes meet specific performance or functional goals.

  • The guidelines are designed to be used in conjunction with CLAUDE.md files or as committed project rules in environments like Cursor, providing a persistent behavioral layer for coding agents.

  • Practical constraints include a deliberate bias toward caution over speed; users should apply judgment for trivial tasks like typo fixes or one-liner edits.

  • Inputs expected include high-level development tasks or feature requests, while the output is a more disciplined, iterative coding cycle that prioritizes correctness and maintainability.

  • Ideal for developers, engineering teams, and anyone integrating LLMs into software development workflows who wants to minimize hallucinated features and maintenance debt.

Repository Stats

Stars
98,632
Forks
9,590
Open Issues
78
Language
Not provided
Default Branch
main
Sync Status
Idle
Last Synced
Apr 29, 2026, 02:06 PM
View on GitHub