Topping GitHub's Trending, the Essential Guide for Claude Code Users

marsbitОпубликовано 2026-05-18Обновлено 2026-05-18

Введение

The CLAUDE.md file, trending on GitHub, is a project-level guide for Claude Code designed to dramatically improve its accuracy and efficiency. It addresses key issues like repetitive context explanations, unauthorized code changes, and forgotten decisions across sessions. By placing this plain-text file in a project root, Claude Code reads it automatically at the start of each session. The guide includes rules to eliminate redundant explanations, enforce strict behavioral constraints (e.g., no modifications outside the requested scope without confirmation), and establish a "memory" system using companion files like MEMORY.md and ERRORS.md to log past decisions and failures. It also locks in the project's specific tech stack to prevent inappropriate tool recommendations. Highlighted are four foundational rules from Andrej Karpathy that reportedly increased coding accuracy from 65% to 94%: always ask for clarity first, implement the simplest solution, never touch unrelated code, and explicitly flag uncertainties. The article quantifies significant weekly cost savings for developers and teams by eliminating wasted time on re-explaining context, rolling back unauthorized edits, and re-evaluating previously rejected solutions. The core message is that a small, upfront investment in creating a CLAUDE.md file leads to a more predictable, controlled, and cost-effective AI programming assistant.

Editor's Note: The biggest problem many people face when using Claude Code isn't that the model isn't powerful enough, but that they start from scratch every time.

You need to repeatedly tell it the project background, tech stack, code conventions, which parts must not be touched, and which approaches have already been tried. As long as this information isn't fixed, Claude will work by guessing, potentially modifying files it shouldn't, refactoring code you didn't ask it to, or even recommending tools unsuitable for the current project.

The CLAUDE.md introduced in this article is a user manual written for Claude Code. You just need to place it in your project's root directory, and Claude will automatically read it on each startup. It tells Claude in advance: how to answer, how to write code, when to ask questions first, which operations cannot be performed without permission, what tech stack the project uses, and what important decisions were made in the past.

In short, the purpose of CLAUDE.md is to: reduce repeated explanations, limit the model's overreach, and make AI programming more stable and controllable.

If you are using Claude Code, you can start with the 4 rules summarized by Karpathy: ask if unsure, do the simplest solution first, don't touch unrelated code, and clearly state uncertainty. Start by writing these rules into CLAUDE.md, then gradually add to it based on your project, and you'll see a clear improvement in your experience.

The original text follows:

A file named CLAUDE.md topped GitHub's Trending list.

82k stars, 7.8k forks.

This began with Andrej Karpathy. He is the former Head of AI at Tesla and a founding member of OpenAI. He summarized four behaviors that would cause Claude Code to fail and wrote them into a file.

Later, a developer expanded upon these four rules and publicly released this file. It quickly went viral.

The reason is straightforward: coding accuracy increased from 65% to 94%.

But most developers who use Claude Code daily have never actually set this up. They start from zero every session: re-explaining the same context, cleaning up unnecessary scope changes, rolling back unrequested refactors.

Here is the complete file.

The Setup Most Developers Miss

Every time you open Claude Code, it starts knowing nothing by default.

It doesn't know your tech stack, your coding conventions, your project background, what you've already tried, let alone decisions you explicitly ruled out three sessions ago.

So it can only guess. And once it starts guessing, it might refactor code you didn't ask to be touched, recommend frameworks that would break your existing architecture, delete files without confirmation, or even overturn decisions you've already made.

CLAUDE.md is a plain text file placed in the project's root directory. Claude Code will automatically read it at the start of every session.

Set it up once, avoid repeated explanations, and fix three types of costly errors.

Default Settings: You're Spending $375 a Week Just Repeating Yourself

The average developer spends about 30 minutes a day re-explaining context to Claude.

Tech stack, coding conventions, project background, methods already tried—unless you write this information down once and have Claude read it automatically each time, it won't persist across sessions.

At a developer's hourly rate of $150:

· 30 minutes a day is $75;

· $375 per week.

· For a 5-person team, that's $1,875 in hidden costs weekly.

The following 7 rules should be placed at the top of the CLAUDE.md file.

