Amicore

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

Last updated: April 24, 2026 Guide

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].

It's context, not configuration: Anthropic is explicit: 'CLAUDE.md content is delivered as a user message after the system prompt, not as part of the system prompt itself. Claude reads it and tries to follow it, but there's no guarantee of strict compliance.' Treat CLAUDE.md as strong guidance, not enforced policy [1].
Loading is automatic and recursive: From the working directory, Claude walks up to the filesystem root, picking up each ancestor's CLAUDE.md. Subdirectory CLAUDE.md files load on demand when Claude touches files in that subdirectory — not at launch.
CLAUDE.local.md is for private personal context: A sibling file `CLAUDE.local.md` loads alongside `CLAUDE.md` at each level, appended after it (so personal notes override shared ones on conflict). Add it to `.gitignore` so it stays off source control [1].
HTML comments are stripped: `<!-- maintainer notes -->` blocks are removed before CLAUDE.md is injected into Claude's context. Use them for human-only notes without spending context tokens [1].
Survives /compact in Claude Code: Project-root CLAUDE.md is re-injected after a `/compact`. Conversation-only instructions are lost on compaction; CLAUDE.md instructions are not. If you want something to survive compaction, write it into CLAUDE.md [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].

Why 200 lines: Research suggests frontier thinking LLMs can reliably follow approximately 150–200 instructions before signal is lost. Beyond that, the model starts picking arbitrarily between competing rules and selectively ignoring parts of the file [1][6].
The diagnostic test: If Claude keeps doing something you don't want despite having a rule against it, your CLAUDE.md is probably too long and the rule is being dropped. Trim the file, watch adherence return.
The cutting rule: For each line, ask: 'Would removing this cause Claude to make mistakes?' If not, cut it. If yes but the instruction is situation-specific, move it to a Skill or path-scoped rule instead [2][6].
Some teams aim lower: Practitioner reports suggest 60 lines is achievable for focused projects; the pragmatic ceiling before signal loss is around 300 lines. If your file is trending toward that ceiling, split it into imports or `.claude/rules/` files instead [6][9].
The legal analog: A CLAUDE.md that tries to say everything ends up saying nothing well — the same pathology as a memo that rehashes every argument instead of picking the winning three. The 200-line ceiling is the digital version of a well-edited brief.

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.

