karpathy-guidelines

karpathy-guidelines is a skill for Claude Code from alirezarezvani/ClaudeForge. It costs 50 tokens per session (1,132 once invoked), scanned A, original, MIT.

A set of guidelines for keeping AI-assisted coding work focused, cautious, and easy to verify.

In plain words
What is it for?
Use it when writing, reviewing, refactoring, or fixing code to state uncertainties, make small changes, and check them against clear success conditions.
Why use it?
It helps prevent unnecessary complexity, hidden assumptions, and broad changes that are difficult to review or test.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: mentions CLAUDE.md; mentions Claude Code.

Part of the ClaudeForge plugin — 5 skills, 4 commands, 3 hooks shipped together

Good fit Use it when writing, reviewing, refactoring, or fixing code to state uncertainties, make small changes, and check them against clear success conditions.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/alirezarezvani/claudeforge/karpathy-guidelines
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 alirezarezvani/ClaudeForge --skill karpathy-guidelines
Clone the repo
git clone --depth 1 https://github.com/alirezarezvani/ClaudeForge

Made for: Claude Code.

Or install ClaudeForge, the plugin that ships this one along with the rest of its 5 skills, 4 commands, 3 hooks.

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-guidelines

README.md
[![agentmods](https://agentmods.dev/badge/skills/alirezarezvani/claudeforge/karpathy-guidelines.svg)](https://agentmods.dev/skills/alirezarezvani/claudeforge/karpathy-guidelines)
Your own site
<a href="https://agentmods.dev/skills/alirezarezvani/claudeforge/karpathy-guidelines"><img src="https://agentmods.dev/badge/skills/alirezarezvani/claudeforge/karpathy-guidelines.svg" alt="Measured on agentmods" height="20"></a>
Per session 50 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,132 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.00050 $0.01132
Opus 5 $0.00025 $0.00566
Sonnet 5 $0.00010 $0.00226
Haiku 4.5 $0.00005 $0.00113

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

Security

Grade A, and why

karpathy-guidelines 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 8d 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.

skill/karpathy-guidelines/SKILL.md · 130 lines

How it starts

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

Karpathy Guidelines for LLM Coding

Behavioral guardrails for code generation in Claude Code projects, distilled from observations on common LLM coding failure modes. Apply these to every editing, reviewing, and refactoring task.

Attribution: adapted from the MIT-licensed karpathy-guidelines skill by Forrest Chang (https://github.com/forrestchang/andrej-karpathy-skills), inspired by Andrej Karpathy's commentary on where LLM-generated code typically goes wrong. ClaudeForge integrates these principles so every project initialised or enhanced through /enhance-claude-md ships with them in its CLAUDE.md.


When to Apply

Apply on every non-trivial task: writing new code, editing existing code, code review, refactoring, and bug fixing. They are intentionally conservative — bias toward caution over speed.


1. Think Before Coding

Surface what is uncertain. Do not paper over confusion with plausible-sounding code.

  • State assumptions before implementing; if any are load-bearing and you are not sure, ask.
  • If the request admits more than one reasonable interpretation, list them rather than silently picking one.
  • If a simpler approach exists than the one the user proposed, say so and explain the tradeoff.
  • When something is genuinely unclear, stop. Identify what is unclear in concrete terms, then ask.

2. Simplicity First

Write the minimum code that solves the stated problem. Nothing speculative.

  • Do not add features that were not requested.
  • Do not introduce abstractions when there is only one call site.
  • Do not add configuration knobs or extension points on speculation.
  • Do not add error handling for conditions that cannot occur in this code path.
  • If the first draft is 200 lines and a 50-line version would do, rewrite it before shipping.

Self-check: a senior engineer skimming this diff — would they say it is overcomplicated for what was asked? If yes, simplify.


3. Surgical Changes

Touch only what the task requires. Do not opportunistically refactor.

Read the full file on GitHub · 130 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. 8d ago First seen · 130 lines · 50 tokens per session scan A acd92adddfb6

Subscribe to this mod's changes

karpathy-guidelines is a skill published in the GitHub repository alirezarezvani/ClaudeForge (424 stars, last pushed 3mo ago), licensed MIT. It adds 50 tokens to every session and 1,132 once invoked, about $0.0003 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-08-30.