Single-File Hack Boosts Claude Code (92k★) with Four Senior‑Engineer Principles
The author presents a one‑file “CLAUDE.md” that, based on Andrej Karpathy’s four LLM coding pain points, rewrites Claude Code’s behavior using four concrete principles—think before coding, prioritize simplicity, make scalpel‑like edits, and drive execution with tests—turning AI from a noisy intern into a senior‑engineer‑like coder, and explains how to install it.
Problem with LLM code generators
Developers using Claude Code, Cursor, or Copilot often encounter code that makes wrong assumptions, over‑complicates solutions, deletes unrelated comments, and produces massive, unreadable files.
Karpathy’s four fatal LLM issues
Andrej Karpathy identified that LLMs “make wrong assumptions and keep running”, never manage their own confusion, never seek clarification, never expose inconsistencies, never present trade‑offs, and never refuse when they should.
Four principles encoded in a single CLAUDE.md file
The project supplies only one CLAUDE.md file that encodes four “golden” principles derived from Karpathy’s critique:
Think before coding – force the model to state assumptions, offer multiple explanations, ask clarifying questions, and “push back” when a simpler solution exists.
Simplicity first – avoid unnecessary features, one‑off abstractions, superfluous configuration, and error handling for impossible scenarios; rewrite 200 lines to 50 when possible.
Scalpel‑like edits – modify only the code that truly needs change, do not “improve” adjacent code or comments, and clean up imports or variables only when the edit creates them.
Goal‑driven execution – turn “add validation” into “write a test then make it pass” and “fix a bug” into “write a reproducing test then pass it”, attaching verification conditions to each step.
Installation (30‑second setup)
Two options are provided:
Add the plugin from the Claude Code marketplace with /plugin marketplace add forrestchang/andrej-karpathy-skills and then install it with /plugin install andrej-karpathy-skills@.
Copy the CLAUDE.md file into the project root; Claude Code will automatically apply the rules.
Why use it?
The file acts as a “behavior corrector” for Claude Code, changing its thinking without adding new features. By applying Karpathy’s insights, the project rose to nearly 100 k GitHub stars within 24 hours, offering a practical remedy for developers frustrated by AI’s “over‑design”.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
