The argument in one line.
Embedding Karpathy's four coding principles (think before coding, simplicity, surgical changes, goal-driven execution) directly into CLAUDE.md creates always-on guardrails that prevent AI hallucination, and combining them with triggered skills like Superpowers and G-Stack maxi.
Read if. Skip if.
- You're using Claude Code with a CLAUDE.md file already in place and want to reduce hallucinations, over-engineering, and unintended side effects in AI-generated code.
- A software engineer building with Claude who struggles with the model making assumptions instead of asking clarification questions before executing tasks.
- You're familiar with prompt engineering or system instructions and want to see how to layer Karpathy's four principles into your existing Claude workflow without breaking current setups.
- You're not using Claude or Claude Code as your primary AI development tool — this is framework-specific and won't transfer cleanly to other models.
- You've already implemented custom guardrails or a mature system prompt workflow — this is introductory-level on principle application, not advanced customization.
The full version, fast.
Andrej Karpathy's four-principle skill, distilled from a 7M-view X post, addresses the three failure modes that wreck AI-generated code: silent assumptions, gratuitous complexity, and unrequested side effects. The mechanism is a CLAUDE.md guardrail block enforcing think-before-coding, simplicity-first, surgical changes, and goal-driven execution � embedded into the model's always-on personality rather than triggered as an on-demand skill. Install it via the curl one-liner on existing projects, then have Claude reconcile duplicate headings and redundant framing against your existing rules before committing. For maximum accuracy, pair the guardrails with triggered frameworks like Superpowers, GSD, and G-Stack, routing each principle to a matching skill � brainstorming for new features, debugging for failures, plan-writing for multi-file work, symbolize for pre-commit cleanup.
Chat with this breakdown.
Modern Creator members can chat with any breakdown — ask for the hook, quote a framework, find the exact transcript moment. Unlocks at T2: refer 3 friends + add your own API key.
Create a free account →Where the time goes.

01 · Intro — Karpathy's 4 problems with LLM coding
Names the authority (Karpathy, 100K stars, 7M views), states the three problems: wrong assumptions, over-complicated code, rogue edits.

02 · School community CTA
Mid-video ad read for Skool community — AI agents, automations, Claude Code masterclass, weekly live calls.

03 · The Four Principles
Walks through all four rules in the README: think before coding, simplicity first, surgical changes, goal-driven execution.

04 · Install options
Three install paths: Claude Code plugin (global), new project curl, existing project append-curl.

05 · Live install on bookzero.ai
Runs the append command, opens git diff, then asks Claude Code to merge conflicts and clean up the CLAUDE.md.

06 · CLAUDE.md vs Skills (Superpowers / GSD / G-Stack)
Defines the key distinction: CLAUDE.md rules are always-on personality; skills are triggered. Compares functionality overlap and unique contributions.

07 · Combining Karpathy rules with skills
Maps each principle to a specific skill invocation path: brainstorming, debugging, planning, simplify-before-commit, test-driven dev, security review.