→ Skip the Fluff

Don't start answers with "Great question," "Sure," "No problem," or similar prefaces. Get straight to the answer. No pleasantries, no restating the question.

→ Match Answer Length to Task

Answer length should match task complexity. Simple questions get direct, short answers; complex tasks get complete, detailed explanations. Don't pad length by restating the question or adding repetitive concluding remarks.

→ Give Options Before Acting

Before starting any significant task, first present 2–3 viable paths. Wait for my selection before proceeding.

→ Admit Uncertainty Before It Costs

If you are uncertain about any fact, data, date, or technical information, explicitly say so before referencing it. Don't fill knowledge gaps with plausible-sounding information. When in doubt, simply say you're unsure.

→ Who I Am, What I Know

About Me: [Name] / Role: [Your Role] / Background: [Domain].

I'm Proficient At: [What you're familiar with].

I'm Still Learning: [Knowledge gaps].

Adjust the depth of each answer based on this information. Don't over-explain what I already know, and don't skip context I need.

→ Current Project Context

I'm Working On: [Project Name] / Goal: [Specific Outcome] / Audience: [Who will use it] / Tech Stack Context: [Relevant Constraints] / Avoid: [List].

Apply this context to every task. If a request conflicts with the context, point it out before executing.

→ Lock Down Your Writing Style

My Writing Style Is: [Describe your style].

Sentence Length: [Preference].

Words I Use Often: [Examples].

Words I Never Use: [Examples].

Format: [Prose or Structured].

When writing anything on my behalf, you must strictly match this style. Do not default to your own expressive patterns.

Daily time spent re-explaining context: 30 minutes

At $150/hour developer rate: $75 / day

Weekly: $375 per developer

5-person team: $1,875 per week

Time to set up this part of CLAUDE.md: 45 minutes total

Mistake to avoid: Don't write CLAUDE.md from scratch. Start with the prompt below, then edit the output:

Based on what I've told you about myself, my project, and how I want to work, please write a complete CLAUDE.md file for me. Include: who I am, my technical background, my communication preferences, and default behaviors to follow each session. Be specific, plain text, under 500 words.

Behavioral Constraints: Those Unauthorized $150/Hour Changes

You ask Claude to fix a function.

It ends up refactoring three files, renaming variables, reorganizing imports, and rewriting comments you spent time on.

All without your confirmation.

Reviewing and rolling back these unnecessary changes might take an hour, which is $150. Happening three times a week is $450. For a 5-person team, that's $2,250 per week spent cleaning up unauthorized changes.

The following 7 rules should go in the Behavioral Constraints section of CLAUDE.md.

→ Strict Scope Control

Only modify files, functions, and lines of code directly relevant to the current task. Do not refactor, rename, reorganize, reformat, or "optimize" anything I have not explicitly asked you to change.

If you see something else worth fixing, note it at the end. Do not touch it. Never.

→ Ask Before Major Changes

Before making significant changes to content I've already created—including rewriting sections, deleting paragraphs, restructuring, changing tone—you must pause, precisely state what you plan to change and why. Wait for my confirmation before proceeding.

→ Must Confirm Before Any Destructive Action

Before deleting any file, overwriting existing code, deleting database records, or removing dependencies, you must pause, list what will be specifically affected, and request my explicit confirmation. You may proceed only if I say "yes" in the current message.

"You mentioned earlier" does not equal confirmation.

→ Mandatory Pause for Production Operations

The following operations require explicit confirmation within the current session, without exception:

· Deploying or pushing to any environment;

· Running migrations or database schema changes;

· Sending any external API calls;

· Executing any command with irreversible side effects.

· I must explicitly say "yes" in the current message.

→ Always Show What Changed

After completing any coding task, the end must include:

Files Modified: List all touched files;

What Changed: One sentence per file;

Files Intentionally Not Modified;

Follow-Up Items.

→ Do Not Act on My Behalf Without Explicit Confirmation

Do not send, post, share, or schedule anything on my behalf without my explicit confirmation in the current message. This includes emails, calendar invites, document shares, or any action happening outside the current conversation. I must explicitly say "yes" in the current message.

→ Think Before Coding

