Open source, MIT licensed

CLAUDE.md That Works

One file. Zero dependencies. Discipline every AI coding session.

Install in 30 seconds (existing file backed up to CLAUDE.backup.md)
mkdir -Force "$HOME\.claude" > $null; cp "$HOME\.claude\CLAUDE.md" "$HOME\.claude\CLAUDE.backup.md" 2>$null; iwr "https://raw.githubusercontent.com/zeljkoavramovic/karpathy-bernstein-avramovic/master/CLAUDE.md" -OutFile "$HOME\.claude\CLAUDE.md"
WITHOUT ! ! WITH

Three perspectives, one framework

Karpathy - Think before coding- Simplicity first- Surgical changes- Goal-driven execution Bernstein - Collaborative framing- Refine before building- Respect for working code- Simplicity without dogma- Documentation philosophy Avramovic - Order of precedence- Operating modes- Must/Should/May semantics- Shared vocabulary / interpretation layer- Hard stops- Verification framework- Broken-baseline handling- Structured post-task reporting- Documentation rules CLAUDE.md Unified behavior framework for safer, smaller, verifiable AI coding changes
MIT License
Zero dependencies
Drop-in installation

Works with

Claude Code
OpenCode
Any instruction-file tool

What unchecked AI coding assistants do

1 Start coding before clarifying ambiguous requirements
2 Add unrequested features, abstractions, and "improvements"
3 Expand scope mid-task: refactor while fixing, "improve" while adding
4 Silently rename files, change APIs, or rewrite working code
5 Skip verification until after the mistake is already in the diff
6 Suppress errors without telling you
7 Push to version control or delete files without warning
8 Run destructive CLI commands or modify secrets with no safety gate
9 Ship incomplete or stub implementations and call them done
10 Pick arbitrarily when rules conflict, choosing helpfulness over safety

Four core principles

Think before coding

State assumptions, surface ambiguities, present multiple interpretations. No silent decisions.

Simplicity first

Minimum code that solves the problem. No speculative features, no unused abstractions.

Surgical changes

Touch only what you must. Match existing style. No scope creep hiding as cleanup.

Goal-driven execution

Define success criteria, loop until verified, report what changed and what remains unverified.

Beyond basic instructions

Core behavior
Three Named Operating Modes
Default, ambiguity, and cleanup modes give the AI an explicit behavioral model instead of leaving choices to chance.
Wording Conventions (Must / Should / May)
RFC-style rule weight removes ambiguity. Must and Never mean mandatory. Should and Prefer mean strong default. May means optional.
Shared Vocabulary / Interpretation Layer
Defined terms like "trivial task," "minor ambiguity," and "working code" mean you and the AI start from the same definitions.
Safety and execution control
Scope Control for Existing Code
Prevents touching adjacent code, expanding scope, rewriting working systems, or using cleanup as an excuse for unrelated changes.
Hard Stops with Rule Citation and Authorization Gate
When the AI cannot proceed, it names the specific rule that triggered the stop, creating a verifiable audit trail around dangerous actions.
Verification by Task Type with Manual Fallback
Bug fixes need reproduction. Features need interface checks. Refactors need before/after comparison. No automated tests? Define manual steps explicitly.
Broken Baseline Handling
If the baseline is already broken, the AI says so before changing code. No pretending everything is verified when it is not.
Reporting and maintenance
Structured Post-Task Report
After every non-trivial task: what changed, what was verified, what remains unverified, and problems noticed but left untouched.
Documentation Rules
Explain the why, not the what. Update docs when behavior changes. Avoid comments that merely repeat the code or rot faster than the implementation.
Deployment and reach
Full Multi-Dimensional Agnosticism
Works regardless of programming language, framework, AI tool, OS, domain, or project type. No dependencies referenced. Keep the global file universal.

What the rules prevent vs. what they produce

Without CLAUDE.md
// You: "Fix the login bug" AI rewrites the entire auth module AI adds rate limiting you didn't ask for AI renames variables across 12 files AI catches an error and suppresses it AI runs git push automatically // 47 files changed. Bug still present.
With CLAUDE.md
// You: "Fix the login bug" AI asks: "Is this the password or SSO flow?" AI fixes the single validation function AI reproduces the bug first, then makes it pass AI reports: 1 file changed, verified, no side effects // 1 file changed. Bug fixed. Verified.

Feature comparison

Feature Karpathy Bernstein This repo
Core coding rulesYesPartialRefined
Collaborative partnership framingNoYesRefined
Order of PrecedenceNoNoNew
Operating modesNoNoNew
Must/Should/May wording conventionsNoNoNew
Shared vocabulary / interpretation layerNoNoNew
Existing-code scope disciplinePartialPartialFormalized
Hard stops with rule citationNoNoNew
Hard-stop explanation protocolNoNoNew
Verification by task typeNoPartialFormalized
Verification fallback to manual stepsNoNoNew
Broken-baseline handlingNoNoNew
Structured post-task reportingNoNoNew
Dedicated documentation rulesNoPartialFormalized
Full multi-dimensional agnosticismPartialPartialMade explicit

Fully agnostic by design

Programming language
Python, C, JS, TypeScript, C#, Java, Pascal, Rust…
Framework
React, Django, Qt, bare-metal…
Library
No dependencies referenced
AI tool
Claude Code, OpenCode, and adaptable to other instruction-file tools
OS
Windows, Linux, macOS
Domain
Web, embedded, desktop, scripts, data
Project type
New projects, legacy code, refactors
Verification method
Automated tests, manual validation, reproducible checks, baseline comparison

FAQ

Yes. It works with any tool that reads instruction files: CLAUDE.md, AGENTS.md, GEMINI.md. Works natively with Claude Code and OpenCode. For other tools, follow that tool's convention. The content stays the same, only the filename changes.

No. Pure behavioral instructions in a Markdown file. Zero runtime impact. Zero dependencies. Zero configuration. It is a text file your AI tool reads before each session.

Override with explicit instruction. The framework respects your authority: explicit instruction always overrides defaults. You can also fork and modify the file to match your preferences.

No. It makes sessions faster by preventing rework. Every minute the AI spends asking before acting saves ten minutes undoing unwanted changes.

Structure matters. Operating modes, precedence rules, hard stops, and shared vocabulary create consistent behavior that ad-hoc prompts cannot. A prompt says "be careful." This file defines exactly what careful means, when to stop, and what to report.

Yes. Commit it to your repo as a project-level file. Everyone on the team gets the same guardrails and the same behavioral contract with their AI assistant. Consistency across developers, not just across sessions.

One file. 30 seconds. Every session better.

Install once. Benefit immediately. No configuration needed.

Andrej Karpathy (LLM coding observations) Multica (CLAUDE.md adaptation) David Scott Bernstein (partnership-driven style) Zeljko Avramovic (systematization and expansion)