Managed policy → the firm: Location: `/Library/Application Support/ClaudeCode/CLAUDE.md` (macOS), `/etc/claude-code/CLAUDE.md` (Linux/WSL), `C:\Program Files\ClaudeCode\CLAUDE.md` (Windows). Deployed by IT via MDM, Group Policy, or Ansible. Applies to every user on every managed machine. Cannot be excluded by individual settings. Use for: firm-wide confidentiality rules, citation conventions, prohibited content categories, mandatory disclaimers [1].
Project → the matter or practice: Location: `./CLAUDE.md` or `./.claude/CLAUDE.md` at the root of the matter folder or practice-area directory. Checked into source control (or committed alongside matter content in the DMS). Shared with the team. Use for: practice-specific drafting conventions, matter-specific parties and dates, working standards for the current project [1].
User → the individual attorney: Location: `~/.claude/CLAUDE.md`. Personal to the attorney, applies across every project on their machine. Use for: personal tone preferences, favorite phrasing, citation style quirks that aren't firm-standard [1].
Local → the private note: Location: `./CLAUDE.local.md` at the project root. Gitignored by default. Use for: per-matter personal context an attorney doesn't want to share — sandbox URLs, personal research notes, private reminders [1].

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 remindersManaged policy (firm-wide)Never include client names in filenames; every draft is presumptively privileged until reviewed
Firm-wide citation and tone standardsManaged policy (firm-wide)Bluebook 22nd edition; no em-dashes in formal briefs; plain language for client communications
Practice-area conventionsProject (at practice-area directory)Commercial litigation brief structure; standard motion formats; statute-of-limitations warnings
Matter-specific factsProject (at matter root)Parties, jurisdictions, key dates, opposing counsel, trial schedule, privileged/non-privileged scope
Personal tone preferencesUser (~/.claude/CLAUDE.md)I prefer active voice; I draft in numbered headings; I like short paragraphs
Private per-matter notesLocal (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.

# Firm Identity: You are assisting an attorney at [Firm Name]. Default tone: precise, formal, and client-appropriate. Never fabricate case citations, statutory references, or regulations. When uncertain about a legal authority, say so and recommend a verification step rather than inventing.
# Confidentiality and Privilege: Treat every document and conversation as presumptively confidential and potentially privileged until an attorney indicates otherwise. Never include full client names in filenames you create. If asked to summarize a matter, do not include opposing party names unless explicitly instructed. If output may be shared externally, flag it for attorney review.
# Citation Standards: Default to Bluebook 22nd edition for all legal writing unless the matter CLAUDE.md says otherwise. For case names in running text, use full party names on first reference, short form thereafter. Never generate citations without a verifiable source.
# Prohibited Content: Do not generate: legal advice for non-client users, opinions on matters outside the current engagement, content that asserts facts outside the provided materials. If a user asks for something outside the firm's practice areas, say so and decline.
# Output Conventions: Draft memos with Facts / Issue / Analysis / Conclusion structure unless instructed otherwise. Use numbered headings for long documents. Write in plain English for client-facing output; legalese is acceptable only where precision requires it.
# Working with Documents: Before summarizing a document, confirm you have the full text (not an excerpt). If producing a new draft, note which sources you relied on. If asked to rewrite, preserve defined terms exactly as used in the original.

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.

# Practice Context: This folder contains commercial litigation matters. Work spans complaint drafting, motion practice, discovery, depositions, and trial preparation. Claude should expect to encounter pleadings, deposition transcripts, discovery responses, exhibits, and legal research memos.
# Working Conventions: All pleadings follow federal court formatting unless a matter CLAUDE.md specifies state court. Use numbered paragraphs for all court filings. Include a caption block at the top of every new pleading. Reference exhibits as 'Ex. [Letter]' not 'Exhibit [Letter].' For briefs, standard length is 15–25 pages; if the matter has a court-imposed page limit, respect it.
# Drafting Standards: Arguments should lead with the strongest ground first. Cite controlling authority from the forum's jurisdiction before persuasive authority from other jurisdictions. Never cite overruled or abrogated cases without explicit acknowledgment. When drafting deposition summaries, include page:line cites for every factual assertion.
# Discovery Conventions: When responding to requests for production, use 'Without waiving objections' phrasing where objections apply. For privilege logs, use the firm's standard column structure (date, author, recipients, subject, privilege type). Never omit potentially-responsive documents from a privilege log without attorney sign-off.
# Statutes and Deadlines: Always flag potential statute-of-limitations issues when they arise in the context of drafting or analysis. If a deadline is mentioned without a date, ask for the date rather than inferring it. Treat every date calculation as requiring attorney verification.

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.

# Matter Overview: Matter: Smith v. Acme Corp. Client: Acme Corp (defendant). Our side: Defense. Forum: U.S. District Court, Southern District of New York. Case No.: 24-cv-12345. Judge: Hon. Jane Doe. Our lead attorney: [Name]. Opposing counsel: [Firm Name, Lead Attorney Name].
# Parties and Posture: Plaintiff: John Smith, former employee. Alleges wrongful termination and breach of employment contract. Defendant: Acme Corp. Current posture: answer filed, discovery ongoing, dispositive motion expected in six months. Relevant affiliates: Acme Holdings LLC (parent), Acme Services Inc. (subsidiary where plaintiff worked).
# Key Dates: Filing date: [Date]. Answer due: [completed]. Discovery cutoff: [Date]. Dispositive motion deadline: [Date]. Pretrial conference: [Date]. Trial date: [Date] (tentative). Deposition schedule: see separate file at /depositions/schedule.md.
# Privileged Scope: Attorney-client privileged content in this folder includes: correspondence with client (file prefix client-comms-*), internal strategy memos (in /strategy/), draft pleadings prior to filing. Work product: in /work-product/. Opposing party communications are NOT privileged — in /opposing/. When drafting, treat the /privileged/ and /strategy/ paths as sensitive and flag any output that mixes privileged and non-privileged material.
# Defined Terms: 'Company': Acme Corp, the defendant. 'Employment Agreement': the 2022 employment contract between plaintiff and Acme Services Inc. 'Termination Event': the November 14, 2023 termination of plaintiff's employment. Use these defined terms consistently in all drafting.
# Matter-Specific Drafting Notes: Client prefers plain-English explanations for strategic questions; prefers numbered bullets for procedural updates. Lead attorney's preferred motion length: 15 pages unless more is genuinely warranted. Never include opposing counsel's name in file names — use 'OC' as a placeholder.

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.

Imports (@path syntax): CLAUDE.md can pull in another file with `@path/to/file.md` syntax anywhere in the body. Example: `See @AGENTS.md for cross-vendor agent rules and @styles/citations.md for the firm's full citation reference.` Maximum depth is 5 hops. Imported files load into context at launch alongside the importing file — so imports organize, they don't save tokens [1].
.claude/rules/ directory (2026): Place modular rule files under `.claude/rules/` (e.g., `citations.md`, `discovery.md`, `brief-format.md`). By default they load at launch. But you can scope a rule to specific file paths with YAML frontmatter: `paths: ['briefs/**/*.docx']`. Now the rule only loads when Claude is touching a brief — saving tokens for every other task [1].
AGENTS.md compatibility: If your firm is running multiple AI coding agents and already has an `AGENTS.md`, Claude won't read it directly — Claude reads `CLAUDE.md`. The fix: create a CLAUDE.md whose first line is `@AGENTS.md`, then add Claude-specific rules below. Both agents see the same shared rules, and Claude gets its delta [1].
claudeMdExcludes for monorepos: In a firm-wide monorepo where different practice groups have different CLAUDE.md files you don't want picked up, set `claudeMdExcludes` in `.claude/settings.local.json` to skip them. Useful when an attorney only works in one practice and doesn't want other practices' conventions polluting context [1].

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.

Claude Code: Full, canonical CLAUDE.md support. `/init` command auto-generates a starting CLAUDE.md by analyzing the codebase. `.claude/rules/` path-scoped rules are Claude Code's home turf. Everything described in this article originated here [1].
Claude Cowork: Cowork respects CLAUDE.md in mounted folders — the convention carries over. Cowork ALSO has its own Global Instructions (Settings UI) and Folder Instructions (per-folder UI) that stack on top. The full precedence for Cowork: Global Instructions → Folder Instructions → CLAUDE.md (walked up the tree) → any Project memory if you're inside a Project [5].
Projects: Projects have a dedicated 'Instructions' field in the UI. It acts like a Cowork Folder Instruction but lives with the Project rather than the folder. CLAUDE.md files in any folders attached to the Project still apply. Use the Project Instructions field for Project-scoped rules; use CLAUDE.md for rules that should persist even if the folder is opened outside the Project.
The composition principle: Regardless of product, the logic is the same: broader context loads first, more specific context appends last. The rule that wins on conflict is the one Claude read most recently — which is almost always the most specific.

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. [1]Anthropic Claude Code Docs, "How Claude remembers your project."Link
  2. [2]Anthropic Claude Code Docs, "Best Practices for Claude Code."Link
  3. [3]Anthropic, "Using CLAUDE.MD files: Customizing Claude Code for your codebase."Link
  4. [4]Anthropic Claude Code Docs, "Explore the .claude directory."Link
  5. [5]Anthropic, "Get started with Claude Cowork," Claude Help Center.Link
  6. [6]HumanLayer Blog, "Writing a good CLAUDE.md."Link
  7. [7]Builder.io Blog, "How to Write a Good CLAUDE.md File."Link
  8. [8]TurboDocx, "How to Write a CLAUDE.md File That Actually Works."Link
  9. [9]Medium (Rentier Digital), "CLAUDE.md Best Practices: How to Structure Your Claude Code Config (2026)."Link
  10. [10]The AI Corner, "Claude Cowork Setup Guide: Context Files, Instructions, Plugins, Workflows (2026)."Link
  11. [11]GitHub (shanraisshan), "claude-code-best-practice."Link
  12. [12]Product Compass, "The Guide to Claude Code for PMs."Link
Back to Research