Agent skill

Karpathy Coder

by kunstmusik in kunstmusik/blue

A skill your agent uses when writing, reviewing, or committing code to enforce Karpathy's 4 coding principles — surface assumptions before coding, keep it simple, make surgical changes, define…

MITAuto-check passedDevelopment

Install Karpathy Coder

skills CLI
$ npx skills add kunstmusik/blue --skill karpathy-coder -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install kunstmusik/blue karpathy-coder --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/kunstmusik/blue.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/karpathy-coder .claude/skills/karpathy-coder && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
karpathy-coder
GitHub stars
154
Used in
1 other repo
Token cost
~1.4k tokens
SKILL.md length
629 words
Files
12 (incl. scripts, references)
Skills in repo
16
Repo updated
First seen
Licence
MIT

At a glance

A skill your agent uses when writing, reviewing, or committing code to enforce Karpathy's 4 coding principles — surface assumptions before coding, keep it simple, make surgical changes, define…

  • Works in 4 steps: Think Before Coding → Simplicity First → Surgical Changes → …
  • Committing code to enforce Karpathys 4 coding principles — surface assumptions before coding
  • SKILL.md covers The four principles, Slash command, Python tools (scripts/) and Sub-agent, plus 5 more sections
  • Runs Python scripts from its folder

What it does

Karpathy Coder is an agent skill from kunstmusik/blue. Use when writing, reviewing, or committing code to enforce Karpathy's 4 coding principles — surface assumptions before coding, keep it simple, make surgical changes, define verifiable goals. Triggers on "review my diff", "check complexity", "am I overcomplicating this", "karpathy check", "before I commit", or any code quality concern where the LLM might be overcoding.

Its SKILL.md is about 1.4k tokens, which your agent loads only when the skill is triggered. The skill folder holds 14 other files, including scripts and reference files (for example `expected_outputs/assumption_linter.json`, `expected_outputs/complexity_checker.json` and `expected_outputs/diff_surgeon.json`).

It sits in Development, covering Code quality. The repository describes itself as: Blue - An Integrated Music Environment. The licence is MIT.

When your agent uses it

  • Committing code to enforce Karpathys 4 coding principles — surface assumptions before coding
  • Make surgical changes
  • Define verifiable goals
  • Check complexity

Example prompts

  • “review my diff”
  • “check complexity”
  • “am I overcomplicating this”
  • “/karpathy-coder”

Requirements

  • Python 3

Workflow steps

4 steps, taken from the step headings in SKILL.md.

  1. Think Before Coding
  2. Simplicity First
  3. Surgical Changes
  4. Goal-Driven Execution

What it can do on your machine

Read from SKILL.md and the folder at commit 5e261b0. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 4 files in scripts/ (Python), which the agent can run.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • x.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Karpathy Coder loads about 1.4k tokens when it runs, and up to ~4.5k if it reads all its reference files. Until then it costs about 96 tokens; SKILL.md has 629 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~96
When it runs · the whole SKILL.md, loaded when a task matches
~1.4k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~4.5k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from kunstmusik/blue at commit 5e261b0, republished under its MIT licence (© kunstmusik). 629 words, ~1,427 tokens.

