Karpathy-Inspired Four Rules for a Coding Agent in One File Gather 232,000 GitHub Stars
Coding agents silently guess at the task and change things they weren't asked to touch. Ask for a fix to one function and you get a rewritten module. The author of a post on X proposes putting a CLAUDE.md file in the repository: a set of four rules in the spirit of Andrej Karpathy that the agent reads before it starts work. By the author's account, the repository has collected more than 232,000 stars on GitHub, which act as likes from users. The idea is to anchor the agent's behavior in a file rather than repeat it in every prompt.
AI-processed from X: @beamnxw; edited by Hamidun News
You ask a coding agent to fix one function and get back a rewritten module, new abstractions built "for later," and other people's comments reformatted on the side. The agent never asked anything. It silently decided it understood the task.
A post on X is circulating that addresses this problem. Its author (@beamnxw) suggests putting a single text file, CLAUDE.md, in the repository: a standing instruction that the agent reads before it starts work.
The file lists four rules in the spirit of the well-known AI researcher Andrej Karpathy. According to the author, the repository containing it has already gathered more than 232,000 stars on GitHub. On GitHub, stars work as likes and bookmarks: the more of them a project has, the more people have saved it for themselves.
What the file is and where the stars come from
We have not verified the 232,000 figure: it comes from the post itself, as does the one-command installation link. The file is not limited to Claude Code. It can be used in Cursor, Codex, and any setup where the agent reads instructions from AGENTS.md. It is the same principle under a different name: a shared file with behavioral rules at the root of the project.
The idea is simple. Instead of writing a long prompt full of reminders every time, you place a set of behavioral rules in the repository once. The agent reads them before working with files and follows them in every task.
Four rules with concrete examples
Think before writing code. The agent should not guess silently. If a task allows two solutions, it names the trade-offs and asks a clarifying question. Example: you ask it to "add a cache." Instead of immediately choosing Redis, it asks whether the cache needs to persist between requests or whether in-process memory is enough.
Simplicity first. No speculative abstractions, meaning scaffolding for scenarios nobody requested. The author gives a benchmark: 200 lines of bloated code become 50. If you need one function, no factory, interface, or configuration layer appears.
Surgical changes. The agent touches only the lines that follow directly from the request. No incidental edits to comments, style, or neighboring code "while it's there." For review, this is the most valuable property: the diff stays small and can be checked by eye in a couple of minutes.
Goal-driven loop. Every task becomes a verifiable result: first a failing test, then a fix, and so on until all tests pass. The agent checks its own work instead of handing you code with a note saying "should work."
What to keep in mind
The post is written in the "save it and deploy it today" genre, and it ends by promoting the author's article on how to build an "AI team" with Claude. It contains no concrete measurements. Figures like "1,000 lines down to 100" or "200 down to 50" are illustrations, not benchmark results. There is also no data on how much the rules actually reduce errors and review corrections.
There are substantive limitations too. A strict "ask first" rule can be irritating on small tasks: if the agent checks in on every comma, you lose time. The "don't touch anything extra" rule gets in the way where a refactor is genuinely needed. And the "failing test → fix" loop only works in a project that already has a reasonable test suite. In a repository without tests, the agent has nothing to check its own work against.
What to do in practice
The idea is worth trying because it is cheap. Add the file to one working branch, take five routine tasks, and compare the diff size and the number of clarifying questions against the normal mode. If the agent becomes less prone to "creative" changes, keep the rules. If it starts bombarding you with questions, relax the first rule for minor edits.
The takeaway reaches beyond the file itself. The agent's behavior is better anchored in a standing repository instruction than in the prompt for each task. Such a file can be versioned, discussed with the team, and tailored to your stack. A ready-made rule set from a well-known engineer simply saves time at the start.
- Nov 21, 2026Anthropic and Claude Claim Proof of the Riemann Hypothesis, Stanford Responds Without AI
- Nov 21, 2026A hotel warned about a breach nine days late, and the author put Claude and Codex on hunting new vulnerabilities
- Nov 21, 2026Amazon Offers AWS Quick AI Agent with Claude for Free, Plus Tier at $25 a Month
- Nov 21, 2026GigaChat: 7th in the World on a Blind Russian-Language Ranking, but 78 Elo Points Behind the Leader
Key Questions Answered
What the file is and where the stars come from?
We have not verified the 232,000 figure: it comes from the post itself, as does the one-command installation link. The file is not limited to Claude Code. It can be used in Cursor, Codex, and any setup where the agent reads instructions from AGENTS.md. It is the same principle under a different name: a shared file with behavioral rules at the root of the project. The idea is simple. Instead of writing a long prompt full of reminders every time, you place a set of behavioral rules in the repository once.
What are the key details on Four rules with concrete examples?
Think before writing code. The agent should not guess silently. If a task allows two solutions, it names the trade-offs and asks a clarifying question. Example: you ask it to "add a cache." Instead of immediately choosing Redis, it asks whether the cache needs to persist between requests or whether in-process memory is enough. Simplicity first. No speculative abstractions, meaning scaffolding for scenarios nobody requested. The author gives a benchmark: 200 lines of bloated code become 50.
What to keep in mind?
The post is written in the "save it and deploy it today" genre, and it ends by promoting the author's article on how to build an "AI team" with Claude. It contains no concrete measurements. Figures like "1,000 lines down to 100" or "200 down to 50" are illustrations, not benchmark results. There is also no data on how much the rules actually reduce errors and review corrections. There are substantive limitations too.
Test Frontier LLMs & Autonomous Agents in One Workspace
Run Claude Opus 5.5, GPT-6, Gemini 3.1, and DeepSeek side-by-side in Nomad AI (nomadnet.ai) — unified model routing, deep research, and multimodal workflows under one subscription.
The AI world, distilled — once a week
Seven stories that actually mattered, hand-picked. No noise, no reposts, no press releases.
Done! Check your inbox for a confirmation.