CLAUDE.md Files: A Practical Guide for Law Firms
The 200-line rule, the four-tier hierarchy, and three templates you can ship this week
A CLAUDE.md file is a plain markdown file Claude reads at the start of every session as persistent context. One file per folder, placed wherever the context applies — at the root of a matter, inside a practice-area directory, at the firm level on every machine. The convention began in Claude Code and now applies across Claude Cowork, Claude Code, and Projects [1][5]. For law firms, CLAUDE.md is how you turn 'what you'd tell a new associate on day one' into durable, machine-readable standing instructions that every Claude conversation inherits. This guide is the tactical companion to the overview in our Claude Cowork Cheat Sheet [/research/claude-cowork-cheat-sheet] — covering the four-tier placement hierarchy, Anthropic's 200-line rule, what goes where, three copy-pasteable templates, and the anti-patterns that make Claude stop listening.
The Short Version
- +What it is: A `CLAUDE.md` markdown file Claude reads at session start. Anthropic's official guidance: under 200 lines per file [1].
- +Where it goes: Four tiers — managed policy (firm-wide), project (practice area or matter), user (personal), local (gitignored, per-attorney).
- +How it composes: Claude walks up the directory tree, reads every CLAUDE.md it finds, concatenates them. More specific files append after broader ones.
- +What to put in: Identity, tone, conventions, domain facts the AI needs every time. Nothing ephemeral, nothing secret, nothing that belongs in a Skill.
- +The discipline the 200-line rule enforces: Legal writing and AI context share a virtue — say what matters, cut what doesn't. Bloated CLAUDE.md = ignored CLAUDE.md.
Part 1 — What CLAUDE.md Actually Is
CLAUDE.md is a plain markdown file with an exact, case-sensitive filename. When Claude Code or Claude Cowork starts a session in (or mounts) a folder, it walks up the directory tree from that folder and reads every CLAUDE.md file it encounters along the way. The files are concatenated into context — they compose, they don't override [1].
Part 2 — The 200-Line Rule
Anthropic's single clearest piece of guidance on CLAUDE.md is a size rule: target under 200 lines per file. Longer files consume more context and, more importantly, reduce adherence. This is the single most leverageable fact in the entire topic [1].
Part 3 — The Four-Tier Hierarchy, Mapped to a Law Firm
Anthropic's official placement hierarchy has four scopes. Each maps naturally to an organizational level within a firm — a useful translation because the physical directory structure on a managed laptop mirrors firm structure anyway.
How Files Load (and Why Concatenation Matters)
- +All CLAUDE.md files discovered in the walk up the tree are concatenated into context, not merged or deduplicated. They stack. That has two practical consequences for firms.
- +First: no inheritance shortcuts. A matter-level CLAUDE.md does not 'inherit' from a practice-level CLAUDE.md in the programming sense. Both files load, and if they say the same thing twice, Claude reads it twice.
- +Second: more specific = appended last. When Claude encounters a conflict between a firm-wide rule and a matter-specific rule, it generally follows the more specific one because it was read most recently. But this is convention, not enforced precedence — the Anthropic docs call it 'more specific files append after broader ones' [1].
- +Practical implication: Don't repeat firm-wide rules at the matter level. Write them once at the appropriate tier and let the hierarchy do its work.
What Goes in Each Tier
The decision of where to put a given instruction is the most common source of errors. A useful mental model: ask, 'Which attorneys does this apply to?' The answer tells you the tier.
| Confidentiality and ethics reminders | Managed policy (firm-wide) | Never include client names in filenames; every draft is presumptively privileged until reviewed |
| Firm-wide citation and tone standards | Managed policy (firm-wide) | Bluebook 22nd edition; no em-dashes in formal briefs; plain language for client communications |
| Practice-area conventions | Project (at practice-area directory) | Commercial litigation brief structure; standard motion formats; statute-of-limitations warnings |
| Matter-specific facts | Project (at matter root) | Parties, jurisdictions, key dates, opposing counsel, trial schedule, privileged/non-privileged scope |
| Personal tone preferences | User (~/.claude/CLAUDE.md) | I prefer active voice; I draft in numbered headings; I like short paragraphs |
| Private per-matter notes | Local (CLAUDE.local.md) | Draft outlines I'm still working through; research links I'm evaluating; personal reminders |
Template 1 — Firm-Wide CLAUDE.md
Deploy to /Library/Application Support/ClaudeCode/CLAUDE.md (macOS) or equivalent. Target: 40–80 lines.
A starting point for a firm's managed-policy CLAUDE.md. Cut what doesn't apply; keep it under the 200-line ceiling. The goal is to encode the universal rules that apply to every attorney, every matter, every Claude session at your firm.
Total: six sections, approximately 50 lines when rendered to markdown. Well under the 200-line ceiling, leaves room for firm-specific additions.
Template 2 — Practice-Area CLAUDE.md (Commercial Litigation Example)
Place at the root of your commercial-litigation folder. Target: 60–120 lines.
A practice-area CLAUDE.md specializes the firm-wide defaults for a specific kind of work. This example is commercial litigation; the same pattern works for transactional, employment, IP, or any other practice.
Omit the firm-identity and confidentiality sections — those live at the firm-wide tier and inherit automatically.
Template 3 — Matter CLAUDE.md (Litigation Matter Example)
Place at the root of the specific matter's folder. Target: 40–80 lines.
A matter CLAUDE.md carries the facts that change from matter to matter: who the parties are, what court, what the key dates are, what the client wants. Update it as the matter evolves.
A matter CLAUDE.md is a living document. Update parties, dates, and scope as the matter evolves. Review monthly; archive when the matter closes.
What NOT to Put in CLAUDE.md
- +Secrets of any kind. API keys, passwords, account numbers, bearer tokens. CLAUDE.md ends up in source control or a DMS that many people can read. Use a secrets manager, not a markdown file.
- +Client-identifying information at the firm-wide tier. Firm-wide CLAUDE.md is deployed to every attorney's laptop. Do not put specific client names or matter facts there — they belong in the per-matter CLAUDE.md.
- +Ephemeral notes that belong in the chat. 'Claude, for this one task, do X.' That's a prompt, not a standing instruction. Writing it into CLAUDE.md bloats the file and leaves stale guidance after the task ends.
- +Step-by-step procedures that only matter sometimes. Those belong in a Skill, not CLAUDE.md. A Skill loads on demand; CLAUDE.md loads every session. Putting a 50-line procedure in CLAUDE.md costs tokens 100% of the time for something that's relevant 5% of the time.
- +Duplicate rules from Folder Instructions. In Cowork, Folder Instructions and CLAUDE.md both persist context for the folder. Duplicating rules across both creates conflicts and wastes context. Pick one place, put the rule there, leave a pointer in the other.
When CLAUDE.md Isn't Enough — Imports and .claude/rules/
For firms with genuinely large rule sets, CLAUDE.md offers two escape hatches: imports and the `.claude/rules/` directory.
Should CLAUDE.md Go in the DMS?
- +Most firms will want matter-level CLAUDE.md committed alongside matter content — either in source control (for firms using git-backed matter storage) or in the DMS (for iManage/NetDocuments shops).
- +Why yes: Durability. A matter CLAUDE.md captures context that outlives any single attorney on the matter. If it lives only on one laptop, it disappears when the attorney moves.
- +What about privilege: A matter CLAUDE.md contains work product — strategy notes, privilege scope, defined terms. Treat it with the same retention, access, and privilege protection as any other matter work product. Store it inside the matter's DMS workspace with the same permissions as the rest of the folder.
- +What about CLAUDE.local.md: Do NOT push to the DMS. Add it to your DMS ignore list (or .gitignore equivalent). It's per-attorney personal context — that's the whole point of the `.local.md` convention.
- +What about firm-wide: Deploy via MDM / Group Policy / Ansible to the managed-policy location on every firm-managed device. Don't rely on attorneys to place it themselves.
CLAUDE.md Across Cowork, Claude Code, and Projects
CLAUDE.md started as a Claude Code convention and now works across the Claude product family. But each product layers its own instruction surface on top, and the interactions are worth understanding.
Anti-Patterns to Avoid
Patterns we see in the wild that consistently cause CLAUDE.md to stop working as intended.
The 1,500-line kitchen sink
A CLAUDE.md that tries to cover every edge case, every style preference, every context-specific rule. Claude starts dropping rules at around 300 lines. By 1,500 it's mostly decorative. Fix: aggressive cutting + move situation-specific rules to Skills or path-scoped rules.
Embedded secrets
API keys, credentials, or private URLs pasted into CLAUDE.md for convenience. This file will be checked into source control and DMSes that many people read. Fix: use environment variables, a secrets manager, or a CLAUDE.local.md with strict access. Rotate anything that was ever in CLAUDE.md.
Client names in firm-wide CLAUDE.md
A specific client mentioned in the managed-policy file. Now every attorney's laptop advertises that relationship. Fix: client-specific content lives in matter CLAUDE.md only.
Duplicate rules across tiers
The firm-wide citation rule also appears in every practice CLAUDE.md and every matter CLAUDE.md. This triples the token cost and risks drift between copies. Fix: write each rule at the broadest tier it applies to, and trust the hierarchy.
CLAUDE.md as a procedure manual
A 200-line 'how to draft a brief' walkthrough in CLAUDE.md. That's a Skill, not a standing instruction. Fix: move procedures into Skills that load on demand.
Conflicting rules between files
Firm-wide says 'always formal tone.' Matter says 'client prefers casual tone.' Claude picks one arbitrarily. Fix: explicit hierarchy statements. In matter CLAUDE.md: 'Override firm-wide formal-tone default; this client's preference is casual.'
When Claude Isn't Following CLAUDE.md
A systematic diagnostic sequence when your CLAUDE.md isn't producing the behavior you expect.
Is the file actually being loaded?
In Claude Code, run `/memory` to see the list of loaded CLAUDE.md and CLAUDE.local.md files. If yours isn't in the list, Claude can't see it. Check the path is correct and the file isn't excluded by a `claudeMdExcludes` setting [1].
Is the file too long?
Count lines. If over 200, adherence drops noticeably. If over 300, adherence is poor. Trim or split into imports / path-scoped rules. This is the single most common cause [1][6].
Is the instruction specific enough?
'Format code properly' is vague. 'Use 2-space indentation' is specific. Vague instructions produce vague adherence. Rewrite using concrete, verifiable language.
Is there a conflicting rule somewhere in the hierarchy?
Check every CLAUDE.md that Claude loads for a session. If two rules contradict, Claude picks one arbitrarily. Make one rule explicitly override the other, or remove one.
Did you assume Claude would infer something from the file?
CLAUDE.md is instructions, not documentation. 'We use Bluebook' doesn't mean 'format all citations in Bluebook 22nd.' Write the rule you want followed, explicitly.
Is this a rule or a procedure?
Rules are good in CLAUDE.md. Multi-step procedures belong in Skills. If your CLAUDE.md has numbered steps inside an instruction, that's a sign it should be a Skill instead.
The Bottom Line
- +CLAUDE.md is the most underrated lever in legal AI right now. Most firms haven't deployed a firm-wide one yet. The few that have notice adherence jump overnight — standing rules the managing partner would otherwise have to repeat for every attorney become baseline behavior across every Claude session.
- +The action plan for a firm starting today: (1) write a 50-line firm-wide CLAUDE.md, deploy it via MDM to the managed-policy location. (2) Have each practice group draft a 60–100-line practice CLAUDE.md, commit to shared storage. (3) Start dropping matter CLAUDE.md files into active matters as attorneys pick them up. (4) Review every CLAUDE.md quarterly and cut.
- +For the broader overview of how CLAUDE.md sits alongside Global Instructions, Folder Instructions, Projects, Skills, and Plugins, see our Claude Cowork Cheat Sheet: /research/claude-cowork-cheat-sheet.
Key Takeaways
- 1.CLAUDE.md is a plain markdown file Claude reads at the start of every session. The filename is case-sensitive. Convention applies across Claude Code, Cowork, and Projects.
- 2.Anthropic's official size guidance is under 200 lines per file. Adherence drops noticeably beyond that; ~300 lines is the pragmatic ceiling. Frontier LLMs reliably follow ~150–200 instructions.
- 3.Four placement tiers: managed policy (firm-wide via MDM), project (matter or practice folder), user (~/.claude), local (CLAUDE.local.md, gitignored).
- 4.Claude walks up the directory tree, concatenating every CLAUDE.md it finds. More specific files append last — they don't override, they stack.
- 5.Map the tiers to firm structure: firm → practice → matter → attorney. Write each rule at the broadest tier it applies to.
- 6.Put in CLAUDE.md: identity, tone, conventions, domain facts the AI needs every session. Do NOT put in: secrets, ephemeral notes, client names in firm-wide files, multi-step procedures (those belong in Skills).
- 7.For rule sets larger than 200 lines, use imports (@path syntax), the .claude/rules/ directory, or path-scoped rules with YAML frontmatter so instructions load only when relevant files are touched.
- 8.Matter CLAUDE.md files should go in the DMS alongside matter content — they are work product. CLAUDE.local.md should NOT go in the DMS; it's per-attorney personal context.
- 9.In Cowork, CLAUDE.md composes with Global Instructions (Settings UI) and Folder Instructions (per-folder UI). Precedence: Global → Folder → CLAUDE.md → Project memory.
- 10.The most common cause of 'Claude isn't following my CLAUDE.md' is file size. Count lines before debugging anything else.
References
- [1]Anthropic Claude Code Docs, "How Claude remembers your project."Link
- [2]Anthropic Claude Code Docs, "Best Practices for Claude Code."Link
- [3]Anthropic, "Using CLAUDE.MD files: Customizing Claude Code for your codebase."Link
- [4]Anthropic Claude Code Docs, "Explore the .claude directory."Link
- [5]Anthropic, "Get started with Claude Cowork," Claude Help Center.Link
- [6]HumanLayer Blog, "Writing a good CLAUDE.md."Link
- [7]Builder.io Blog, "How to Write a Good CLAUDE.md File."Link
- [8]TurboDocx, "How to Write a CLAUDE.md File That Actually Works."Link
- [9]Medium (Rentier Digital), "CLAUDE.md Best Practices: How to Structure Your Claude Code Config (2026)."Link
- [10]The AI Corner, "Claude Cowork Setup Guide: Context Files, Instructions, Plugins, Workflows (2026)."Link
- [11]GitHub (shanraisshan), "claude-code-best-practice."Link
- [12]Product Compass, "The Guide to Claude Code for PMs."Link