Download SKILL.mdSave it as .claude/skills/karpathy-coder/SKILL.md (or your agent's skills folder). This skill also uses 11 other files; get the full folder from GitHub.
name
karpathy-coder
description
Use when writing, reviewing, or committing code to enforce Karpathy's 4 coding principles — surface assumptions before coding, keep it simple, make surgical changes, define verifiable goals. Triggers on "review my diff", "check complexity", "am I overcomplicating this", "karpathy check", "before I commit", or any code quality concern where the LLM might be overcoding.
context
fork
version
2.9.0
author
claude-code-skills
license
MIT
tags
code-quality, discipline, karpathy, simplicity, surgical-changes, anti-patterns, review
compatible_tools
claude-code, codex-cli, cursor, antigravity, opencode, gemini-cli

Karpathy Coder — Active Coding Discipline

Derived from Andrej Karpathy's observations on LLM coding pitfalls. This is not just guidelines — it ships Python tools that detect violations, a review agent, a slash command, and a pre-commit hook.

"The models make wrong assumptions on your behalf and just run along with them without checking. They don't manage their confusion, don't seek clarifications, don't surface inconsistencies, don't present tradeoffs, don't push back when they should."

"They really like to overcomplicate code and APIs, bloat abstractions, don't clean up dead code... implement a bloated construction over 1000 lines when 100 would do."

"LLMs are exceptionally good at looping until they meet specific goals... Don't tell it what to do, give it success criteria and watch it go."

— Andrej Karpathy

The four principles

1. Think Before Coding

Don't assume. Don't hide confusion. Surface tradeoffs.

  • State assumptions explicitly. If uncertain, ask.
  • If multiple interpretations exist, present them — don't pick silently.
  • If a simpler approach exists, say so. Push back when warranted.
  • If something is unclear, stop. Name what's confusing. Ask.
2. Simplicity First

Minimum code that solves the problem. Nothing speculative.

  • No features beyond what was asked.
  • No abstractions for single-use code.
  • No "flexibility" or "configurability" that wasn't requested.
  • No error handling for impossible scenarios.
  • If you write 200 lines and it could be 50, rewrite it.

The test: Would a senior engineer say this is overcomplicated? If yes, simplify.

3. Surgical Changes

Touch only what you must. Clean up only your own mess.

  • Don't "improve" adjacent code, comments, or formatting.
  • Don't refactor things that aren't broken.
  • Match existing style, even if you'd do it differently.
  • If you notice unrelated dead code, mention it — don't delete it.
  • Remove imports/variables/functions that YOUR changes made unused.
  • Don't remove pre-existing dead code unless asked.

The test: Every changed line should trace directly to the user's request.

4. Goal-Driven Execution

Define success criteria. Loop until verified.

Instead of...Transform to...
"Add validation""Write tests for invalid inputs, then make them pass"
"Fix the bug""Write a test that reproduces it, then make it pass"
"Refactor X""Ensure tests pass before and after"

For multi-step tasks, state a brief plan:

1. [Step] → verify: [check]
2. [Step] → verify: [check]
3. [Step] → verify: [check]

Slash command

/karpathy-check — Run the full 4-principle review on your staged changes.

Show full SKILL.md (258 more words)Show less

Python tools (scripts/)

All tools are stdlib-only. Run with --help.

ScriptWhat it detects
complexity_checker.pyOver-engineering: too many classes, deep nesting, high cyclomatic complexity, unused params, premature abstractions
diff_surgeon.pyDiff noise: lines that don't trace to the stated goal — comment changes, style drift, drive-by refactors
assumption_linter.pyHidden assumptions in a plan: unasked features, missing clarifications, silent interpretation choices
goal_verifier.pyWeak success criteria: vague plans without verifiable checks, missing test assertions

Sub-agent

karpathy-reviewer — Runs all 4 principles against a diff. Dispatched by /karpathy-check or manually before committing.

Pre-commit hook

hooks/karpathy-gate.sh — runs complexity_checker.py and diff_surgeon.py on staged files. Warns (non-blocking) when violations are found. Wire it via .claude/settings.json or Husky.

References

  • references/karpathy-principles.md — the source quotes, deeper context, when to relax each principle
  • references/anti-patterns.md — 10+ before/after examples across Python, TypeScript, and shell
  • references/enforcement-patterns.md — how to wire hooks, CI integration, team adoption

When to relax

These principles bias toward caution over speed. For trivial tasks (typo fixes, obvious one-liners), use judgment. The principles matter most on:

  • Non-trivial implementations (>20 lines changed)
  • Code you don't fully understand
  • Multi-step tasks with unclear requirements
  • Anything that will be reviewed by humans

Cross-tool compatibility

Installs via plugin for Claude Code. For other tools, copy the principles into your schema file:

ToolSchema file
Claude CodeCLAUDE.md (auto-loaded by plugin)
Codex CLIAGENTS.md
CursorAGENTS.md or .cursorrules
Antigravity / OpenCode / Gemini CLIAGENTS.md
  • self-eval — honest quality scoring after completing work
  • code-reviewer — broader code review; karpathy-coder focuses on the 4 LLM-specific pitfalls
  • llm-wiki — compound knowledge; karpathy-coder ensures you don't overcomplicate while building it

© kunstmusik, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 11 other files (scripts, references) in .agents/skills/karpathy-coder of kunstmusik/blue.

  • SKILL.md
  • expected_outputs/assumption_linter.json
  • expected_outputs/complexity_checker.json
  • expected_outputs/diff_surgeon.json
  • expected_outputs/goal_verifier.json
  • references/anti-patterns.md
  • references/enforcement-patterns.md
  • references/karpathy-principles.md
  • scripts/assumption_linter.py
  • scripts/complexity_checker.py
  • scripts/diff_surgeon.py
  • scripts/goal_verifier.py

Open the folder on GitHubat commit 5e261b0

Used in 1 other repository

We found 1 copy of this SKILL.md (exact, near-identical or edited) in other folders, from 1 other GitHub owner. This page covers the copy in kunstmusik/blue, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Karpathy Coder next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Karpathy Coder compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Karpathy Coder this skillkunstmusik/blue1541 repos~1.4kAutomated safety check: PassMIT
Vibe Coding PartnershareAI-lab/Kode-CLI5.2k—~5.6kAutomated safety check: PassApache-2.0
Mariadb Operator PR Reviewmariadb-operator/mariadb-operator1k—~3.3kAutomated safety check: PassApache-2.0
Main RouterVCnoC/Claude-Code-Zen-mcp-Skill-Work116—~12kAutomated safety check: PassApache-2.0
Effective Harnessesliangdabiao/exa-research-mcp-skill109—~1.5kAutomated safety check: PassNone
Repository Health and Gap AssessoropenJiuwen-ai/agent-core441—~613Automated safety check: PassApache-2.0

Similar skills

  • Vibe Coding Partner

    shareAI-lab/Kode-CLI

    Gives an agent a set of working rules for any development task: understand first, surface decisions, verify results, and load deeper reference files per scenario.

    5.2k GitHub stars~5.6k tokensUpdated 1 mo ago
    DevelopmentAuto-check passed
  • Mariadb Operator PR Review

    mariadb-operator/mariadb-operator

    Perform a structured maintainer-style PR review for the mariadb-operator repository.

    1k GitHub stars~3.3k tokensUpdated 2 days ago
    DevelopmentAuto-check passed
  • Main Router

    VCnoC/Claude-Code-Zen-mcp-Skill-Work

    Intelligent skill router that analyzes user requests and automatically dispatches to the most appropriate skill(s) or zen-mcp tools.

    116 GitHub stars~12k tokensUpdated 9 mo ago
    DevelopmentAuto-check passed
  • Effective Harnesses

    liangdabiao/exa-research-mcp-skill

    Long-running agent project harness for Codex, OpenClaw, Claude Code, and other coding agents.

    109 GitHub stars~1.5k tokensUpdated 2 mo ago
    DevelopmentAuto-check passed
  • Repository Health and Gap Assessor

    openJiuwen-ai/agent-core

    Runs a read-only assessment in one of two modes, a repository health check or a runtime extension gap review, and reports findings as a markdown table.

    441 GitHub stars~613 tokensUpdated 7 days ago
    DevelopmentAuto-check passed
  • Review Work

    code-yeongyu/oh-my-openagent

    Post-implementation gate review: run manual QA on the real surface yourself, then launch ONE gate reviewer (never a panel) to audit goal, constraints, code quality, security, missed context, and QA…

    70k GitHub stars~5.1k tokensUpdated today
    DevelopmentAuto-check passed

More from kunstmusik/blue

All 16 skills in this repo
  • Speckit Analyze

    kunstmusik/blue

    Perform a non-destructive cross-artifact consistency and quality analysis across spec.md, plan.md, and tasks.md after task generation.

    154 GitHub starsUsed in 18 repos~3k tokens
    Auto-check passed
  • Speckit Plan

    kunstmusik/blue

    Execute the implementation planning workflow using the plan template to generate design artifacts.

    154 GitHub starsUsed in 18 repos~2.1k tokens
    Auto-check passed
  • Speckit Specify

    kunstmusik/blue

    Create or update the feature specification from a natural language feature description.

    154 GitHub starsUsed in 18 repos~4.7k tokens
    Auto-check passed
  • Speckit Tasks

    kunstmusik/blue

    Generate an actionable, dependency-ordered tasks.md for the feature based on available design artifacts.

    154 GitHub starsUsed in 18 repos~3k tokens
    Auto-check passed
  • Speckit Clarify

    kunstmusik/blue

    Identify underspecified areas in the current feature spec by asking up to 5 highly targeted clarification questions and encoding answers back into the spec.

    154 GitHub starsUsed in 17 repos~4.9k tokens
    Auto-check passed
  • Speckit Taskstoissues

    kunstmusik/blue

    Convert existing tasks into actionable, dependency-ordered GitHub issues for the feature based on available design artifacts.

    154 GitHub starsUsed in 17 repos~2k tokens
    Auto-check passed

Questions about Karpathy Coder

What does Karpathy Coder do?

A skill your agent uses when writing, reviewing, or committing code to enforce Karpathy's 4 coding principles — surface assumptions before coding, keep it simple, make surgical changes, define…. Karpathy Coder is an agent skill from kunstmusik/blue. Use when writing, reviewing, or committing code to enforce Karpathy's 4 coding principles — surface assumptions before coding, keep it simple, make surgical changes, define verifiable goals.

When should I use Karpathy Coder?

Karpathy Coder fits situations like: committing code to enforce Karpathys 4 coding principles — surface assumptions before coding; make surgical changes; define verifiable goals; check complexity.

How do I install Karpathy Coder in Claude Code?

Run `npx skills add kunstmusik/blue --skill karpathy-coder -a claude-code`. Or copy the skill folder (.agents/skills/karpathy-coder in kunstmusik/blue) into .claude/skills/karpathy-coder in your project. Claude Code loads it when a task matches its description.

How do I install Karpathy Coder in Codex?

Run `npx skills add kunstmusik/blue --skill karpathy-coder -a codex`. Or copy the skill folder (.agents/skills/karpathy-coder in kunstmusik/blue) into .agents/skills/karpathy-coder in your project. Codex loads it when a task matches its description.

Can I use Karpathy Coder in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add kunstmusik/blue --skill karpathy-coder -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/karpathy-coder, .gemini/skills/karpathy-coder, .github/skills/karpathy-coder and .opencode/skills/karpathy-coder in your project.

What does Karpathy Coder need to run?

Going by SKILL.md and its folder, Karpathy Coder needs Python for the scripts in its folder. Our summary lists: Python 3.

Does Karpathy Coder access the network?

SKILL.md names 1 domain. As links in the text: x.com. This is read from the text; nothing was executed.

Is Karpathy Coder safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Karpathy Coder use?

Karpathy Coder is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Karpathy Coder use?

About 1.4k tokens (SKILL.md is roughly 5.7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 3.1k tokens, read only when the agent opens those files.

What are the alternatives to Karpathy Coder?

Skills that share tags, products or a category with Karpathy Coder: Vibe Coding Partner (shareAI-lab/Kode-CLI, 5.2k stars), Mariadb Operator PR Review (mariadb-operator/mariadb-operator, 1k stars), Main Router (VCnoC/Claude-Code-Zen-mcp-Skill-Work, 116 stars) and Effective Harnesses (liangdabiao/exa-research-mcp-skill, 109 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Karpathy Coder?

kunstmusik (a GitHub user) maintains it in kunstmusik/blue, which has 154 GitHub stars. The repository holds 16 skills in this directory. The repository was last updated on October 6, 2026.

Source: kunstmusik/blue on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.