CLAUDE.md / .cursorrules in repo
How to write an agent instruction file that teaches AI tools about your project's conventions, patterns, and constraints - the single highest-leverage action at L2.
- ·At least one agentic IDE (Cursor, Windsurf, or Claude Code) is used by 50%+ of the team
- ·CLAUDE.md, .cursorrules, or equivalent agent instruction file exists in 100% of active repositories
- ·Agents operate in agentic/YOLO mode (multi-step edits without per-step approval)
- ·Developers use two or more AI tools in parallel (e.g., Copilot + Claude Code)
- ·Agent instruction files are reviewed and updated at least quarterly
Evidence
- ·Agent instruction files committed in repository root
- ·IDE telemetry or license dashboard showing agentic mode usage
- ·PR descriptions referencing agent-assisted development
What It Is
CLAUDE.md (for Claude Code), .cursorrules (for Cursor), and .github/copilot-instructions.md (for GitHub Copilot) are instruction files committed to your repository root that tell AI tools about your project. When an AI agent reads your codebase, it reads these files first and uses their contents to filter and shape every subsequent suggestion, edit, and decision.
These files are the simplest, highest-leverage form of context engineering. A well-written CLAUDE.md transforms an AI agent from a generic code generator into something that knows your project: your tech stack, your naming conventions, your architectural decisions, your forbidden anti-patterns, and your preferred libraries. The same model that was suggesting Redux patterns in your Zustand project will now correctly use Zustand - because you told it to.
The concept has spread rapidly. As of 2025, over 60,000 repositories on GitHub contain a .cursorrules file, and the practice of committing agent instruction files is becoming a standard part of repository setup alongside .gitignore and README.md. This is not a tool-specific feature - it's an emerging best practice for AI-assisted development.
At L2 (Guided), a single root-level CLAUDE.md is the starting point. At L3 (Systematic), teams evolve to per-team and per-directory files with more precision. But the root-level file is where every team begins, and even a 100-line version produces immediately visible improvement in AI output quality.
Why It Matters
The instruction file is the bridge between L1's context blindness and L3's systematic context engineering:
- Immediate improvement in suggestion quality - the AI stops recommending patterns you've banned and starts following your conventions
- Team-wide benefit from individual effort - one developer writes the file; every developer's AI quality improves when it's committed
- Captures tribal knowledge - conventions that exist only in senior developers' heads become queryable, enforceable context for the entire team
- Reduces review friction - when the AI follows your conventions, reviewers spend less time correcting style issues and more time reviewing logic
- Low cost, high return - a half-day investment to write a CLAUDE.md typically improves AI output quality enough to save multiple hours per week per developer
Without an instruction file, AI agents are at their worst in established codebases - the more decisions your team has made about patterns and conventions, the more opportunities there are for the AI to violate them. The instruction file directly addresses this inverse relationship.
Start by listing the three most common corrections you make to AI-generated code. Each of those corrections represents a convention the AI doesn't know about. Write those three rules first. A three-rule CLAUDE.md is dramatically better than none.
Getting Started
6 steps to get from here to the next level
Common Pitfalls
Mistakes teams actually make at this stage - and how to avoid them
How Different Roles See It
Bob's team has been using AI tools for months with inconsistent results. Some developers love it; others think it's a distraction. Bob suspects the inconsistency is related to how different developers interact with the AI, but he can't pinpoint why.
What Bob should do - role-specific action plan
Sarah needs to show that the AI tooling investment is delivering value. Her previous L1 metrics (acceptance rate, developer sentiment) weren't convincing stakeholders. She needs a more concrete story.
What Sarah should do - role-specific action plan
Victor already has a personal .cursorrules file he maintains locally. It's comprehensive, specific, and explains exactly why certain patterns are used in the codebase. His AI-assisted code is consistently better than what the team gets without it - but because it's local, nobody else benefits.
What Victor should do - role-specific action plan
Further Reading
5 resources worth reading - hand-picked, not scraped
From the Field
Recent releases, projects, and discussions relevant to this maturity level.