What you will be able to do
- Decide what belongs in implementation guidance and what to leave out
- Place guidance at the right scope, from organization to subdirectory
- Keep guidance accurate as the code, the team and the models change
1.What implementation guidance should contain
When Claude Code helps build a solution, the implementation guidance has two readers: the engineering team and Claude itself. In Claude Code, that guidance lives in CLAUDE.md, a plain markdown file that Claude reads automatically at the start of every session in its directory. This lesson covers that one mechanism. Guidance written for human engineering teams in other forms is a separate concern. The support documentation calls CLAUDE.md the briefing you would give a capable new teammate on their first morning: how the team works, what to avoid, and where the important pieces are.
The support article's content guidance is specific. Include commands for building, testing, linting and running locally, because Claude will run them and they have to be accurate. Include conventions, hard constraints such as "do not edit generated/", and the known gotchas that every new engineer runs into. The architecture itself should be described in three sentences: what the major pieces are and how they communicate. Leave out full API documentation, changelogs, anything obvious from the file tree, and aspirational rules the team doesn't actually follow. The table below is a separate list, taken from the Claude Code best-practices page, and the two lists overlap but are not identical.
| Include | Exclude |
|---|---|
| Bash commands Claude can't guess | Anything Claude can figure out by reading code |
| Architectural decisions specific to your project | File-by-file descriptions of the codebase |
| Testing instructions and preferred test runners | Detailed API documentation (link to docs instead) |
| Common gotchas or non-obvious behaviors | Self-evident practices like "write clean code" |
Each instruction should be specific enough to check. "Run npm test before committing" works; "Test your changes" doesn't. Group related instructions under markdown headers and bullets, because organized sections are easier to follow than dense paragraphs. Keep each file under about 200 lines. Longer files use more context and reduce adherence, and importing other files doesn't help, since imported files also load at launch.
# Code style
- Use ES modules (import/export) syntax, not CommonJS (require)
- Destructure imports when possible (eg. import { foo } from 'bar')
# Workflow
- Be sure to typecheck when you're done making a series of code changes
- Prefer running single tests, and not the whole test suite, for performanceCheckpoint 1 of 6· Check yourself
You're drafting the CLAUDE.md that hands a new AI solution over to engineering. Which item belongs in it?
Project-specific architectural decisions are on the best-practices page's include list. That page's exclude list names file-by-file descriptions and detailed API docs, and the support article separately says aspirational rules are not worth including.
“Architectural decisions specific to your project”Source: code.claude.com
2.Putting guidance at the right scope
Guidance works better when each piece sits at the level where it applies. Claude merges instructions from several locations, from broadest to most specific. Most teams only need the project-root file, committed to git so that the whole team benefits.
| Scope | Location | Use for | Shared with |
|---|---|---|---|
| Managed policy | macOS: /Library/Application Support/ClaudeCode/CLAUDE.md; Linux and WSL: /etc/claude-code/CLAUDE.md; Windows: C:\Program Files\ClaudeCode\CLAUDE.md | Company coding standards, security policies, compliance requirements | All users in organization |
| User instructions | ~/.claude/CLAUDE.md | Personal preferences for all projects | Just you (all projects) |
| Project instructions | ./CLAUDE.md or ./.claude/CLAUDE.md | Project architecture, coding standards, common workflows | Team members via source control |
| Local instructions | ./CLAUDE.local.md | Sandbox URLs, preferred test data | Just you (current project) |
In larger systems, divide the guidance the way the architecture is divided. The root CLAUDE.md holds instructions that apply everywhere, such as coding standards and commit conventions. A per-subdirectory CLAUDE.md holds conventions for that area's stack: one per package in a monorepo, or one per subsystem such as src/db/ or src/api/ in a large single tree. With this layout, directory owners maintain their own conventions, and the instructions are versioned alongside the code they describe. The alternative is a path-scoped rule in the central .claude/rules/ directory, which loads when Claude works with a file matching the rule's paths: glob. Choose it when you want all conventions in one place, or when the same rule applies to many scattered paths.
Run package scripts from the package directory, not the monorepo root.
Prefix commit subjects with the package name, for example `api: add rate limiting`.
Never edit files under packages/*/generated/. Run `npm run codegen` in the package instead.Checkpoint 2 of 6· Match them up
Match each piece of guidance to the scope where it belongs
Tap a term, then the definition that fits it.
Each scope reaches a different audience: the whole organization, the team through source control, one person in one project, or one area of the codebase.
“Most teams only need the project-root file. Commit it to git so the whole team benefits.”Source: support.claude.com
Checkpoint 3 of 6· Exam question
An implementation guide must describe how to let Claude Code browse a company's Confluence and Jira instances using an existing open-source connector, launched locally by the agent process rather than hosted as a network service. Which pattern should the guide document?
Correct answer: A — Deploy an MCP server that exposes Confluence and Jira operations as tools, and configure the agent to launch it locally over stdio.
- A. Correct. MCP servers can be launched locally over the stdio transport, letting the agent connect to the existing Confluence and Jira server without exposing a network endpoint, exactly matching the requirement.
- B. Incorrect. Reimplementing the integrations as client-side tools discards the existing MCP server and duplicates work the connector already does.
- C. Incorrect. Extended thinking blocks are for reasoning transparency, not for routing external API calls; the Messages API has no mechanism to invoke REST endpoints through them.
- D. Incorrect. The Files API manages uploaded documents for reference, not live, interactive access to ticket and page data through tool calls.
3.Keeping guidance accurate over time
Implementation guidance goes out of date as the code changes, and stale guidance does active harm. The support article says outdated instructions are worse than none. Upkeep starts with the first draft. Run /init and Claude explores the codebase and drafts a CLAUDE.md covering build commands, test commands, a structure overview and the conventions it detects. You then review the draft, remove anything inaccurate, and commit it.
After the first draft, update the file when something specific happens. If Claude gets something wrong twice, a rule is missing, so add one line. When conventions change, for example a new framework, test runner or set of lint rules, update the file to match. Do a quarterly skim to delete stale content. Watch for contradictions as well: when two instructions conflict, Claude may pick one arbitrarily, so periodically review the root file, nested files and .claude/rules/ together.
Checkpoint 4 of 6· Check yourself
Claude has made the same mistake about your test setup in two separate sessions. What does the support article say to do?
Getting something wrong twice is the signal that a rule is missing, and the fix is a single added line rather than a rewrite or a wait.
“When Claude gets something wrong twice — that is the signal a rule is missing.”Source: support.claude.com
The large-codebase guide adds team-level habits. Review CLAUDE.md edits in pull requests like any other documentation change, so the conventions keep pace with the code. Revisit the file after major model releases, because a rule written to work around an older model's limitation can become overhead once a newer model handles the case on its own. A Stop hook can also review the session transcript and propose CLAUDE.md updates while the gap it found is still fresh.
Checkpoint 5 of 6· Check yourself
Your guidance includes a rule forcing single-file refactors, added because an older model struggled with larger ones. A new model release handles the case well. What should you do?
Workarounds for an older model's limitation turn into overhead once a newer model handles the case. The guide uses this exact rule as an example of one to delete.
“a rule that forces single-file refactors can be deleted once the limitation is gone”Source: code.claude.com
Checkpoint 6 of 6· Exam question
A support-tooling architect is writing implementation guidance for a high-volume ticket triage service that classifies incoming tickets, needs strong reasoning, and must stay within a tight latency and cost budget. Which model recommendation should the guidance document?
Correct answer: A — Recommend Claude Haiku 4.5, noting its near-frontier reasoning at the most economical price point suits high-volume, latency-sensitive classification.
- A. Correct. Claude Haiku 4.5 is described as delivering near-frontier performance with strong reasoning at the most economical price point, which directly fits high-volume, cost-sensitive, latency-sensitive classification.
- B. Incorrect. Opus 4.8 is positioned for complex agentic coding and enterprise engineering work, not lightweight high-volume classification, and its cost profile does not fit a tight budget.
- C. Incorrect. Raising the effort parameter trades latency and cost for additional intelligence; it increases response time rather than cutting it, so it does not serve a latency-sensitive requirement.
- D. Incorrect. Fast mode is a research preview at premium pricing, not a generally available, cost-reducing feature, so it does not fit a tight cost budget.
Exam traps
Each one states something that sounds right. Open it to see what is actually true.
1.Splitting a long CLAUDE.md into imported files reduces how much context it uses.Why is that wrong?
Imports make a long file easier to organize, but imported files also load at launch. To load part of the guidance only when it's needed, move it into path-scoped rules or subdirectory files.
Covered in What implementation guidance should contain
2.Every CLAUDE.md in the repository is read at session start, so subdirectory guidance is always in context.Why is that wrong?
Subdirectory CLAUDE.md files load on demand, when Claude reads files in that directory, not at session start.
Covered in Putting guidance at the right scope
3.Outdated guidance is harmless, so stale rules can stay until someone gets around to cleaning up.Why is that wrong?
Stale instructions actively mislead, and the vendor says they are worse than having none. Delete them during regular reviews.
Covered in Keeping guidance accurate over time
Sources
Every claim above is drawn from one of these pages, quoted as it was written on the date shown.
- 1.https://support.claude.com/en/articles/14553240-give-claude-context-claude-md-and-better-promptsOfficial docs
“Think of it as the briefing you would give a capable new teammate on their first morning”
↩︎ What implementation guidance should contain“Architecture in three sentences — what the major pieces are and how they communicate.”
↩︎ What implementation guidance should contain“When Claude gets something wrong twice — that is the signal a rule is missing.”
↩︎ Keeping guidance accurate over time“loaded on demand when Claude reads files in that directory, not at session start”
↩︎ Exam trap 2“delete anything stale, since outdated instructions are worse than none.”
↩︎ Exam trap 3“Most teams only need the project-root file. Commit it to git so the whole team benefits.”
↩︎ Checkpoint - 2.https://code.claude.com/docs/en/memoryOfficial docs
“Size: target under 200 lines per CLAUDE.md file. Longer files consume more context and reduce adherence.”
↩︎ What implementation guidance should contain“Team-shared instructions for the project”
↩︎ Putting guidance at the right scope“if two instructions contradict each other, Claude may pick one arbitrarily.”
↩︎ Keeping guidance accurate over time“Imports help you organize a long file but don’t reduce its context cost”
↩︎ Exam trap 1 - 3.https://code.claude.com/docs/en/large-codebasesOfficial docs
“Directory owners maintain their own conventions; instructions are versioned with the code”
↩︎ Putting guidance at the right scope“You want all conventions in one place, or the same rule applies to many scattered paths”
↩︎ Putting guidance at the right scope“treat CLAUDE.md edits like any other documentation change so conventions track the code”
↩︎ Keeping guidance accurate over time“Root only; subdirectory files load on demand when Claude reads there”
↩︎ Prediction“a rule that forces single-file refactors can be deleted once the limitation is gone”
↩︎ Checkpoint
Also cited
- https://code.claude.com/docs/en/best-practicesOfficial docs
“Architectural decisions specific to your project”
↩︎ Checkpoint