Agent skill

Karpathy Guidelines

by alirezarezvani in alirezarezvani/ClaudeForge

Behavioral guardrails for LLM-assisted coding. An agent skill from alirezarezvani/ClaudeForge.

MITAuto-check passedDevelopment

Install Karpathy Guidelines

skills CLI
$ npx skills add alirezarezvani/ClaudeForge --skill karpathy-guidelines -a claude-code

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

GitHub CLI
$ gh skill install alirezarezvani/ClaudeForge karpathy-guidelines --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/alirezarezvani/ClaudeForge.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skill/karpathy-guidelines .claude/skills/karpathy-guidelines && 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-guidelines
GitHub stars
429
Token cost
~1.2k tokens
SKILL.md length
569 words
Files
1
Skills in repo
4
Repo updated
First seen
Licence
MIT

At a glance

Behavioral guardrails for LLM-assisted coding. An agent skill from alirezarezvani/ClaudeForge.

  • Works in 4 steps: Think Before Coding → Simplicity First → Surgical Changes → …
  • Refactoring code in any project to avoid overcomplication
  • SKILL.md covers When to Apply, 1. Think Before Coding, 2. Simplicity First and 3. Surgical Changes, plus 3 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Karpathy Guidelines is an agent skill from alirezarezvani/ClaudeForge. Behavioral guardrails for LLM-assisted coding. Use when writing, reviewing, or refactoring code in any project to avoid overcomplication, keep changes surgical, surface assumptions early, and execute against verifiable success criteria.

Its SKILL.md is about 1.2k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Development, covering Refactoring and LLM guardrails. The repository describes itself as: A CLAUDE.md Generator and Maintenance tool for for Claude Code to create high-quality CLAUDE.md instruction files — aligned with Anthropic’s best practices for Claude Code. The licence is MIT.

When your agent uses it

  • Refactoring code in any project to avoid overcomplication
  • Keep changes surgical
  • Surface assumptions early
  • Execute against verifiable success criteria

Example prompts

  • “/karpathy-guidelines”

Requirements

  • Pre-approved tools (allowed-tools): Read, Glob, Grep

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 032c5e5. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Read
    • Glob
    • Grep

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    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):

    • github.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 Guidelines loads about 1.2k tokens when it runs. Until then it costs about 64 tokens; SKILL.md has 569 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~64
When it runs · the whole SKILL.md, loaded when a task matches
~1.2k

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); files beside SKILL.md are not scanned.

SKILL.md

The full file from alirezarezvani/ClaudeForge at commit 032c5e5, republished under its MIT licence (© alirezarezvani). 569 words, ~1,225 tokens.

