Skip to content

Commit 761e8eb

Browse files
author
VE-Yoga
committed
vault backup: 2026-02-13 23:15:27
1 parent 6b4c394 commit 761e8eb

4 files changed

Lines changed: 321 additions & 0 deletions
166 KB
Loading
231 KB
Loading
104 KB
Loading
Lines changed: 321 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,321 @@
1+
---
2+
title:
3+
tags:
4+
date: 2026-02-13
5+
toc: true
6+
toc_sticky: true
7+
---
8+
9+
# 65 lines of Markdown - a Claude Code sensation
10+
## 65 lines of Markdown - a Claude Code sensation
11+
12+
published on 2026-02-12 · tagged with [#ai](https://tildeweb.nl/~michiel/tags/ai.html), [#code](https://tildeweb.nl/~michiel/tags/code.html) and [#cursor](https://tildeweb.nl/~michiel/tags/cursor.html)
13+
14+
Yesterday my employer organized an AI workshop. My company works a lot with AI supported code editing; using Cursor and VS Code, GitHub Copilot. Plus we do custom stuff using AWS Bedrock, agents using Strands and so on, all the stuff everyone is working with nowadays.
15+
16+
Our facilitator explained how custom rules files can be so very helpful for AI tooling. He linked to this extension with [Karpathy-Inspired Claude Code Guidelines](https://github.com/forrestchang/andrej-karpathy-skills) as an example. Apparently this plugin is very popular! Yesterday morning the project had 3.5K stars and at the end of the day this already increased to 3.9K. That’s a lot of stars.
17+
18+
I went on to investigate what this extension actually does and found that it’s just [one Markdown file of 65 lines long](https://github.com/forrestchang/andrej-karpathy-skills/blob/main/CLAUDE.md) that lays out four principles; the first one is _“Think Before Coding”_, added with some packaging to make it install in Claude Code.
19+
20+
## Publishing it as a Cursor extension
21+
22+
But I don’t use Claude Code, so I fired up Codex CLI and turned it into an [extension for VS Code](https://marketplace.visualstudio.com/items?itemName=MichielWBeijen.andrej-karpathy-skills-cursor-vscode) and for [Cursor](https://open-vsx.org/extension/MichielWBeijen/andrej-karpathy-skills-cursor-vscode), which is a fork of VS Code but uses a plugin registry from the Eclipse Foundation.
23+
24+
![vscode extension](https://tildeweb.nl/~michiel/images/karpathy-extension-vscode.png)
25+
26+
Getting the plugins published was the most work. On the ‘VS Code Marketplace’ I am not a _Verified Publisher_ meaning I do not get a green check mark next to my name, and you will get a warning if you want to install my extension. And apparently the only way to get rid of that is to wait for six months with at least one extension published and then apply for verification. So starting August I can apply for that and any new extensions get automatically trusted.
27+
28+
For Cursor the process felt very cumbersome: I had to create an account on [open-vsx.org](https://open-vsx.org), create an Eclipse Foundation account, link those accounts, link to my GitHub account, sign an Eclipse agreement, and finally create a GitHub Issue to ‘claim’ my VS Code Marketplace namespace.
29+
30+
## Using the extension
31+
32+
So, what does using the extension actually feel like? Because of the non-deterministic nature of these models, I found it hard to tell. I tried a simple refactoring, and I had the idea that it was very reluctant in making changes. Was the result better? I’m not really sure.
33+
34+
Typically, your Cursor rules would list the constraints for _your_ environment, explaining what coding standards to adhere to, architectural constraints and so on. I get that, it makes sense.
35+
36+
I find it wild to think that a company spends millions and millions of dollars on training a model, with tons of engineers meticulously improving output, and then some guy comes along and writes 60 lines of text including **Think before coding** in the rules and _that_ would make all the difference.
37+
38+
But the original repository has almost 4,000 stars, and surely, 4,000 developers can’t be wrong?
39+
40+
Please try for yourself! Install the extension, don’t forget to [star my repository](https://github.com/mbeijen/andrej-karpathy-skills-cursor-vscode) and see the results.
41+
42+
43+
![](../_asset/2026-02-13-think-before-coing-1771020722830.webp)
44+
45+
46+
# Karpathy-Inspired Claude Code Guidelines
47+
48+
[](https://github.com/forrestchang/andrej-karpathy-skills#karpathy-inspired-claude-code-guidelines)
49+
50+
A single `CLAUDE.md` file to improve Claude Code behavior, derived from [Andrej Karpathy's observations](https://x.com/karpathy/status/2015883857489522876) on LLM coding pitfalls.
51+
52+
## The Problems
53+
54+
[](https://github.com/forrestchang/andrej-karpathy-skills#the-problems)
55+
56+
From Andrej's post:
57+
58+
> "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."
59+
60+
> "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."
61+
62+
> "They still sometimes change/remove comments and code they don't sufficiently understand as side effects, even if orthogonal to the task."
63+
64+
## The Solution
65+
66+
[](https://github.com/forrestchang/andrej-karpathy-skills#the-solution)
67+
68+
Four principles in one file that directly address these issues:
69+
70+
|Principle|Addresses|
71+
|---|---|
72+
|**Think Before Coding**|Wrong assumptions, hidden confusion, missing tradeoffs|
73+
|**Simplicity First**|Overcomplication, bloated abstractions|
74+
|**Surgical Changes**|Orthogonal edits, touching code you shouldn't|
75+
|**Goal-Driven Execution**|Leverage through tests-first, verifiable success criteria|
76+
77+
## The Four Principles in Detail
78+
79+
[](https://github.com/forrestchang/andrej-karpathy-skills#the-four-principles-in-detail)
80+
81+
### 1. Think Before Coding
82+
83+
[](https://github.com/forrestchang/andrej-karpathy-skills#1-think-before-coding)
84+
85+
**Don't assume. Don't hide confusion. Surface tradeoffs.**
86+
87+
LLMs often pick an interpretation silently and run with it. This principle forces explicit reasoning:
88+
89+
- **State assumptions explicitly** — If uncertain, ask rather than guess
90+
- **Present multiple interpretations** — Don't pick silently when ambiguity exists
91+
- **Push back when warranted** — If a simpler approach exists, say so
92+
- **Stop when confused** — Name what's unclear and ask for clarification
93+
94+
### 2. Simplicity First
95+
96+
[](https://github.com/forrestchang/andrej-karpathy-skills#2-simplicity-first)
97+
98+
**Minimum code that solves the problem. Nothing speculative.**
99+
100+
Combat the tendency toward overengineering:
101+
102+
- No features beyond what was asked
103+
- No abstractions for single-use code
104+
- No "flexibility" or "configurability" that wasn't requested
105+
- No error handling for impossible scenarios
106+
- If 200 lines could be 50, rewrite it
107+
108+
**The test:** Would a senior engineer say this is overcomplicated? If yes, simplify.
109+
110+
### 3. Surgical Changes
111+
112+
[](https://github.com/forrestchang/andrej-karpathy-skills#3-surgical-changes)
113+
114+
**Touch only what you must. Clean up only your own mess.**
115+
116+
When editing existing code:
117+
118+
- Don't "improve" adjacent code, comments, or formatting
119+
- Don't refactor things that aren't broken
120+
- Match existing style, even if you'd do it differently
121+
- If you notice unrelated dead code, mention it — don't delete it
122+
123+
When your changes create orphans:
124+
125+
- Remove imports/variables/functions that YOUR changes made unused
126+
- Don't remove pre-existing dead code unless asked
127+
128+
**The test:** Every changed line should trace directly to the user's request.
129+
130+
### 4. Goal-Driven Execution
131+
132+
[](https://github.com/forrestchang/andrej-karpathy-skills#4-goal-driven-execution)
133+
134+
**Define success criteria. Loop until verified.**
135+
136+
Transform imperative tasks into verifiable goals:
137+
138+
|Instead of...|Transform to...|
139+
|---|---|
140+
|"Add validation"|"Write tests for invalid inputs, then make them pass"|
141+
|"Fix the bug"|"Write a test that reproduces it, then make it pass"|
142+
|"Refactor X"|"Ensure tests pass before and after"|
143+
144+
For multi-step tasks, state a brief plan:
145+
146+
```
147+
1. [Step] → verify: [check]
148+
2. [Step] → verify: [check]
149+
3. [Step] → verify: [check]
150+
```
151+
152+
Strong success criteria let the LLM loop independently. Weak criteria ("make it work") require constant clarification.
153+
154+
## Install
155+
156+
[](https://github.com/forrestchang/andrej-karpathy-skills#install)
157+
158+
**Option A: Claude Code Plugin (recommended)**
159+
160+
```shell
161+
claude plugins add https://github.com/forrestchang/andrej-karpathy-skills
162+
```
163+
164+
This installs the guidelines as a Claude Code plugin, making the skill available across all your projects.
165+
166+
**Option B: CLAUDE.md (per-project)**
167+
168+
New project:
169+
170+
```shell
171+
curl -o CLAUDE.md https://raw.githubusercontent.com/forrestchang/andrej-karpathy-skills/main/CLAUDE.md
172+
```
173+
174+
Existing project (append):
175+
176+
```shell
177+
echo "" >> CLAUDE.md
178+
curl https://raw.githubusercontent.com/forrestchang/andrej-karpathy-skills/main/CLAUDE.md >> CLAUDE.md
179+
```
180+
181+
## Key Insight
182+
183+
[](https://github.com/forrestchang/andrej-karpathy-skills#key-insight)
184+
185+
From Andrej:
186+
187+
> "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."
188+
189+
The "Goal-Driven Execution" principle captures this: transform imperative instructions into declarative goals with verification loops.
190+
191+
## How to Know It's Working
192+
193+
[](https://github.com/forrestchang/andrej-karpathy-skills#how-to-know-its-working)
194+
195+
These guidelines are working if you see:
196+
197+
- **Fewer unnecessary changes in diffs** — Only requested changes appear
198+
- **Fewer rewrites due to overcomplication** — Code is simple the first time
199+
- **Clarifying questions come before implementation** — Not after mistakes
200+
- **Clean, minimal PRs** — No drive-by refactoring or "improvements"
201+
202+
## Customization
203+
204+
[](https://github.com/forrestchang/andrej-karpathy-skills#customization)
205+
206+
These guidelines are designed to be merged with project-specific instructions. Add them to your existing `CLAUDE.md` or create a new one.
207+
208+
For project-specific rules, add sections like:
209+
210+
```md
211+
## Project-Specific Guidelines
212+
213+
- Use TypeScript strict mode
214+
- All API endpoints must have tests
215+
- Follow the existing error handling patterns in `src/utils/errors.ts`
216+
```
217+
218+
## Tradeoff Note
219+
220+
[](https://github.com/forrestchang/andrej-karpathy-skills#tradeoff-note)
221+
222+
These guidelines bias toward **caution over speed**. For trivial tasks (simple typo fixes, obvious one-liners), use judgment — not every change needs the full rigor.
223+
224+
The goal is reducing costly mistakes on non-trivial work, not slowing down simple tasks.
225+
226+
## License
227+
228+
[](https://github.com/forrestchang/andrej-karpathy-skills#license)
229+
230+
MIT
231+
232+
233+
![](../_asset/2026-02-13-think-before-coing-1771020749627.webp)
234+
## CLAUDE.md
235+
# CLAUDE.md
236+
237+
[](https://github.com/forrestchang/andrej-karpathy-skills/blob/main/CLAUDE.md#claudemd)
238+
239+
Behavioral guidelines to reduce common LLM coding mistakes. Merge with project-specific instructions as needed.
240+
241+
**Tradeoff:** These guidelines bias toward caution over speed. For trivial tasks, use judgment.
242+
243+
## 1. Think Before Coding
244+
245+
[](https://github.com/forrestchang/andrej-karpathy-skills/blob/main/CLAUDE.md#1-think-before-coding)
246+
247+
**Don't assume. Don't hide confusion. Surface tradeoffs.**
248+
249+
Before implementing:
250+
251+
- State your assumptions explicitly. If uncertain, ask.
252+
- If multiple interpretations exist, present them - don't pick silently.
253+
- If a simpler approach exists, say so. Push back when warranted.
254+
- If something is unclear, stop. Name what's confusing. Ask.
255+
256+
## 2. Simplicity First
257+
258+
[](https://github.com/forrestchang/andrej-karpathy-skills/blob/main/CLAUDE.md#2-simplicity-first)
259+
260+
**Minimum code that solves the problem. Nothing speculative.**
261+
262+
- No features beyond what was asked.
263+
- No abstractions for single-use code.
264+
- No "flexibility" or "configurability" that wasn't requested.
265+
- No error handling for impossible scenarios.
266+
- If you write 200 lines and it could be 50, rewrite it.
267+
268+
Ask yourself: "Would a senior engineer say this is overcomplicated?" If yes, simplify.
269+
270+
## 3. Surgical Changes
271+
272+
[](https://github.com/forrestchang/andrej-karpathy-skills/blob/main/CLAUDE.md#3-surgical-changes)
273+
274+
**Touch only what you must. Clean up only your own mess.**
275+
276+
When editing existing code:
277+
278+
- Don't "improve" adjacent code, comments, or formatting.
279+
- Don't refactor things that aren't broken.
280+
- Match existing style, even if you'd do it differently.
281+
- If you notice unrelated dead code, mention it - don't delete it.
282+
283+
When your changes create orphans:
284+
285+
- Remove imports/variables/functions that YOUR changes made unused.
286+
- Don't remove pre-existing dead code unless asked.
287+
288+
The test: Every changed line should trace directly to the user's request.
289+
290+
## 4. Goal-Driven Execution
291+
292+
[](https://github.com/forrestchang/andrej-karpathy-skills/blob/main/CLAUDE.md#4-goal-driven-execution)
293+
294+
**Define success criteria. Loop until verified.**
295+
296+
Transform tasks into verifiable goals:
297+
298+
- "Add validation" → "Write tests for invalid inputs, then make them pass"
299+
- "Fix the bug" → "Write a test that reproduces it, then make it pass"
300+
- "Refactor X" → "Ensure tests pass before and after"
301+
302+
For multi-step tasks, state a brief plan:
303+
304+
```
305+
1. [Step] → verify: [check]
306+
2. [Step] → verify: [check]
307+
3. [Step] → verify: [check]
308+
```
309+
310+
Strong success criteria let you loop independently. Weak criteria ("make it work") require constant clarification.
311+
312+
---
313+
314+
**These guidelines are working if:** fewer unnecessary changes in diffs, fewer rewrites due to overcomplication, and clarifying questions come before implementation rather than after mistakes.
315+
316+
![](../_asset/2026-02-13-think-before-coing-1771020774638.webp)
317+
318+
319+
https://tildeweb.nl/~michiel/65-lines-of-markdown-a-claude-code-sensation.html
320+
https://github.com/forrestchang/andrej-karpathy-skills
321+
https://github.com/forrestchang/andrej-karpathy-skills/blob/main/CLAUDE.md

0 commit comments

Comments
 (0)