karpathy-coding-principles

karpathy-coding-principles is a skill for Claude Code from oyi77/1ai-skills. It costs 46 tokens per session (1,229 once invoked), scanned A, original, MIT.

A set of coding principles based on Andrej Karpathy's guidance: think before coding, keep solutions simple, make only necessary changes, and verify the result.

In plain words
What is it for?
Use it when implementing or reviewing code, reducing unnecessary complexity, or directing an AI coding agent toward smaller, verifiable changes.
Why use it?
It helps prevent overengineering, speculative features, and broad edits that create unnecessary risk. The guidance keeps coding work focused on the stated goal.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the 1ai-skills plugin — 187 skills, 4 commands shipped together

Good fit Use it when implementing or reviewing code, reducing unnecessary complexity, or directing an AI coding agent toward smaller, verifiable changes.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/oyi77/1ai-skills/karpathy-coding-principles
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add oyi77/1ai-skills --skill karpathy-coding-principles
Clone the repo
git clone --depth 1 https://github.com/oyi77/1ai-skills

Made for: Claude Code.

Or install 1ai-skills, the plugin that ships this one along with the rest of its 187 skills, 4 commands.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for karpathy-coding-principles

README.md
[![agentmods](https://agentmods.dev/badge/skills/oyi77/1ai-skills/karpathy-coding-principles/github.svg)](https://agentmods.dev/skills/oyi77/1ai-skills/karpathy-coding-principles)
Your own site
<a href="https://agentmods.dev/skills/oyi77/1ai-skills/karpathy-coding-principles"><img src="https://agentmods.dev/badge/skills/oyi77/1ai-skills/karpathy-coding-principles/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for karpathy-coding-principles

Your own site · 80×15
<a href="https://agentmods.dev/skills/oyi77/1ai-skills/karpathy-coding-principles"><img src="https://agentmods.dev/badge/skills/oyi77/1ai-skills/karpathy-coding-principles.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 46 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,229 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00046 $0.01229
Opus 5 $0.00023 $0.00615
Sonnet 5 $0.00009 $0.00246
Haiku 4.5 $0.00005 $0.00123

Measured 6d ago against content hash 435a15aab2e5, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

karpathy-coding-principles scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

core/karpathy-coding-principles/SKILL.md · 166 lines

How it starts

The opening of the file, as written. The whole thing — 166 lines — stays where its author put it; the contents beside it link to each section on GitHub.

When NOT to Use

  • Task is outside your authorization scope
  • You need to implement controls (use implementing-* skills)
  • Task is about analysis, not action (use analyzing-* skills)
  • You don't have access to target systems
  • Task requires compliance expertise (consult professionals)
  • Task is about defense, not offense (use defensive skills)

Overview

Andrej Karpathy's 4 coding principles distilled into actionable rules for AI agents and developers. Focuses on reducing overengineering, maintaining simplicity, making minimal changes, and verifying outcomes. Originally from multica-ai/andrej-karpathy-skills.

Capabilities

  • Enforce explicit reasoning before writing code
  • Prevent speculative features and unnecessary abstractions
  • Restrict changes to only what the task requires
  • Convert imperative tasks into declarative goals with verification

When to Use

Trigger phrases:

  • "karpathy coding principles"

  • "Writing or reviewing code for quality"

  • "Reducing overengineering in implementations"

  • "Coaching LLMs to produce cleaner output"

  • Writing or reviewing code for quality

  • Reducing overengineering in implementations

  • Coaching LLMs to produce cleaner output

  • Code review to catch scope creep

  • Refactoring sessions to simplify architecture

  • Any coding task where discipline matters

Principle 1: Think Before Coding

Before writing any code, reason explicitly about the problem.

  • Surface assumptions — state what you believe about the requirements
  • Ask clarifying questions — do not guess when ambiguity exists
  • Outline your approach in plain language before implementation
  • Consider edge cases and failure modes upfront
# BAD: Jump straight to code
def process(data):
    # immediately writing implementation

# GOOD: Think first
# Assumption: data is a list of dicts with 'id' and 'value' keys
# Edge cases: empty list, missing keys, negative values
# Approach: validate -> transform -> aggregate
def process(data):
    ...

Read the full file on GitHub · 166 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 6d ago First seen · 166 lines · 46 tokens per session scan A 435a15aab2e5

Subscribe to this mod's changes

karpathy-coding-principles is a skill published in the GitHub repository oyi77/1ai-skills (12 stars, last pushed yesterday), licensed MIT. It adds 46 tokens to every session and 1,229 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

karpathy-coder

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…

csiddhant796-blip/claude-skills-collection · 87 tokens

security-review

AI-powered security analysis of code changes — traces data flow, detects injection, auth bypass, secrets exposure, and unsafe deserialization across files. Use when reviewing pending changes, before release-branch, during verify-work Phase 5, during build-epic Step 0 threat modeling, or when the user says "security…

danielvm-git/bigpowers · 76 tokens

audit-code

Self-review checklist for the coding agent to run before dispatching a reviewer. Checks CONVENTIONS.md compliance, Boy Scout Rule, test coverage, types, and SOLID. Produces a pass/fail checklist. Use before request-review, before committing, or when user asks for a code quality check.

danielvm-git/bigpowers · 64 tokens

request-review

Dispatch a fresh reviewer agent with a clean context to critique the code after audit-code passes. The reviewer has no shared state with the coding agent and gives a genuine second opinion. Use after audit-code passes, before committing, or when user wants an independent code review.

danielvm-git/bigpowers · 56 tokens

respond-review

Act on a reviewer agent's feedback systematically — categorize findings, apply fixes, verify tests still pass. Use after request-review returns a report, or when user wants to work through code review findings.

danielvm-git/bigpowers · 42 tokens

nlpm-audit

Audit SKILL.md, AGENTS.md, prompts, hooks, and plugin manifests for instruction conflicts, quality, broken references, and manifest-to-disk drift.

seaworld008/Commonly-used-high-value-skills · 37 tokens