Free Intensive Nov 21–22Free 2-day hands-on Vibecoding Intensive on Nov 21–22 at 16:00 MSK (Sat–Sun) · Live Cohort 3 starts Nov 23Join Free →Cohort 3 (Nov 23)
ReleaseInsight · On RadarX: @beamnxw→ original

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
Karpathy-Inspired Four Rules for a Coding Agent in One File Gather 232,000 GitHub Stars
Source: X: @beamnxw. Collage: Hamidun News.
Listen to article
Article Fact Sheet & Key Figures
ParameterDetails
Primary sourceX: @beamnxw ↗
Editor-in-Chief
Think before codingthe agent names trade-offs and asks questions
Simplicityin the post's example, 200 bloated lines shrink to 50
Key metric #3Surgical edits and a loop of "failing test → fix → green tests"

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.

Story

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.

ZK
Zhemal Khamidun — CPO at Alpina Digital, product manager of AlpinaGPT. Building AI products since 2019. Hamidun News is a pet project that grew into a production aggregator with 6,000+ readers.
✦ Unified AI Workspace · Nomad

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.

Try Nomad AI →Launch Nomad Agent
What do you think?
Loading comments…