Agent Ready Academy
Module 3: CLAUDE.md — Your Agent's Playbook

Why Your Repo Needs a CLAUDE.md

The problem CLAUDE.md solves and why it's the highest-leverage agent-ready investment

~10 min read

Overview

Learning Objectives

  • Understand the cold start problem that AI agents face in every session
  • Explain why existing documentation (README, CONTRIBUTING) does not solve the agent's needs
  • Recognize the effort-to-impact ratio that makes CLAUDE.md a high-leverage agent-readiness investment

Prerequisites

  • Completion of Module 2: Understanding AI Coding Agents

Every developer who joins a new team goes through onboarding. They learn the build commands, the test conventions, the deployment process, and the unwritten rules that live in people's heads. Without onboarding, even a senior engineer wastes hours guessing at things the team considers obvious.

AI coding agents face the exact same problem -- except they join your team fresh on every single session. There is no institutional memory between conversations. There is no Slack history to search. There is no teammate to ask.

CLAUDE.md is your agent's onboarding document. It is one of the most practical first steps you can take to make your codebase agent-ready, and this lesson explains why.

The Cold Start Problem

When an AI agent opens your repository for the first time, it faces what we call the cold start problem. The agent has general knowledge about programming languages, frameworks, and common patterns -- but it knows nothing about your project's specific choices.

Consider what the agent does not know:

  • Build commands -- Is it make build, pnpm build, cargo build, or bazel build //...?
  • Test commands -- Do you run pytest -x, go test ./..., or pnpm vitest run?
  • Code style -- Do you use tabs or spaces? Single quotes or double? Do you enforce a formatter?
  • Architecture decisions -- Why is there a pkg/ and a internal/ directory? What goes where?
  • Forbidden patterns -- Should the agent never use any in TypeScript? Should it avoid ORM magic methods?
  • Deployment context -- Is this a library, a CLI tool, a web app, or a Kubernetes operator?

Without answers to these questions, the agent must guess. And guessing leads to wasted iterations, broken builds, and code that violates your team's conventions.

Two paths when an agent opens a repository: Without CLAUDE.md, the agent enters a trial-and-error loop — guessing build commands, test commands, and conventions, generating code, failing builds, getting PRs rejected, and cycling back. With CLAUDE.md, the agent reads project context, uses correct commands, follows stated conventions, and produces results with reduced trial and error.

The flowchart above illustrates the difference starkly. Without CLAUDE.md, the agent enters a trial-and-error loop. With it, the agent often gets things right much sooner.

Why Existing Documentation Is Not Enough

You might wonder: "We already have a README, a CONTRIBUTING.md, and plenty of inline comments. Why add another file?"

The answer is audience and purpose. Each documentation file serves a different reader:

Comparison of documentation audiences: Human-oriented docs include README.md (what the project does, how to use it), CONTRIBUTING.md (how to submit PRs, code of conduct), and Architecture.md (design rationale, trade-offs). Agent-oriented docs include CLAUDE.md (exact build/test commands, code style rules, do's and don'ts, file structure hints).

README.md is written for humans who want to use or understand the project. It contains narrative explanations, badges, screenshots, and getting-started guides. Much of this is noise for an AI agent that needs to modify the code.

CONTRIBUTING.md covers social processes -- how to file issues, how to format commit messages, how the review process works. Agents do not file issues or participate in reviews.

CLAUDE.md is purpose-built for an AI agent that is about to write, test, and debug code in your repository. It answers the questions the agent actually has:

  • "What exact command do I run to verify my changes?"
  • "What patterns should I follow when adding a new endpoint?"
  • "What should I never do in this codebase?"

Key insight: CLAUDE.md is not documentation about your project. It is instructions for working in your project. Think of it as a checklist, not a narrative.

The Cost of Not Having One