For tasks involving architectural decisions, complex problem debugging, or non-trivial feature development, first reason through the problem step-by-step before writing code. Show your reasoning, point out uncertainties, and then execute.

Weekly rollback of unnecessary scope changes: $150

Weekly manual diff checks: $75

Behavior-related waste per developer: $225 / week

5-person team: $1,125 / week

Time to set up CLAUDE.md Behavior section: 30 minutes

Memory & Tech Stack: The Setup That Makes Claude Code Truly Reliable

Claude forgets everything between sessions.

Every decision you've made, every approach that failed, why you chose Prisma over Drizzle six months ago, and why a particular constraint comes from a specific client requirement—it forgets it all.

Then, it re-proposes options you've long since ruled out.

This section is the closest thing to providing Claude with "real memory" for the current context, while also locking down your tech stack to prevent it from recommending tools that would break your existing architecture.

→ MEMORY.md Decision Log

Maintain a file named MEMORY.md in the project. Whenever an important decision is made, add a new entry:

· What was decided;

· Why it was decided that way;

· What was ruled out, and why.

Read MEMORY.md at the start of each session. Do not conflict with recorded decisions without prompting.

→ Session End Summary

When I say "session end," "wrapping up," or "let's stop here," write a session summary to MEMORY.md, including:

· What was handled;

· What was completed;

· What is still in progress;

· What decisions were made;

· Priorities for the next session.

→ ERRORS.md Failure Log

Maintain a file named ERRORS.md. When an approach has been tried more than twice without success, record it:

· What didn't work;

· What finally worked;

· What to watch for next time.

Check ERRORS.md before proposing solutions for similar tasks.

→ Permanent Fact List

The following facts are always true for this project and must be applied to every session without exception:

[Your permanent constraints, architectural decisions, and rules]

If a task conflicts with these facts, point it out before executing.

→ Lock Down the Tech Stack

The project's tech stack is as follows. Always use these tools. Do not recommend alternatives unless I explicitly ask:

Language: [e.g., TypeScript]

Framework: [e.g., Next.js 14]

Package Manager: [e.g., pnpm]

Database: [e.g., PostgreSQL with Prisma]

Testing: [e.g., Vitest]

Styling: [e.g., Tailwind CSS]

If a tool seems unsuitable, you can point it out. But unless I explicitly state otherwise, you must use the defined tech stack.

→ Enable Extended Thinking for Difficult Decisions

For problems involving system architecture, performance trade-offs, database design, or long-term technical decisions, use the extended thinking mode.

Analyze the problem step-by-step, point out trade-offs I might not have considered, identify assumptions that might not hold at scale, and then give your recommendation.

→ The 4 Viral Rules

Karpathy summarized 4 behaviors that cause Claude Code to fail. A developer distilled them into these 4 lines of rules. Coding accuracy increased from 65% to 94% as a result.

Ask, don't assume.
If anything is unclear, ask before writing the first line of code. Do not make silent assumptions about intent, architecture, or requirements.

Do the simplest thing first.
Always implement the simplest solution that works first. Do not add abstraction layers or flexibility not explicitly requested.

Don't touch unrelated code.
If a file or function is not directly related to the current task, don't modify it. Even if you think it could be optimized, leave it alone.

Explicitly mark uncertainty.
If you are unsure about a solution or technical detail, state it before proceeding. Acting confident without certainty causes more damage than admitting a knowledge gap.

· Weekly recovery cost from forgotten decisions and bad advice: $300 per developer

· Wrong tech stack recommendations and incompatible tools: $75 per week

· Memory-related waste per developer: $375 / week

· 5-person team: $1,875 / week

· MEMORY.md + ERRORS.md + Tech Stack setup time: 20 minutes

Conclusion

The full cost breakdown is as follows:

· Weekly cost of re-explaining context: $375

· Weekly cost of rolling back unauthorized changes: $225

· Weekly cost of handling problems from forgotten decisions: $375

· Total waste per developer per week: $975.

For a 5-person dev team: $4,875 per week. $253,500 per year.

Setting up CLAUDE.md only takes 2 hours in total.

Karpathy's 4 rules alone increased coding accuracy from 65% to 94%.

