All posts
Blog

How to Organize Client Files by Matter at a Law Firm

Published 6/5/2026Updated 6/5/202610 min read

The Smith matter has documents in three places: the named partner's Downloads folder, a shared drive folder called "Smith stuff," and an email thread nobody has exported. A pleading is named document(4).pdf. A signed engagement letter is a scan named img_2231.pdf. When opposing counsel asks for a specific exhibit, someone spends twenty minutes hunting. Every firm that has not enforced a filing system lives some version of this, and it gets worse with every new matter.

The fix is not another reminder to "name your files properly." People will not do it by hand, and the documents that matter most (downloaded pleadings, scanned signature pages, attachments) arrive with the worst names. The fix is a matter-centric structure plus a tool that reads each document, figures out which matter it belongs to, and files it there. This post is the full walkthrough: the folder structure, the naming pattern, and how Sortio handles the routing with one shared rule the whole firm can run.

The short version

Organize by Client > Matter > category (Pleadings, Correspondence, Discovery, Contracts, Billing), and name every file {YYYY-MM-DD}_{MatterNumber}_{DocType}_{Description}.pdf. Doing this by hand fails because downloaded and scanned documents have useless names. Sortio reads each document, identifies the matter from the content, and files it into the right category folder with a consistent name. Preview before anything moves, run inference locally for confidential material, and share one rule across the firm.

How to organize client files by matter at a law firm

To organize client files by matter at a law firm, file every document under a three-level structure (Client, then Matter, then document category) and name each file with the date, the matter, and the document type. Sortio makes this practical by reading the content of each document, identifying which client and matter it belongs to, and routing it into the correct category folder automatically, so a mixed pile of downloads and scans becomes a clean, navigable matter file instead of a manual sorting chore nobody finishes.

The reason matter-centric beats every other scheme is that a law firm's unit of work is the matter, not the document type and not the date. An attorney thinks "pull the Smith dissolution file," not "pull all the PDFs from April." So the structure has to make the matter the top-level lookup, with categories underneath so you can go straight to the pleadings or the discovery without scrolling past everything else.

The matter-centric folder structure

Here is the structure that holds up across a growing caseload. The top level is the client, the second level is the matter (keyed with a matter number so it stays stable), and the third level is the document category:

Clients/
  Smith_John/
    2026-0142_Dissolution_of_Marriage/
      Pleadings/
      Correspondence/
      Discovery/
      Contracts/
      Billing/
    2025-0098_Estate_Planning/
      Pleadings/
      Correspondence/
      Discovery/
      Contracts/
      Billing/
  Acme_Corp/
    2026-0207_Commercial_Lease_Dispute/
      Pleadings/
      Correspondence/
      Discovery/
      Contracts/
      Billing/

Five categories cover almost everything a litigation or transactional matter accumulates. Pleadings holds filings (complaints, answers, motions, orders). Correspondence holds letters and emails to and from clients, opposing counsel, and the court. Discovery holds requests, responses, document productions, and deposition materials. Contracts holds agreements, engagement letters, and signed instruments. Billing holds invoices, time exports, and trust accounting. Matters that need a sixth bucket (for example Exhibits or Research) can add one, but five is the spine.

The matter number prefix (2026-0142) does the heavy lifting. It sorts matters chronologically by open date, it survives a matter being renamed, and it gives every document a short stable token to carry in its filename. If your firm already issues matter numbers from its billing system, reuse those. If not, year plus a sequential counter is fine.

The naming pattern: date, matter, document type

Inside each category folder, every file follows one pattern so the folder sorts by date and reads cleanly on sight:

Pattern:
{YYYY-MM-DD}_{MatterNumber}_{DocType}_{Description}.pdf

Examples:
2026-03-04_2026-0142_Motion_Temporary_Orders.pdf
2026-03-11_2026-0142_Letter_to_Opposing_Counsel.pdf
2026-03-18_2026-0142_Discovery_Responses_Set_One.pdf
2026-02-20_2026-0142_Engagement_Letter_Signed.pdf
2026-04-01_2026-0142_Invoice_March.pdf

Date first (ISO YYYY-MM-DD) means a category folder always reads top to bottom in chronological order without a custom Finder view. The matter number next ties the file to its matter even if it is ever copied somewhere else or attached to an email. The document type (Motion, Letter, Discovery, Contract, Invoice) makes the folder skimmable. The description disambiguates documents of the same type on the same day. Extension as expected.

This is the kind of convention that is easy to define and almost impossible to enforce by hand, which is exactly why most firms have one in a wiki that nobody follows. The way to make it real is to generate the name from the document content automatically. If you want a reusable, firm-wide spec for this, see how to enforce a file naming convention and the file naming convention generator.

Manual vs rule-based vs read-the-content

There are three honest ways to get documents into the right matter folder, and they suit different volumes and different document quality.