08 · Outro + playlist CTA
Subscribe ask, link to full spectrum-dev frameworks playlist in description.
Lines worth screenshotting.
- Karpathy's four principles — think before coding, simplicity first, surgical changes, goal-driven execution — address the four most common ways language models fail on real engineering tasks.
- The think-before-coding principle forces the model to ask clarifying questions rather than acting on assumptions, which eliminates the most common source of wasted build cycles.
- Simplicity first means that if a senior engineer would call the output overcomplicated, it should be rewritten — the success criterion is the judgment of an experienced human reviewer.
- Surgical changes means the model must never modify code unrelated to the explicit instruction — scope creep in AI-generated diffs is as expensive as scope creep in human development.
- Goal-driven execution requires a defined success criterion before coding begins — vague goals produce vague code, and the model needs to know what done looks like before it starts.
- CLAUDE.md rules are always-on behavioral guardrails; skills are triggered explicitly — installing the Karpathy principles into CLAUDE.md enforces them on every session without any user action.
- Merging the Karpathy skill into an existing CLAUDE.md requires a deduplication pass — the model should audit for contradictions and redundancies before the rules go live.
- After pasting the four principles, asking Claude to review the CLAUDE.md for conflicts and merge cleanly is the correct installation process rather than naive append.
- GSD, Superpowers, and G-Stack are skill frameworks that must be invoked — Karpathy's principles in CLAUDE.md run automatically, making them complementary rather than competing.
- The Karpathy skills repo hit over 100,000 GitHub stars because the four principles solve problems every Claude Code user has encountered within their first week of use.
- Removing meta-framing and duplicate headers when installing the principles makes the CLAUDE.md shorter and more readable — less instruction text means faster model comprehension per session.
- The combination of always-on CLAUDE.md guardrails and triggered skill frameworks gives Claude Code both a behavioral baseline and a structured process layer for complex projects.
Four Coding Guardrails Embedded in CLAUDE.md Prevent the Three Most Common AI Coding Mistakes
Eric Tech's walkthrough of the Karpathy principles shows that the four guardrails — think before coding, simplicity first, surgical changes, goal-driven execution — address the exact failure modes most AI coding sessions hit, and that embedding them in CLAUDE.md makes them always-on rather than remembered-sometimes.
- Three failure modes named: wrong assumptions without clarification, over-complicated code, rogue edits with unknown side effects
- The four principles address each failure mode directly — this is applied engineering, not general best practice
- Think before coding, simplicity first, surgical changes, goal-driven execution — four rules that constrain the four most common AI coding failure modes
- Each principle has a specific behavior it prevents — understanding the target failure mode is what makes the rule stick
- Three paths: Claude Code plugin (global), new project curl, existing project append-curl — the append path preserves your existing CLAUDE.md content
- Existing project append is the right path for any active project — it adds without destroying
- Append command → git diff → ask Claude to merge conflicts and clean up — letting the model handle its own rule file merge is faster and more reliable than manual editing
- The git diff step is the review checkpoint — always check what changed before accepting the merged CLAUDE.md
- CLAUDE.md rules are always-on — they inject into every session whether or not they are relevant to the current task
- Skills are triggered on demand — they inject context only when explicitly invoked, which preserves context budget for the actual task
- Each principle maps to a specific skill invocation: think-before-coding maps to a planning skill, simplicity maps to a simplify-before-commit skill, goal-driven maps to test-driven development
- The combination of always-on guardrails and triggered skills is the complete accuracy stack — neither alone is sufficient
Terms worth knowing.
- CLAUDE.md
- A project-level instruction file read automatically at the start of every Claude Code session. Rules placed here apply to every action the model takes in that project, without needing to be invoked.
- Claude Code
- Anthropic's command-line coding agent that runs inside a developer's terminal, reads and edits project files, and executes shell commands to build software.
- Skill
- A self-contained Claude Code capability bundle (instructions plus optional scripts) that the model loads on demand when a matching trigger fires, rather than being active on every turn.
- Plugin marketplace
- A directory inside Claude Code where users can browse and install skill or plugin bundles published by others, similar to an app store for agent capabilities.
- Always-on rule vs triggered skill
- Always-on rules live in CLAUDE.md and shape every response by default; triggered skills only load when their description matches the current request, keeping the base context smaller.
- Guardrails
- Explicit constraints written into a model's instructions that block unwanted behavior, such as forbidding speculative code or scope creep.
- Hallucination
- When a language model fabricates code, APIs, or facts that look plausible but do not actually exist or do not match the real codebase.
- Spec-driven development
- A workflow where the model first writes a written specification, converts it into a checklist of tasks, and only then executes — preventing it from coding before the goal is clear.
- Surgical changes
- Edits limited strictly to the lines required by the request, with no incidental refactoring, formatting, or improvements to unrelated code.
- Goal-driven execution
- Framing a task as a verifiable success criterion (such as a failing test that must pass) so the model can loop on its own work until the goal is objectively met.
- git diff
- A command that shows exactly which lines were added, removed, or changed in files, used here to inspect what an install script wrote into an existing config file.
- curl install command
- A one-line shell instruction that downloads a remote script and runs it, commonly used to bootstrap tools or append rules into a local project file.
- Superpowers
- A third-party skill pack for Claude Code that adds structured workflows such as brainstorming, systematic debugging, and pre-commit polishing.
- GSD
- Short for Get Stuff Done — a skill framework that enforces a planning phase before any code is written, then drives execution from the resulting task list.
- G-Stack
- A skill bundle that layers planning, role-based agents, and execution steps on top of Claude Code to keep multi-file changes coherent.
- Git worktree
- A Git feature that lets multiple branches be checked out into separate folders at the same time, so isolated experiments or agent runs do not interfere with the main working copy.
- Test-driven development
- A practice of writing a failing automated test that captures the desired behavior first, then writing only enough code to make that test pass.
Things they pointed at.
Lines you could clip.
“It's personality embedded into the model's brain — every time it does something, it knows this because it's embedded into its soul.”
“Superpowers and G-Stack teach how to work carefully but they don't say how much to do — these guardrails fix that gap.”
“The possibility here is endless — just pick the skill you want and add it into your CLAUDE.md and Claude knows exactly what skill is gonna trigger.”
Word for word.
The bait, then the rug-pull.
One hundred thousand GitHub stars and seven million X views. When Andrej Karpathy — ex-Tesla AI director, OpenAI founding team — writes down what's wrong with how LLMs code, the community listens. Eric Tech took those four rules and dropped them into a real Claude Code project to find out if they actually work. They do. But the bigger move is what you do after the install.
Named ideas worth stealing.
The Four Karpathy Coding Principles
- Think Before Coding
- Simplicity First
- Surgical Changes
- Goal-Driven Execution
Embedded as always-on CLAUDE.md guardrails. Derived from Karpathy's X post on LLM coding pitfalls.
CLAUDE.md = Personality, Skills = Triggers
CLAUDE.md rules fire on every message without invocation. Skills require explicit trigger. Combine both: CLAUDE.md sets the floor, skills add the workflow ceiling.
Karpathy + Skills Wiring Map
- Think Before Coding: superpowers brainstorming (features) / superpowers static-debugging (bugs)
- Multi-step task: superpowers writing-plans or gsd plan-phase
- Simplicity First: simplify skill before commit
- Surgical Changes: scope-creep guard; worktrees per change
- Goal-Driven: gsd test-driven-dev, superpowers verification, security-review
Eric's final recommended CLAUDE.md shape: Karpathy rules + per-rule skill routing.
How they asked for the click.
“I recently launched our school community where I help you to master AI agents, automations, and so much more”
Placed at ~45s before the main tutorial content. Own-product ad. Also pushed a playlist CTA at the outro.








































