Without a CLAUDE.md, each agent session typically encounters one or more of these common friction points:

  • Build failures -- The agent runs the wrong build command or misses a prerequisite step. You spend a turn correcting it.
  • Style violations -- The agent writes valid code that violates your conventions. You either accept the inconsistency or spend time asking for revisions.
  • Wrong test patterns -- The agent writes tests using a different framework or runner than what your project uses.
  • Architecture violations -- The agent puts new code in the wrong directory or creates files that do not follow your naming conventions.
  • Repeated mistakes -- Without persistent memory or project documentation, the same mistakes recur across sessions.

Each of these costs 1-3 extra turns of conversation. Across a team running many agent sessions per week, that adds up to significant wasted time and compute.

Why CLAUDE.md Has a Strong Effort-to-Impact Ratio

Of all the things you can do to make a codebase agent-ready -- writing tests, adding types, improving module boundaries -- CLAUDE.md stands out because of its effort-to-impact ratio.

ImprovementEffortImpactTime to Value
Add comprehensive testsHigh (days to weeks)HighWeeks
Add type annotationsMedium (hours to days)MediumDays
Refactor module boundariesHigh (days)MediumDays
Write CLAUDE.mdLow (30-60 minutes)HighImmediate

Writing a CLAUDE.md takes less than an hour. The impact is immediate -- the very next agent session benefits from it. And the effect compounds: every team member who uses an agent, every agent session on every branch, every automated workflow that invokes an agent -- they all read the same CLAUDE.md and get the same context.

Think of it this way: CLAUDE.md is the one file where 30 minutes of your time saves time in every future agent session. Few other investments in your repository have that multiplier.

An important distinction: CLAUDE.md is guidance that Claude reads and tries to follow -- it is context, not enforced configuration. For actions that must be blocked regardless of what the agent decides, use hooks, tool permissions in agent frontmatter, or managed settings. You will learn about these enforcement mechanisms in later modules.

What Makes CLAUDE.md Different from Prompting

You might also wonder: "Can't I just tell the agent what to do in my prompt each time?"

You can, and for one-off tasks that works fine. But CLAUDE.md scales in ways that per-session prompting does not:

  • Consistency -- Every agent session gets the same instructions, whether you start it or your teammate does.
  • Version control -- Your CLAUDE.md evolves with your codebase. When you change from Jest to Vitest, you update one file and every future session knows.
  • No forgetting -- You do not have to remember to include your project conventions in every prompt. The agent reads CLAUDE.md automatically.
  • Composability -- You can have nested CLAUDE.md files for different parts of a monorepo, each scoped to its subdirectory.
  • Review and collaboration -- Your team can review changes to CLAUDE.md in pull requests, just like any other code.

When to Create One

The short answer: now. If your repository does not have a CLAUDE.md and you plan to use AI coding agents, creating one is one of the highest-return investments of your next 30 minutes.

You do not need to write a perfect CLAUDE.md on the first pass. Start with the essentials:

  1. Build command -- How to compile or bundle the project
  2. Test command -- How to run the test suite
  3. Lint command -- How to check code style
  4. One key convention -- The most important rule an agent should follow

You can expand it over time as you notice the agent making mistakes. Each mistake is a signal that your CLAUDE.md is missing a piece of context.

Tip: After every agent session where you had to correct the agent, ask yourself: "Could I have prevented this correction by adding a line to CLAUDE.md?" If yes, add it.

Summary

  • AI agents face a cold start problem -- they know nothing about your project's specific conventions, commands, or architecture
  • Existing documentation (README, CONTRIBUTING) serves a different audience and purpose than what agents need
  • CLAUDE.md is purpose-built for AI agents: it provides the exact commands, rules, and patterns they need to work effectively in your codebase
  • It has a strong effort-to-impact ratio: 30 minutes of writing saves time in every future session
  • Unlike per-session prompting, CLAUDE.md is version-controlled, consistent, and composable
  • Start small with build, test, and lint commands -- then expand as you discover gaps

Check Your Understanding

Question 1 of 3

What is the primary problem CLAUDE.md solves?