Claude Code for Lawyers:
Build a Legal AI OS in a Weekend
Brief drafting, contract review, research organization, and client communication templates — all running automatically every session, without any new infrastructure. Here is the exact setup.
What Claude Code Is — and Why Lawyers Are Adopting It Fast
Claude Code is Anthropic's terminal-based AI assistant. Unlike chat-based AI tools, it reads your project files — including a CLAUDE.md file, a brain/ directory of knowledge, and a .claude/rules/ folder of behavioral directives — automatically at the start of every session. You get an assistant that already knows your practice areas, your preferred motion structure, your client communication tone, and your matter management workflow, without you re-explaining it each time.
Search volume for "AI for lawyers" has grown over 380% since mid-2024. According to the American Bar Association's 2025 Legal Technology Survey, 42% of attorneys at firms with 100+ lawyers now use a generative AI tool weekly, up from 11% two years prior. Solo and small-firm practitioners are the fastest-growing adopter segment — driven primarily by the economics: a solo practitioner who automates 90 minutes of daily drafting work across a 250-working-day year recovers 375 billable hours annually.
Most lawyers start with ChatGPT or a legal-specific SaaS. The friction they discover: these tools require re-explaining context every session, don't follow firm-specific formatting rules, and can't hold institutional knowledge across matters. Claude Code solves all three problems. With a properly structured Legal OS — the configuration files that Brainfile provides pre-built for attorneys — Claude reads your professional identity, your practice-specific rules, and your current matter context before it writes a single word.
Why Claude Code specifically — and not a legal AI SaaS?
Legal-specific SaaS tools like Harvey, CoCounsel, and Spellbook are genuinely powerful but carry three tradeoffs that matter for many practitioners: (1) per-seat costs that scale linearly with your team, (2) a closed configuration — you cannot encode firm-specific procedural rules or matter management conventions — and (3) your work product flows through their servers under their data policies.
Claude Code with Brainfile runs entirely on your machine. The only outbound call is to Anthropic's API, which you control. Your CLAUDE.md, brain/ directory, and rules files are plain text files that live in your file system — reviewable, version-controllable, and portable. The configuration itself becomes institutional knowledge that compounds over time rather than disappearing when you cancel a subscription.
This guide covers the exact configuration — the CLAUDE.md templates, brain/ directory structure, and rules files — that legal professionals need to run Claude Code as a domain-specific legal assistant.
5 Legal Use Cases — With CLAUDE.md Snippets for Each
Each use case below includes the CLAUDE.md directive that activates it. These snippets go into your project CLAUDE.md — Claude reads them automatically at session start, no prompting required.
The Full Legal OS CLAUDE.md (80+ Lines)
This is what a complete attorney CLAUDE.md looks like. Not generic boilerplate — a full operating system that tells Claude who you are, what you practice, how you communicate, and what to do every session without being asked. This is the file Brainfile Pro delivers pre-built and pre-validated, with profession-specific brain/ templates included.
Claude Code reads CLAUDE.md automatically at the start of every session — no prompting required. It sits in your project root directory. Every directive in this file is active for the entire session. See the Claude Code memory guide for how the file hierarchy works.
Brainfile Pro includes a complete, validated Legal OS — CLAUDE.md + all brain/ templates + three pre-configured .claude/rules/ files — ready to install in under 10 minutes. You customize your name, jurisdiction, and practice areas. Everything else is production-ready on day one.
brain/ Directory Structure for Lawyers
The brain/ directory is your persistent knowledge base. Claude reads it every session — it is where institutional knowledge accumulates. Here is the recommended structure for a legal practice, including what belongs in each file. Read the full memory guide for how Claude accesses these files.
What makes this directory valuable over time
The brain/ directory compounds. On day one it contains your templates and rules. By month six, it contains your vetted research, detailed judicial profiles built from your actual courtroom observations, opposing counsel tendencies learned across multiple matters, and a complete conflict-check database. Claude reads all of it at every session start. The configuration becomes your institutional knowledge — portable, version-controlled, and yours.
This is the fundamental difference between a chat-based AI tool (stateless, re-explains everything every time) and a Claude Code Legal OS (stateful, accumulates knowledge, knows your practice). Learn more about structuring these files in the Claude Code memory guide.
.claude/rules/ Files for Legal Work
Rules files in .claude/rules/ extend CLAUDE.md with domain-specific behavioral rules. They are loaded automatically alongside CLAUDE.md and apply to every session. Here are three rules files every legal practitioner should configure. See the complete rules guide for syntax and loading order.
1. citation-rules.md — Citation Quality Enforcement
2. drafting-voice.md — Writing Style Enforcement
3. matter-hygiene.md — Matter File Consistency Rules
Files in .claude/rules/ are automatically loaded by Claude Code alongside your CLAUDE.md. They stack — each file adds to the behavioral context, not overwrites it. Read the rules file guide for the full loading order and how to use rules files for different practice groups or matter types.
Ethics & Client Confidentiality: What Every Attorney Needs to Know
Using AI in legal practice raises real professional responsibility questions. Most state bars have now issued guidance. Here is a clear-eyed summary of what the rules require and how to configure your Legal OS to stay compliant.
This guide is informational. It does not constitute legal ethics advice and does not establish an attorney-client relationship. Your jurisdiction's specific rules and bar guidance control. Consult your state's formal ethics opinions on AI use before implementing any AI-assisted workflow for client matters.
The duty of competence and AI (ABA Model Rule 1.1)
ABA Comment 8 to Model Rule 1.1 requires lawyers to maintain competence with "relevant technology." By 2026, this is widely interpreted by bar ethics committees to include understanding how generative AI tools process data and what safeguards apply. The duty of competence now cuts both ways: using AI tools effectively is increasingly expected; using them carelessly is a disciplinary risk.
As of early 2026, over 35 state bars have issued formal guidance or ethics opinions on AI use in practice. The majority take the position that using AI for legal work is permissible under Rules 1.1, 1.3, and 5.3, subject to appropriate supervision and confidentiality protections. A small number have issued caution opinions flagging data routing concerns. Check your jurisdiction's most recent formal opinion.
Client confidentiality and data routing (ABA Model Rule 1.6)
Rule 1.6 prohibits disclosure of information relating to representation of a client. The question AI tools raise is: does sending a prompt containing client facts to an API constitute disclosure? Most ethics opinions land here: the analysis is consent-plus-safeguards. A few specific points that matter for Claude Code users:
- Anthropic's API terms: As of 2026, Anthropic does not train on API traffic by default. You should review the current data processing addendum and confirm it meets your bar's requirements before inputting any client facts.
- The prompt is the risk vector: The AI model cannot retroactively expose information you never included in a prompt. The Legal OS CLAUDE.md above includes a Confidentiality Rules section specifically to prevent Claude from suggesting or encouraging inclusion of actual client facts.
- Use coded references: Prompts should refer to "the employer defendant" or "Client A" rather than actual names. Templates and research workflows can operate entirely on anonymized fact patterns. Only finalize documents — using client names — in your own editor.
- brain/ directory hygiene: Never populate brain/ files with actual client PII, case numbers linking to real parties, or verbatim excerpts from privileged communications. Brain/ should contain frameworks, templates, and synthesized research — not privileged content.
Supervision of AI output (ABA Model Rule 5.3)
Rule 5.3 requires proper supervision of nonlawyer assistance. Most ethics guidance now extends this to AI tools. The practical implication: every AI-generated draft that goes out the door needs attorney review. This is not a burden that Claude Code increases — if anything, the Legal OS makes supervision faster by flagging [CITE NEEDED] markers, outputting QC summaries, and structuring drafts to match your review checklist rather than requiring a complete structural re-read.
Disclosure to clients
An increasing number of bar opinions require disclosure when AI is used substantially in preparing work product, unless the client has consented in the engagement agreement. The simplest approach: add a one-sentence disclosure to your engagement letter template. "I use AI-assisted drafting tools in the preparation of legal documents. All work product is reviewed and approved by the supervising attorney." This satisfies most current guidance and signals transparency to clients who increasingly expect it.
Unauthorized practice of law
Claude Code does not practice law and does not hold itself out as doing so. The Legal OS is configured specifically to flag legal conclusions for attorney review, to use probabilistic language ("strong argument," "risk of adverse ruling") rather than definitive legal predictions, and to require attorney sign-off before any client-facing communication is considered final. These are not cosmetic guardrails — they are professional responsibility features built into the system architecture.
Get the Legal OS — Pre-Built & Production-Ready
Complete CLAUDE.md, brain/ directory templates, three .claude/rules/ files, and matter management dashboards — configured for attorneys, ready in under 10 minutes.
Before and After: 5 Legal Tasks With and Without Brainfile
The difference is not "AI vs. no AI" — it is a configured, context-aware Legal OS versus a stateless chat tool that re-asks for context every session. Here is what that looks like for the five most time-intensive legal tasks.
| Task | Without Brainfile Legal OS | With Brainfile Legal OS |
|---|---|---|
| Contract Review | Re-paste context + risk framework + jurisdiction each session. 10-15 min setup. Output varies by prompt quality. No clause-level flag tracking. | Say "review this contract." Claude already knows your jurisdiction, risk thresholds, and flag format. Clause table + executive summary + redlines on first pass. |
| Brief Drafting | Generic structure, generic voice. Manually specify court, standard of review, citation format every time. Cites are hallucination-prone. Re-read every sentence. | CLAUDE.md carries court structure, voice rules, and citation format. [CITE NEEDED] flags every unverified cite. QC summary at end. Half the attorney review time. |
| Research Organization | Research notes in a folder. Must re-brief Claude on what you've found. No synthesis. No adverse-authority flagging across matters. Knowledge resets every session. | brain/research/ accumulates vetted authority. Claude reads it at session start and cites from it before suggesting new cases. Adverse authority mapped across matters. |
| Client Status Update | Manually re-enter matter posture, client's background, and communication preferences per email. Output is professional but generic. No billing code in footer. | Read brain/matters/[ID] → draft email in your voice with matter context, correct reading level, billing code, and next-step structure — without being asked. |
| Deadline Calculation | Ask Claude to calculate. Hope it applies correct rule. No rule citation shown. Manual verification required. No logging to matter file. | Calculate deadline → show rule basis (FRCP 6(a), local rule) → log to deadlines.json → flag if calculation is disputed → calendar conservatively by default. |
Pricing comparison: Legal OS vs. legal AI SaaS
| Tool | Monthly Cost | Configurable | Data Control | Knowledge Persistence |
|---|---|---|---|---|
| Harvey AI | $3,000–8,000+/seat/yr | Limited | Vendor servers | Platform-dependent |
| CoCounsel (Thomson Reuters) | $400–600+/seat/mo | Minimal | Vendor servers | Platform-dependent |
| Spellbook | $99–249/seat/mo | Templates only | Vendor servers | No |
| Claude Code (bare) | API usage (~$20–80/mo) | Full — if you build it | Local + Anthropic API | Only if you build brain/ |
| Brainfile Pro + Claude Code | $149/mo all-in | ✓ Full | ✓ Local | ✓ Compounds daily |
FAQ: 8 Questions Lawyers Ask About Claude Code
Your Law Practice,
Powered by Claude Code
Stop re-explaining your practice to an AI every session. The Legal OS gives Claude everything it needs to know about how you practice, what you value, and how your matters are structured — on day one.
Continue reading