karpathy-coder
하는 일
코드를 네 가지 원칙으로 검토합니다. 가정을 밝히고, 단순하게 유지하며, 필요한 것만 바꾸고, 명확한 목표에 맞춰 검증합니다. AI가 만든 코드를 더 가볍고 안전하게 만들고 싶은 개발자를 위한 스킬입니다.
사용하는 경우
- ✓커밋하기 직전에 과도한 설계가 없는지 확인하고 싶을 때.
- ✓diff를 검토하는데 변경 범위가 너무 크다고 의심될 때.
- ✓에이전트가 승인받지 않은 가정을 하고 있을 수 있을 때.
스킬 링크
https://github.com/alirezarezvani/claude-skills/blob/main/engineering/karpathy-coder/skills/karpathy-coder/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“제 마지막 변경에 과도한 설계가 없는지, 그리고 제가 묻지 않고 가정한 것이 있는지 확인해 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
에이전트는 도우미 스크립트를 실행해 불필요한 복잡성, 목표 밖의 변경, 말하지 않은 가정을 표시한 뒤 발견 사항을 보고합니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
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.
Python tools (scripts/)
All tools are stdlib-only. Run with --help.
| Script | What it detects |
|---|---|
complexity_checker.py |
Over-engineering: too many classes, deep nesting, high cyclomatic complexity, unused params, premature abstractions |
diff_surgeon.py |
Diff noise: lines that don't trace to the stated goal — comment changes, style drift, drive-by refactors |
assumption_linter.py |
Hidden assumptions in a plan: unasked features, missing clarifications, silent interpretation choices |
goal_verifier.py |
Weak 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 principlereferences/anti-patterns.md— 10+ before/after examples across Python, TypeScript, and shellreferences/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 s
자주 묻는 질문
단순하게 유지한다는 것은 무슨 뜻인가요?
작업에 필요한 코드만 쓰고, 추가 기능이나 추측에 기반한 추상화는 넣지 않는다는 뜻입니다.
커밋 전에 코드를 확인할 수 있나요?
네. 커밋 전 검사로 실행할 수 있어서, 커밋이 만들어지기 전에 문제를 잡을 수 있습니다.
이 원칙은 어디에서 왔나요?
AI 코딩 도구가 흔히 저지르는 실수에 대한 Andrej Karpathy의 관찰을 바탕으로 합니다.
상세 정보
작성자의 원본 설명
Use before committing or while reviewing a diff, or when code may be overbuilt. Checks it against Karpathy's four principles with complexity_checker.py, diff_surgeon.py and assumption_linter.py: surface assumptions, keep it simple, change surgically, verify goals.
인기도
- GitHub 스타
- 29k
- 순위
- #9563
- 라이선스
- MIT
- 업데이트
- 2026. 11. 2.
댓글
- …
이 저장소의 다른 스킬
agent-launcher-orchestrator
29k하나의 명확한 목표에서 시작해 내 계정의 Claude 관리형 에이전트를 계획하고, 만들고, 테스트하고, 예약하도록 돕습니다.
grade-iterate
29k에이전트가 채점 기준표에 따라 관리형 AI 에이전트의 결과물을 평가하고, 정해진 횟수 안에서 개선하도록 돕습니다. 끝없이 반복하지 않습니다.
interview
29kAI 에이전트 아이디어에 대해 질문하고, 답변을 간단한 빌드 계획으로 바꿔 어떤 것도 출시하기 전에 정리하도록 돕습니다.
run-without-you
29k에이전트가 관리형 AI 에이전트를 예약 또는 이벤트에 따라 실행되도록 설정하고, 출시 전에 cron 시간을 확인하도록 돕습니다.