Overview
Elevate your Claude Code interactions with this curated set of guidelines, directly inspired by Andrej Karpathy's critical observations on common LLM coding pitfalls. This repository provides a single CLAUDE.md file designed to systematically improve Claude's code generation and editing behavior by addressing assumptions, complexity, tangential edits, and unclear objectives.
Key Features
- Four Core Principles: Implement "Think Before Coding," "Simplicity First," "Surgical Changes," and "Goal-Driven Execution" to guide LLM behavior.
- Directly Addresses LLM Weaknesses: Tackles issues like making unwarranted assumptions, overcomplicating solutions, unintended side effects in code, and lack of clear success criteria.
- Promotes Explicit Reasoning: Encourages LLMs to surface assumptions, present tradeoffs, ask clarifying questions, and push back when necessary.
- Enforces Minimal Code: Drives towards concise, problem-specific solutions, eliminating speculative features and bloated abstractions.
- Ensures Targeted Modifications: Guarantees that code changes are confined to the requested scope, preventing accidental edits to unrelated code or comments.
- Facilitates Verifiable Success: Transforms imperative tasks into declarative goals with clear verification steps, enabling more autonomous and reliable LLM execution.
- Flexible Integration: Easily adoptable as a Claude Code plugin or a per-project
CLAUDE.mdfile, with dedicated support for Cursor.
Typical Use Cases
- Improving Code Quality: Significantly reduce the likelihood of generated code being overly complex, containing subtle bugs, or including unnecessary features.
- Streamlining Development Workflow: Minimize the need for extensive manual code review and refactoring by ensuring code is cleaner and more targeted from the outset.
- Enhancing LLM Collaboration: Foster a more predictable and reliable coding partnership with Claude, where the LLM acts as a precise and reasoned assistant.
- Educating LLMs on Best Practices: Systematically train LLMs to adhere to principles of clean code, focused problem-solving, and verifiable outcomes.
- Reducing Costly Mistakes: Mitigate the impact of LLM errors on non-trivial coding tasks by embedding a framework for caution and clarity.