A plain text file, 21 rules, two hours of work.

Developers who complete this setup are effectively using a more reliable Claude: one that remembers decisions, controls task scope, asks for confirmation before destructive actions, and doesn't recommend frameworks that would break the existing architecture.

Those who haven't set it up are still spending $975 a week repeating themselves.

P.S.: Start with Karpathy's 4 rules. Just these 4. Paste them into a new file named CLAUDE.md in your project's root directory right now. It takes 2 minutes. Then gradually supplement it each week based on the gaps you discover.

Bookmark this before it gets lost in your feed. And if you find it useful, share it with someone who genuinely needs it.

Связанные с этим вопросы

QWhat is CLAUDE.md and what problem does it solve for Claude Code users?

ACLAUDE.md is a plain text file placed in a project's root directory. It serves as an instruction manual for Claude Code, which automatically reads it at the start of each session. It solves the problem of developers having to repeatedly re-explain project context, tech stack, code standards, previous decisions, and constraints to Claude Code in every new session. This reduces repetitive explanations, prevents the AI from making incorrect assumptions or unauthorized changes, and makes AI-assisted programming more stable and controllable.

QAccording to the article, what are the four core rules from Andrej Karpathy that significantly improve Claude Code's accuracy?

AThe four core rules from Andrej Karpathy are: 1. Ask first, don't assume: If anything is unclear, ask before writing the first line of code. Do not make silent assumptions about intent, architecture, or requirements. 2. Do the simplest thing first: Always implement the simplest solution that works. Do not add abstraction layers or flexibility that weren't explicitly requested. 3. Don't touch unrelated code: If a file or function is not directly related to the current task, do not modify it. Even if you think it could be optimized, leave it alone. 4. Explicitly mark uncertainty: If you are unsure about a solution or technical detail, state it before proceeding. Acting confidently without certainty causes more harm than admitting a knowledge gap.

QWhat is the estimated weekly financial waste per developer mentioned in the article for not using CLAUDE.md?

AThe article estimates a weekly financial waste of $975 per developer for not using CLAUDE.md. This breaks down into three categories: $375 for repeating contextual explanations, $225 for rolling back unauthorized changes, and $375 for dealing with problems caused by forgotten decisions and wrong suggestions.

QWhat specific behaviors should be prevented according to the 'Behavioral Constraints' section of an ideal CLAUDE.md file?

AAccording to the 'Behavioral Constraints' section, an ideal CLAUDE.md file should enforce rules to prevent Claude Code from: 1. Making changes outside the direct scope of the task (e.g., unauthorized refactoring, renaming, reformatting). 2. Executing significant modifications (rewrites, deletions, structural changes) without prior confirmation. 3. Performing any destructive operations (deleting files, overwriting code, database changes) without explicit, in-session confirmation. 4. Taking production environment actions (deployments, migrations, external API calls) without mandatory pause and confirmation. 5. Failing to clearly list all changes made after a coding task. 6. Acting on the user's behalf (sending emails, sharing documents) without explicit confirmation. 7. Writing code for complex tasks without first showing reasoning and identifying uncertainties.

QWhat are the MEMORY.md and ERRORS.md files used for, as suggested in the article?