Manual filing
  How:    A person drags each file to the right
          Client > Matter > Category folder and renames it.
  Good:   Total control. No tooling.
  Bad:    Does not scale. Skipped under deadline pressure.
          New hires file inconsistently.

Rule-based (Hazel / AI Rule Builder)
  How:    Deterministic rules on filename, extension, or a
          regex against the text layer. Runs without AI credits.
  Good:   Fast, free per run, predictable. Great when a source
          always produces the same predictable file.
  Bad:    Deterministic patterns are brittle. A scan or a
          new layout that does not match the pattern is
          skipped, and a new matter or vendor needs a new rule.

AI by content (Sortio AI Sort)
  How:    Reads the actual document, identifies client, matter,
          and doc type from the content, then files and renames.
  Good:   Handles garbage filenames, scans, and brand-new
          matters with no per-matter setup. One rule covers all.
  Bad:    Uses AI credits and inference takes longer than regex.

For a firm, the realistic answer is a mix. Use AI Sort for the messy intake (downloads, email attachments, scans) where the filename is useless and the matter has to be read off the content. Once a stable, high-volume source emerges (your billing system always exports invoices the same way, for instance), promote that one flow to the AI Rule Builder so it runs deterministically without consuming credits. The comparison between the two Sortio modes is laid out in AI Sort vs Rule Builder. And to be clear about the macOS baseline: Finder itself has no auto rename or route rule engine, so the non-Sortio options are Hazel rules or manual filing.

How Sortio reads a document and identifies the matter

The flow is the same whether you run it on one document or a backlog of a thousand. Sortio opens the file, extracts the text layer (or runs OCR on the spot if the layer is missing, on the managed tier), and reads it with an LLM. The model identifies the client and matter (from a matter number, a case caption, a re-line, or the parties named in the body), classifies the document type, and Sortio assembles the destination path and filename from your convention. Then it shows you a preview.

Reading content is what makes this work where a rule cannot. A complaint, a discovery response, and an engagement letter can all arrive named document.pdf, and only the inside of the document tells them apart. Two matters for the same client are distinguished by the caption or matter number on the page, not by anything in the filename. An LLM is also robust to OCR noise on scanned signature pages, where a regex would simply stop matching. That robustness is the entire reason content-level routing holds up on a real firm's file mix.

Nothing is destructive. Preview shows the proposed Client, Matter, Category, and new filename for every document before a single file moves, and you can override any individual decision. If Sortio routes a borderline document to the wrong matter, you correct it once in the preview and Sortio remembers that manual correction. Everything Sortio renames or moves is backed up for 30 days, so a misfile is always recoverable.

A working Sortio prompt for matter-centric filing

Drop this into the Sortio prompt box, point it at the folder where loose documents accumulate (Downloads, a scan drop folder, or a shared "to file" folder), and run Preview before applying.

Read each document and determine which client and which
matter it belongs to. Use the matter number if one appears
(format YYYY-NNNN), otherwise infer the client and matter
from the case caption, the re-line, or the parties named
in the body.

File the document under:
~/Clients/{Client}/{MatterNumber}_{MatterName}/{Category}/

Choose Category from exactly one of:
- Pleadings: complaints, answers, motions, briefs, orders,
  notices, anything filed with or issued by a court.
- Correspondence: letters and emails to or from the client,
  opposing counsel, or the court.
- Discovery: interrogatories, requests for production,
  responses, document productions, deposition materials.
- Contracts: agreements, engagement letters, signed
  instruments, term sheets.
- Billing: invoices, time exports, trust accounting,
  payment records.

Rename each file to:
{YYYY-MM-DD}_{MatterNumber}_{DocType}_{Description}.pdf
Use the document date (filing date, signing date, or letter
date). DocType is a short label (Motion, Letter, Discovery,
Engagement_Letter, Invoice). Keep the description short.

If you cannot confidently identify the matter, leave the
file in ~/Clients/_Unfiled/ and do not rename it.

Click Preview. Sortio shows the proposed client, matter, category, and new filename for every file. Anything it could not confidently match lands in an _Unfiled folder rather than being guessed into the wrong matter, which is the safe default for a legal filing system. Apply commits the moves once the paralegal or attorney has signed off.

Confidentiality: keep documents on the machine

Legal documents are privileged, and a lot of them are under protective orders or contain client confidences. Sortio supports local-only inference through Ollama: the LLM runs on the attorney's or paralegal's own machine (Llama 3, Mistral) and no document content ever leaves it. For privileged material, active discovery, or anything you would not send to a third-party AI provider, that is the configuration to use, and it is fully functional. The trade-off (local is a bit slower and slightly less accurate than managed AI) is laid out honestly in local AI vs cloud AI for file organization. For routine, non-privileged filing the managed AI option is faster and more accurate.