Download SKILL.mdSave it as .claude/skills/karpathy-guidelines/SKILL.md (or your agent's skills folder).
name
karpathy-guidelines
description
Behavioral guardrails for LLM-assisted coding. Use when writing, reviewing, or refactoring code in any project to avoid overcomplication, keep changes surgical, surface assumptions early, and execute against verifiable success criteria.
allowed-tools
Read, Glob, Grep
license
MIT
paths
**/*.py, **/*.ts, **/*.tsx, **/*.js, **/*.jsx, **/*.go, **/*.rs, **/*.java, **/*.kt, **/*.rb, **/*.php, **/*.swift, **/*.c, **/*.cc, **/*.cpp, **/*.h…
permissions.allow
Read, Glob, Grep

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.

  • Do not "improve" adjacent code, comments, or formatting that the task did not require touching.
  • Do not refactor code that is working, even when you would have written it differently.
  • Match the surrounding code's style and conventions, even when they differ from your defaults.
  • If you notice unrelated dead code or bugs, surface them in the response — do not silently delete or fix them.

When your own changes leave orphans:

  • Remove imports, variables, and helpers that your edits made unreachable.
  • Do not remove pre-existing dead code unless explicitly asked.

Diff test: every changed line should be traceable to the user's request. If a line is not, drop it.


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

4. Goal-Driven Execution

Turn the task into a verifiable goal, then iterate until the verification passes.

  • Convert vague requests into checkable success criteria before coding:
    • "Add validation" → write the failing tests for invalid inputs first, then make them pass.
    • "Fix the bug" → write a test that reproduces the bug, then make it pass.
    • "Refactor X" → confirm the existing tests pass, refactor, confirm they still pass.
  • For multi-step tasks, state the plan inline with verification per step:
1. <step> → verify: <how you will check>
2. <step> → verify: <how you will check>
3. <step> → verify: <how you will check>

Strong success criteria let you loop without supervision. Vague ones ("make it work") force the user back into the loop.


Integration with ClaudeForge

  • The slash command /enhance-claude-md injects a ## Behavioral Guidelines section into every generated or enhanced CLAUDE.md, summarising these four principles with a link back to this skill.
  • The claude-md-guardian agent preserves the section across automated maintenance updates.
  • skill/generator.py and skill/template_selector.py insert the section unconditionally — these principles are not opt-in.

Effectiveness Indicators

The guidelines are working when diffs trend smaller, rewrites caused by overcomplication drop, and clarifying questions arrive before implementation rather than after a failed attempt.

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

Files

Just SKILL.md in skill/karpathy-guidelines of alirezarezvani/ClaudeForge.

Open the folder on GitHubat commit 032c5e5

Compare with similar skills

Karpathy Guidelines 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 Guidelines compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Karpathy Guidelines this skillalirezarezvani/ClaudeForge429—~1.2kAutomated safety check: PassMIT
Manor Coding Guardrailsmanor-os/manor-ai162—~816Automated safety check: PassMIT
Refactor React Effectslangfuse/langfuse36k—~1.7kAutomated safety check: PassCustom licence
Concern Patternsdilolabs/nosia2131 repos~1.8kAutomated safety check: PassMIT
Elixirstreamband/hydra-srt146—~804Automated safety check: PassApache-2.0
Change CleanupSimon-Initiative/oli-torus119—~3.7kAutomated safety check: PassMIT

Similar skills

  • Manor Coding Guardrails

    manor-os/manor-ai

    A skill your agent uses when writing, reviewing, or refactoring Manor code to avoid overcomplication, make surgical changes, surface assumptions, and define verifiable success criteria.

    162 GitHub stars~816 tokensUpdated 1 mo ago
    AI & LLM EngineeringAuto-check passed
  • Refactor React Effects

    langfuse/langfuse

    Refactor avoidable React useEffect usage in Langfuse frontend code.

    36k GitHub stars~1.7k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Concern Patterns

    dilolabs/nosia

    Creates and refactors model and controller concerns for shared behavior.

    213 GitHub starsUsed in 1 repo~1.8k tokens
    DevelopmentAuto-check passed
  • Elixir

    streamband/hydra-srt

    A skill your agent uses for Elixir/Phoenix development in this repo: implementing features, refactors, debugging, tests, Ecto changes, and production-safe fixes.

    146 GitHub stars~804 tokensUpdated 22 days ago
    DevelopmentAuto-check passed
  • Change Cleanup

    Simon-Initiative/oli-torus

    Clean up and harden code introduced by the current branch without drifting into broad refactors.

    119 GitHub stars~3.7k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Review C++ changes for string parameter and call-site efficiency conventions (std::stringview, std::string&&, const std::string&, const char, and TransparentStringMap lookup).

    681 GitHub stars~702 tokensUpdated yesterday
    DevelopmentAuto-check passed

More from alirezarezvani/ClaudeForge

  • Claude Md Dependency Rescan

    alirezarezvani/ClaudeForge

    Re-detect this project's tech stack from package.json / requirements.txt / pyproject.toml / go.mod / Cargo.toml and diff it against the Tech Stack section of every CLAUDE.md.

    429 GitHub stars~624 tokensUpdated 4 mo ago
    Auto-check passed
  • Claude Md Drift Audit

    alirezarezvani/ClaudeForge

    Audit every CLAUDE.md in this project for drift against the last week of git history.

    429 GitHub stars~559 tokensUpdated 4 mo ago
    Auto-check passed
  • Claude Md Link Check

    alirezarezvani/ClaudeForge

    Verify every @path chain import and every markdown link inside every CLAUDE.md in this project resolves to an existing file.

    429 GitHub stars~525 tokensUpdated 4 mo ago
    Auto-check passed

Questions about Karpathy Guidelines

What does Karpathy Guidelines do?

Behavioral guardrails for LLM-assisted coding. An agent skill from alirezarezvani/ClaudeForge. Karpathy Guidelines is an agent skill from alirezarezvani/ClaudeForge. Behavioral guardrails for LLM-assisted coding.

When should I use Karpathy Guidelines?

Karpathy Guidelines fits situations like: refactoring code in any project to avoid overcomplication; keep changes surgical; surface assumptions early; execute against verifiable success criteria.

How do I install Karpathy Guidelines in Claude Code?

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

How do I install Karpathy Guidelines in Codex?

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

Can I use Karpathy Guidelines 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 alirezarezvani/ClaudeForge --skill karpathy-guidelines -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-guidelines, .gemini/skills/karpathy-guidelines, .github/skills/karpathy-guidelines and .opencode/skills/karpathy-guidelines in your project.

What does Karpathy Guidelines need to run?

SKILL.md names no scripts, command-line tools or credentials: Karpathy Guidelines is instructions for the agent only. Its frontmatter pre-approves these tools: Read, Glob, Grep.

Does Karpathy Guidelines access the network?

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

Is Karpathy Guidelines 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. Review the folder before installing.

What licence does Karpathy Guidelines use?

Karpathy Guidelines 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 Guidelines use?

About 1.2k tokens (SKILL.md is roughly 4.9k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Karpathy Guidelines?

Skills that share tags, products or a category with Karpathy Guidelines: Manor Coding Guardrails (manor-os/manor-ai, 162 stars), Refactor React Effects (langfuse/langfuse, 36k stars), Concern Patterns (dilolabs/nosia, 213 stars) and Elixir (streamband/hydra-srt, 146 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Karpathy Guidelines?

alirezarezvani (a GitHub user) maintains it in alirezarezvani/ClaudeForge, which has 429 GitHub stars. The repository holds 4 skills in this directory. The repository was last updated on May 19, 2026.

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