Reference
What Is CLAUDE.md?
Updated April 2026 · By Wayne Cederholm
CLAUDE.md is a schema file that controls how an AI interacts with your knowledge base. It defines the rules, structure, and format your AI follows when building and querying a wiki. Think of it as the instruction manual you hand to your AI before it starts working.
Why CLAUDE.md matters
Without a schema file, every AI interaction starts from zero. You explain your topic, your preferences, your format requirements, your rules — every single time. The AI has no memory of what you told it yesterday.
CLAUDE.md solves this by giving the AI a persistent reference document. When it reads your knowledge base, CLAUDE.md is the first file it processes. It learns your topic, your folder structure, your article format, your taxonomy, and your behavioral rules before doing anything else. The result is consistent, high-quality output every time without you repeating yourself.
A well-written CLAUDE.md is the difference between an AI that produces random, inconsistent wiki articles and one that builds a structured, interlinked knowledge base that gets better with every use. Our complete knowledge base guide explains the full system that CLAUDE.md powers.
The five sections every CLAUDE.md needs
1. Purpose. What this knowledge base is about, in one or two sentences. "A structured knowledge base on AI prompt engineering, compiled from curated sources and maintained by AI." This sets the scope. Without it, the AI might write articles about topics outside your domain.
2. Structure. Your folder layout and what each folder is for. The standard three-folder structure is: Sources (raw materials the AI reads but never modifies), Wiki (compiled articles the AI generates), and Queries (questions and answers filed back into the system). Clear structure prevents the AI from putting files in the wrong place.
3. Article Format. How each wiki page should be written. Title as H1, summary at the top, H2 sections in the body, a Sources section citing references, and a Related section with links to other articles. Consistent format means every article is readable, citeable, and interlinked.
4. Taxonomy. Your categories, tags, and naming conventions. Categories should be mutually exclusive (every article belongs to exactly one). Tags can overlap. Use a flat category structure until you have 50+ articles. Premature nesting creates empty folders and confused AI.
5. Rules. Behavioral constraints the AI must follow. "Never modify source files." "Always cite sources." "One concept per page." "Every new article must link to at least 2 existing articles." Write rules for the failure modes you actually care about. Every rule should exist because something went wrong without it.
Example CLAUDE.md
# AI Prompt Engineering Wiki # Version: 1.0 ## Purpose A structured knowledge base on AI prompt engineering, compiled from curated sources and maintained by AI. ## Structure - /Sources — Raw articles and notes (never edited by AI) - /Wiki — Compiled, interlinked wiki articles - /Queries — Questions asked and answers generated ## Article Format - Title as H1 - 2-3 sentence summary at top - Body with H2 sections - "Sources" section citing /Sources files - "Related" section with [[wikilinks]] ## Taxonomy Categories: Frameworks, Techniques, Patterns, Tools, Case Studies Tags: beginner, advanced, chain-of-thought, system-prompt, multi-turn ## Rules 1. Never modify files in /Sources 2. Always cite which source(s) informed each article 3. Use [[wikilinks]] to connect related concepts 4. One concept per page 5. Every claim must trace back to a source 6. New articles must link to at least 2 existing articles
How CLAUDE.md fits into the bigger system
CLAUDE.md is one piece of the LLM knowledge base system popularized by Andrej Karpathy. The full system works like this:
Collect: You drop raw sources (articles, notes, documents) into the Sources folder. The AI never touches your originals.
Compile: The AI reads CLAUDE.md to understand the rules, then reads the sources and generates structured wiki articles following your schema.
Query: You ask questions against your wiki. The AI reads the compiled articles (not raw sources) so answers are structured and consistent. Good answers get filed back into the wiki.
Compound: Every new source enriches the wiki. Every query generates new knowledge. The system gets smarter over time because CLAUDE.md ensures consistency at every step.
Where the name comes from
CLAUDE.md is named after Claude, the AI model built by Anthropic. In Claude Code (Anthropic's CLI tool), a file called CLAUDE.md in the root of a project serves as persistent instructions that Claude reads automatically at the start of every session. The concept has been adopted by the broader AI community for any schema file that gives an AI persistent context about a knowledge base, regardless of which AI model you use.
You can use a CLAUDE.md file with any AI that can read files: Claude, ChatGPT, Gemini, or local models. The format is plain Markdown. The AI reads it as instructions.
Frequently asked questions
Do I need to use Claude to use a CLAUDE.md file?
No. CLAUDE.md is a plain Markdown file that any AI model can read. The name comes from Claude Code, but the concept works with ChatGPT, Gemini, Perplexity, or any AI that can process text files. Just point the AI at the file and tell it to follow the instructions inside.
How long should a CLAUDE.md file be?
Most effective CLAUDE.md files are 30-80 lines. Long enough to cover purpose, structure, format, taxonomy, and rules. Short enough that the AI processes it quickly without using too much of its context window. If your CLAUDE.md is over 100 lines, you are probably over-specifying.
Can I use CLAUDE.md with Notion instead of Obsidian?
Yes. The schema concept works with any note-taking or knowledge management tool. In Notion, create a page called 'Schema' at the top of your database and paste the CLAUDE.md content there. The folder structure translates to Notion databases or page hierarchies. The AI reads it the same way.
What happens if I don't have a CLAUDE.md?
Without a CLAUDE.md, your AI has no persistent memory of your preferences, structure, or rules. You end up repeating instructions every session, getting inconsistent article formats, and manually catching errors the schema would have prevented. It works, but it does not compound. The wiki drifts instead of improving.
Get the full CLAUDE.md Masterclass
Deep dive into writing production-ready schemas, with templates you can copy. Or jump straight to the knowledge base build track and start building.
Read the Masterclass (free) →Subscribe to the MrPrompts Newsletter
Join 5,000+ builders. One practical AI framework every week: prompt templates, workflow blueprints, and knowledge base strategies you can use the same day. Free.