One shared rule for the whole firm

A filing convention only works if everyone follows it, and the way to guarantee that is to make it a shared rule rather than a wiki page. On Sortio Teams ($29 per seat per month) the matter-filing prompt and the folder conventions are shared across the firm with an admin console, so every paralegal and associate files identically. A new hire inherits the firm's convention on day one instead of learning one partner's personal habits, and there is one place to update the rule when the firm changes how it handles, say, trust accounting.

This is the same workflow whether you have a one-attorney shop or a twenty-lawyer firm. For the firm-specific overview (multi-matter, multi-paralegal, with the privacy and shared-rule details) see the Sortio for law firms page. The same content-reading approach extends past matters into per-client batching; for the general pattern see how to batch organize documents per client.

Where this sits relative to a document management system

Sortio is not a replacement for a legal document management system. It is the layer that runs before one. Email attachments, browser downloads, and scanned signature pages all land on a local disk with useless names long before anyone files them into the DMS. Sortio handles that messy local-disk stage: it reads each document, identifies the matter, names it to the firm convention, and routes it into the right Client > Matter > Category folder. What then goes into your DMS is already clean and consistently labeled, instead of a pile of document(4).pdf files someone has to rename on the way in.

That clean, consistently named file is also what makes a matter defensible later. When a matter has to be produced, reviewed, or handed to successor counsel, a folder where every document carries its date, matter, and type is the difference between a smooth handoff and a scramble. For the broader version of that, see how to make client files audit-ready.

FAQ

How do you organize client files by matter at a law firm?

You file by a three-level structure: Client, then Matter, then document category (Pleadings, Correspondence, Discovery, Contracts, Billing). Every document gets named with the date, the matter, and the document type so it sorts chronologically and is identifiable on sight. Sortio reads each file, identifies which client and matter it belongs to from the content, and routes it into the right category folder with a consistent name, so a mixed pile of downloads becomes a clean matter file in one pass.

What folder structure should a law firm use for matters?

The durable structure is Clients > {Client} > {MatterNumber}_{MatterName} > {Category}, where category is one of Pleadings, Correspondence, Discovery, Contracts, and Billing. Keying the matter folder with a matter number first means it sorts and stays stable even if the matter name changes. Inside each category, name files {YYYY-MM-DD}_{MatterNumber}_{DocType}_{Description}.pdf so everything in a folder sorts by date and reads cleanly. This mirrors how most firms already think about a file, it just enforces it consistently across everyone's downloads.

Can software file a document under the right matter automatically?

Yes. Sortio reads the content of each document, finds the matter identifier (a matter number, a caption, a client name, a case caption block), and routes the file under that matter. It does not rely on the filename, which is usually useless on a downloaded pleading or a scanned signature page. You preview every proposed destination and name before anything moves, so the attorney or paralegal stays in control of where each document lands.

Is it safe to use AI on confidential legal documents?

Sortio supports local-only inference through Ollama, so the model runs on the machine and no document content leaves it. For privileged material, discovery, or anything under a protective order, that is the configuration to use. The managed AI option is faster and more accurate and is appropriate for routine, non-privileged filing. Either way Sortio is non-destructive, previews before applying, and keeps 30-day backups of anything it renames or moves so a mistaken file is always recoverable.

How do you keep the whole firm filing the same way?

Write the matter-filing rule once and share it. On Sortio Teams ($29 per seat per month) the same prompt and the same folder conventions are shared across the firm with an admin console, so every paralegal and associate files identically instead of inventing their own scheme. New hires inherit the convention on day one rather than learning one attorney's personal habits.

Does this replace our document management system like NetDocuments or iManage?

No. Sortio is the layer before your DMS. It takes raw local files (email attachments, downloads, scans, signature pages) and gets them named and filed correctly under the right matter so that what goes into NetDocuments, iManage, or whatever system you run is already clean and consistently labeled. Sortio handles the messy local-disk stage; your DMS handles long-term storage, versioning, and access control.

How is reading content different from a Finder rule or a Hazel rule?

A Finder or Hazel rule matches a fixed pattern against the filename, the extension, or the document text. That works for predictable, single-source files and breaks the moment a document arrives with a useless name or a layout the pattern was never written for. Sortio acts on the meaning of the document, so it can tell a motion from a deposition transcript from an invoice and file each correctly even when the filenames are identical garbage. macOS Finder has no built-in auto rename or route engine at all, so the realistic alternatives are Hazel rules or manual filing, both of which struggle with content-level routing.

Keep reading

Try this on one messy matter

The free tier includes 10 AI sort credits, no card required. Point Sortio at a folder of loose pleadings, letters, and scans, run Preview, and see them sorted into Pleadings, Correspondence, Discovery, Contracts, and Billing under the right matter before you apply anything. For the firm-wide setup, see Sortio for law firms.