AThe article suggests using MEMORY.md and ERRORS.md files to provide Claude Code with a form of 'memory'. MEMORY.md is a decision log where important project decisions (what was decided, why, and what was excluded) are recorded. Claude should read this at the start of each session and avoid conflicting with logged decisions. It should also write a session summary to this file when a session ends. ERRORS.md is a failure log. When a solution attempt fails more than twice, it should be recorded (what didn't work, what finally worked, what to watch for next). Claude should check this file before proposing solutions for similar tasks.

Похожее

24/7 Unstoppable Derivatives Wave: Cryptocurrency Is Forcing Traditional Finance to 'Change Time Zones'

The article discusses how the 24/7 nature of the cryptocurrency market is compelling traditional finance to adapt its operating hours and infrastructure. The key catalyst is the CME Group's planned launch of nearly round-the-clock trading for regulated crypto derivatives, a move driven by strong institutional demand for continuous risk management. This shift highlights a fundamental change: derivatives, not spot trading, now dominate crypto market activity and price discovery. However, integrating continuous trading into traditional finance reveals structural tensions. While execution times can be extended, settlement, clearing, and regulatory reporting largely remain bound to traditional business-day cycles. This creates a lag where weekend price movements can impact risk exposures before traditional control systems are fully active. Furthermore, the article explores new challenges arising from this always-on environment. The inherent transparency of public blockchains, while ensuring auditable settlement, also exposes sensitive corporate information like treasury flows to competitors in real-time. This has elevated privacy from a feature to a core requirement for institutional adoption. The next phase hinges on building systems that balance this necessary privacy with regulatory accountability and compliance. In conclusion, the move towards 24/7 trading signifies more than crypto becoming institutionalized. It represents traditional finance beginning to adopt the temporal structure of crypto-native markets. The future will be defined by how successfully traditional risk, identity, privacy, and settlement frameworks can operate at the continuous speed cryptocurrency markets demand.

marsbit31 мин. назад

24/7 Unstoppable Derivatives Wave: Cryptocurrency Is Forcing Traditional Finance to 'Change Time Zones'

marsbit31 мин. назад

Unitree Passes the Hearing, Hangzhou Reaps the Rewards

Unitree Technology, a leading company in Hangzhou's tech scene known as one of the "Hangzhou Six Dragons," has officially passed the review for listing on the Shanghai Stock Exchange's STAR Market (科创板). It plans to raise 4.202 billion yuan for the research and development of intelligent robot models and robot hardware. This milestone will make Unitree the "first humanoid robotics stock." Founded in 2016 by Wang Xingxing, the company started humbly in a small office in Hangzhou's Binjiang district. Initially, the robotics sector was not viewed favorably by the market, with Unitree's products often labeled as "toys" and struggling to secure funding. At its most critical point, with only around 100,000 yuan left, Wang stopped his own salary to keep the company afloat. A crucial turning point came in 2018 when Hangzhou's state-owned capital system provided timely support. A financial platform under the city's state-owned assets completed due diligence in three days and granted a 20-million-yuan loan within a week. This "patient capital" infusion stabilized Unitree, enabling its transition from prototype development to mass production and commercial viability. Subsequently, Hangzhou Capital, through its two major 100-billion-yuan mother funds—the Hangzhou Science and Technology Innovation Fund and the Hangzhou Innovation Fund—participated in four of Unitree's financing rounds (B2, B3, C, and C+). This continuous backing helped the company grow, attract top-tier industrial investors like China Mobile, Tencent, Alibaba, and Geely, and solidify its position as a global leader in legged robotics. By 2025, Unitree achieved significant scale, with revenue reaching 16.99 billion yuan, net profit of 5.91 billion yuan, global leadership in humanoid robot shipments, and over 33,000 quadruped robots sold worldwide. Unitree's journey exemplifies Hangzhou's strategy of nurturing hard-tech startups from "seedlings" to industry leaders. Beyond Unitree, Hangzhou's capital ecosystem has supported other "Six Dragons" like Cloudwalk, BrainCo, and DeepSeek. The city has established a 500-billion-yuan "3+N" industrial fund cluster and specialized early-stage funds like the "Runmiao Fund" with a 20-year term to fill funding gaps for very early-stage projects. This robust "capital + talent" model, coupled with an influx of over 430,000 young professionals in 2025 alone, has fostered a vibrant innovation ecosystem. Hangzhou is now home to 48 unicorns and 413 potential unicorns, building comprehensive industrial chains in AI, robotics, brain-computer interfaces, and more. As Hangzhou experiences a wave of IPOs, it is solidifying its reputation as an ideal city for entrepreneurs.

marsbit56 мин. назад

Unitree Passes the Hearing, Hangzhou Reaps the Rewards

marsbit56 мин. назад

Are Rising U.S. Stocks Getting More Dangerous? Goldman Sachs: Downside Protection Mechanisms Have Almost Failed

The US stock market rally is showing signs of becoming increasingly precarious as key downside protection mechanisms fail, according to Goldman Sachs. Derivatives strategist Brian Garrett notes that the S&P 500 options volatility skew has plunged to an 18-month low, indicating the market now prices an 8% probability for both a 10% drop and a 10% rise—a sign of "skew failure." Concurrently, Goldman's Panic Index hit a two-year low, reflecting minimal demand for tail-risk hedging. This complacency emerges amid a relentless market surge, with the S&P 500 setting new records frequently in 2024. Garrett highlights three major concerns: extreme concentration in the top ten stocks (40% of index weight), heavy reliance on AI-themed performance, and a price pattern eerily similar to the 1998-1999 period. Despite pervasive media pessimism, this fear is absent in options pricing. Downside hedge costs are historically low. Goldman suggests tactical trades: buying RSP outperformance options versus the SPX for a broadening rally, purchasing VIX calls for protection, and going long on Bitcoin ETF volatility. Hedge funds have been net buyers for two weeks, with sector rotation into financials and out of industrials. Notably, the global single-stock leveraged/ inverse ETF AUM has doubled to over $60 billion in two months, underscoring growing speculative activity.

marsbit1 ч. назад

Are Rising U.S. Stocks Getting More Dangerous? Goldman Sachs: Downside Protection Mechanisms Have Almost Failed

marsbit1 ч. назад

Торговля

Спот
Фьючерсы

Популярные статьи

Как купить S

Добро пожаловать на HTX.com! Мы сделали приобретение Sonic (S) простым и удобным. Следуйте нашему пошаговому руководству и отправляйтесь в свое крипто-путешествие.Шаг 1: Создайте аккаунт на HTXИспользуйте свой адрес электронной почты или номер телефона, чтобы зарегистрироваться и бесплатно создать аккаунт на HTX. Пройдите удобную регистрацию и откройте для себя весь функционал.Создать аккаунтШаг 2: Перейдите в Купить криптовалюту и выберите свой способ оплатыКредитная/Дебетовая Карта: Используйте свою карту Visa или Mastercard для мгновенной покупки Sonic (S).Баланс: Используйте средства с баланса вашего аккаунта HTX для простой торговли.Третьи Лица: Мы добавили популярные способы оплаты, такие как Google Pay и Apple Pay, для повышения удобства.P2P: Торгуйте напрямую с другими пользователями на HTX.Внебиржевая Торговля (OTC): Мы предлагаем индивидуальные услуги и конкурентоспособные обменные курсы для трейдеров.Шаг 3: Хранение Sonic (S)После приобретения вами Sonic (S) храните их в своем аккаунте на HTX. В качестве альтернативы вы можете отправить их куда-либо с помощью перевода в блокчейне или использовать для торговли с другими криптовалютами.Шаг 4: Торговля Sonic (S)С легкостью торгуйте Sonic (S) на спотовом рынке HTX. Просто зайдите в свой аккаунт, выберите торговую пару, совершайте сделки и следите за ними в режиме реального времени. Мы предлагаем удобный интерфейс как для начинающих, так и для опытных трейдеров.

1.4k просмотров всегоОпубликовано 2025.01.15Обновлено 2026.06.01

Как купить S

Sonic: Обновления под руководством Андре Кронье – новая звезда Layer-1 на фоне спада рынка

Он решает проблемы масштабируемости, совместимости между блокчейнами и стимулов для разработчиков с помощью технологических инноваций.

2.3k просмотров всегоОпубликовано 2025.04.09Обновлено 2025.04.09

Sonic: Обновления под руководством Андре Кронье – новая звезда Layer-1 на фоне спада рынка

HTX Learn: Пройдите обучение по "Sonic" и разделите 1000 USDT

HTX Learn — ваш проводник в мир перспективных проектов, и мы запускаем специальное мероприятие "Учитесь и Зарабатывайте", посвящённое этим проектам. Наше новое направление .

1.8k просмотров всегоОпубликовано 2025.04.10Обновлено 2025.04.10

HTX Learn: Пройдите обучение по "Sonic" и разделите 1000 USDT

Обсуждения

Добро пожаловать в Сообщество HTX. Здесь вы сможете быть в курсе последних новостей о развитии платформы и получить доступ к профессиональной аналитической информации о рынке. Мнения пользователей о цене на S (S) представлены ниже.

活动图片