---
title: "Route AI context across work, business, and personal domains without mixing them"
description: "Split AI memory into domain folders, route each prompt to the right context file with a root table or a hook, and test that routing works."
canonical: "https://scalewithsearch.com/articles/multi-domain-ai-context-architecture"
date: "2026-01-28"
modified: "2026-09-25"
---
## Site navigation

- [Scale With Search](https://scalewithsearch.com/)
- Real estate
  - Real estate
    - [Real estate](https://scalewithsearch.com/for/real-estate)
- Work
  - Start here
    - [Send your brief](https://scalewithsearch.com/work#send-your-brief)
    - [Prepare your six-question brief](https://scalewithsearch.com/work#prepare-your-six-question-brief)
  - Build
    - [Site build, content library with SEO, signal desk](https://scalewithsearch.com/work)
- For your business
  - Trades and home services
    - [Auto body and collision shops](https://scalewithsearch.com/for/auto-body-and-collision-shops)
    - [Foundation and home repair contractors](https://scalewithsearch.com/for/foundation-and-home-repair)
    - [Garage door and fencing contractors](https://scalewithsearch.com/for/garage-door-and-fencing-contractors)
    - [HVAC contractors](https://scalewithsearch.com/for/hvac-contractors)
    - [Janitorial and commercial cleaning companies](https://scalewithsearch.com/for/janitorial-and-commercial-cleaning)
    - [Locksmiths](https://scalewithsearch.com/for/locksmiths)
    - [Moving companies](https://scalewithsearch.com/for/moving-companies)
    - [Pest control companies](https://scalewithsearch.com/for/pest-control-companies)
    - [Plumbing and electrical contractors](https://scalewithsearch.com/for/plumbing-and-electrical-contractors)
    - [Restoration and water or fire damage companies](https://scalewithsearch.com/for/restoration-and-water-fire-damage)
    - [Roofing companies](https://scalewithsearch.com/for/roofing-companies)
    - [Towing companies](https://scalewithsearch.com/for/towing-companies)
    - [Tree services and landscaping companies](https://scalewithsearch.com/for/tree-services-and-landscaping)
    - [Solar installers](https://scalewithsearch.com/for/solar-installation)
    - [General contractors](https://scalewithsearch.com/for/general-contractors-and-construction)
    - [Paving, concrete, and flooring contractors](https://scalewithsearch.com/for/paving)
  - Practices and professional services
    - [Bookkeeping and tax practices](https://scalewithsearch.com/for/bookkeeping-and-tax-practices)
    - [Dental practices](https://scalewithsearch.com/for/dental-practices)
    - [Family and criminal defense law firms](https://scalewithsearch.com/for/family-and-criminal-defense-law-firms)
    - [Med spas and aesthetics practices](https://scalewithsearch.com/for/med-spas-and-aesthetics)
    - [Personal injury law firms](https://scalewithsearch.com/for/personal-injury-law-firms)
    - [Veterinary clinics](https://scalewithsearch.com/for/veterinary-clinics)
    - [Gyms and fitness studios](https://scalewithsearch.com/for/fitness)
    - [Therapy and outpatient health practices](https://scalewithsearch.com/for/therapy-and-outpatient-health)
    - [Medical billing companies](https://scalewithsearch.com/for/medical-billing)
    - [Insurance agencies](https://scalewithsearch.com/for/insurance-agencies)
    - [Financial advisors](https://scalewithsearch.com/for/financial-advisors)
    - [Property management companies](https://scalewithsearch.com/for/property-management)
    - [Recruiting and staffing agencies](https://scalewithsearch.com/for/recruiting-and-staffing)
    - [Architects and interior designers](https://scalewithsearch.com/for/architects-and-interior-designers)
    - [Logistics and supply chain companies](https://scalewithsearch.com/for/logistics-and-supply-chain)
  - Agencies, MSPs, and manufacturing
    - [IT and managed service providers](https://scalewithsearch.com/for/it-and-managed-service-providers)
    - [Machine shops and precision manufacturers](https://scalewithsearch.com/for/machine-shops-and-precision-manufacturing)
    - [Marketing agencies and freelancers](https://scalewithsearch.com/for/marketing-agencies-and-freelancers)
    - [SEO agencies and consultants](https://scalewithsearch.com/for/seo-agencies-and-consultants)
    - [Small manufacturers and fabricators](https://scalewithsearch.com/for/small-manufacturers-and-fabricators)
  - Restaurants, shops, studios, and nonprofits
    - [Restaurants and hospitality businesses](https://scalewithsearch.com/for/restaurants-and-hospitality)
    - [Retail stores and ecommerce sellers](https://scalewithsearch.com/for/retail-and-ecommerce)
    - [Photographers, event planners, and travel agents](https://scalewithsearch.com/for/photographers)
    - [Churches and nonprofits](https://scalewithsearch.com/for/churches-and-nonprofits)
  - [All industries](https://scalewithsearch.com/for/)
- Learn
  - For your office
    - [Office job guides](https://scalewithsearch.com/guides/)
    - [Browser calculators](https://scalewithsearch.com/tools/)
  - Start here
    - [How it works](https://scalewithsearch.com/how-it-works)
    - [Free Starter Kit](https://scalewithsearch.com/kit/business-memory-starter-kit.zip)
    - [Synthetic specimen](https://scalewithsearch.com/specimen/working-session-specimen.zip)
  - Guides
    - [The Complete Guide to Business Memory for AI Agents](https://scalewithsearch.com/articles/business-memory-for-ai-agents-guide)
    - [The Complete Small-Business Guide to AI Agent Governance](https://scalewithsearch.com/articles/ai-agent-governance-guide-small-business)
    - [The Complete Guide to Leaving Vendor AI Memory](https://scalewithsearch.com/articles/leaving-vendor-ai-memory-guide)
  - Articles by cluster
    - [Business memory](https://scalewithsearch.com/articles/business-memory-for-ai-agents-guide)
    - [Agent governance](https://scalewithsearch.com/articles/ai-agent-governance-guide-small-business)
    - [Migration and ownership](https://scalewithsearch.com/articles/leaving-vendor-ai-memory-guide)
  - For machines
    - [llms.txt](https://scalewithsearch.com/llms.txt)
    - [llms-full.txt](https://scalewithsearch.com/llms-full.txt)
    - [Machine view](https://scalewithsearch.com/?view=machine)
- Company
  - Evidence
    - [Proof](https://scalewithsearch.com/proof)
  - Company
    - [About](https://scalewithsearch.com/about)

# Route AI context across work, business, and personal domains without mixing them.

You have a day job, a side business, and a personal life. You may also have several clients. Each area has different people, different rules, and different current state.

One `CLAUDE.md` file cannot hold all of that well. When every domain shares one file, the assistant reads work rules while it answers a personal question. It can also mix one client's details into another client's draft.

You need a structure that keeps each domain apart, and a route that loads the right domain without a manual file selection for every question. This article builds that structure in three layers, shows two ways to route, and gives a test for the routing.

## See how context collides

Say you manage a sales database for an employer by day and run an SEO consulting business at night. You ask: "What's the status on the Smith account?"

The employer's database has a Smith lead. Your consulting business has a Smith client. If all your context lives in one file, the assistant must guess. It can also blend the two: consulting advice in a database answer, the wrong contact names, or the wrong dates.

A single file does not scale past one domain. Separation does.

## Build three layers

A multi-domain structure has three parts:

1. **Root `CLAUDE.md`.** A routing table that maps the prompt to a domain.
2. **Domain folders.** One directory for each area of work or life.
3. **Context files.** One `_context.md` file in each domain folder, with that domain's rules and current state.

The root file does not hold all your context. It holds the map to your context.

### Layer 1: the root routing table

The root `CLAUDE.md` sits at the top of the vault. It contains a table that maps keywords to domains:

```
| Domain | Context File | Load when prompt mentions... |
|--------|--------------|------------------------------|
| **Work** | `work/_context.md` | lead, database, CRM, agent, cleanup |
| **Business** | `business/_context.md` | client, SEO, content, article, outreach |
| **Personal** | `personal/_context.md` | budget, health, household, family |
```

The word "lead" routes to `work/_context.md`. The word "client" routes to `business/_context.md`. The word "budget" routes to `personal/_context.md`. This is keyword routing: the prompt's words select the domain before the answer.

### Layer 2: domain folders

Each domain gets its own folder:

```
/vault/
  CLAUDE.md (root)
  /work/
    _context.md
    _log.md
    /leads/
    /reports/
  /business/
    _context.md
    _log.md
    /clients/
    /content/
  /personal/
    _context.md
    _log.md
    /finance/
    /health/
```

Each folder holds everything for its domain. Client files go in `business/`. Lead data goes in `work/`. Budget spreadsheets go in `personal/`. Separate locations make separate reads possible.

### Layer 3: context files

Each domain folder has a `_context.md` file. It holds the domain's rules and its current state. It is the file that loads when the route selects the domain.

An example `work/_context.md`:

```
# Work Context

## Current State
- Database cleanup: 11 tags fixed, about 200 contacts left
- Weekly pipeline report: due Fridays at noon
- CRM: read-only access until the data audit closes

## Key People
- Manager: [name]
- Company owner: [name]

## Rules
- Always include the record ID when referencing a lead
- No bulk edits without explicit confirmation
- Database changes logged to work/_log.md
```

An example `business/_context.md`:

```
# Business Context

## Active Clients
- Client A (dental practice)
- Client B (landscaping company)
- Client C (industrial B2B supplier)

## Services
- Content briefs
- Full articles
- Topical authority maps

## Rules
- Client deliverables go in business/clients/{client-name}/
- All content follows structured SEO briefs
- Invoice via Stripe, 50% deposit before work starts
```

Keep each file short. It is a current snapshot of what the assistant needs to work in that domain. Detailed records stay in the domain's subfolders. For a field-by-field structure, see the [AI context manifest template](/articles/ai-context-manifest-template).

## Choose how the route runs

The routing table can run in two ways.

**Instruction routing.** The model reads the root table in `CLAUDE.md` at session start. When a prompt contains a listed keyword, the model opens the matching `_context.md` file. This needs no code. It depends on the model following the instruction, so it can miss.

**Hook routing.** A Claude Code hook is a script that runs at a defined event, such as prompt submission. The script matches keywords in the prompt and adds the matching context file to the session before the model answers. The match is deterministic, and the script can log which file it loaded.

Start with instruction routing. Move to a hook when a wrong load has a real cost, or when you need a record of every load.

## Trace one prompt

Here is the flow for "What's the status on the Smith lead?":

1. You submit the prompt.
2. The route finds the keyword "lead."
3. The routing table maps "lead" to the work domain.
4. The route loads `work/_context.md`.
5. The answer uses work context only.

If you ask "What's the status on the Smith client?", the word "client" loads `business/_context.md`. The same question gets a different context and a different answer.

## Stack domains on purpose

Some prompts touch two domains. "Update the client deliverable schedule and check the lead database" contains "client" and "lead." The route loads both context files, and the answer can use both.

Most of the time, domains stay apart. Work context does not need personal context. Some overlaps are real, though. You may track business revenue in a personal finance sheet. You may reuse a CRM method from work to set up client tracking in your business.

The structure allows a cross-domain reference. It prevents an accidental one. To keep one domain, use its keywords only. To combine two, use keywords from both.

## Know the limit of keyword routing

Keyword routing selects relevant context. It is not an access control.

A prompt that names the wrong keyword loads the wrong file. A client file can mention another client by name. A model that follows instructions can still open a file that the table did not select. For client data, where a leak has a cost, add a hard boundary: stable client identifiers, default-deny file access, and a test for cross-client reads. The method is in [how to keep businesses, clients, and roles separate for AI agents](/articles/separate-business-contexts-ai-agents).

## Scale past three domains

Three domains are a starting point. Five freelance clients can each have a folder, a `_context.md` file, and their own keywords:

```
| Domain | Context File | Load when prompt mentions... |
|--------|--------------|------------------------------|
| **Client A** | `clients/acme/_context.md` | Acme, industrial, fabrication |
| **Client B** | `clients/zenith/_context.md` | Zenith, dental, clinic |
| **Client C** | `clients/apex/_context.md` | Apex, landscaping, lawn |
```

The word "Acme" loads one client's context. The word "Zenith" loads another.

The structure works for ten domains or fifty. The practical limit is the maintenance load: every domain needs someone to keep its context file current. Industry keywords also collide as the table grows. Two clients in the same industry need their names as keywords, not the industry.

## Load a domain by hand when you switch

Automatic routing handles most requests. Sometimes you want explicit control, for example before a long block of work in one domain.

Tell the assistant "Load business context." It reads `business/_context.md` and confirms. Later questions use that context until you switch.

## Keep context files current

Context files change as the domains change. A new colleague goes into `work/_context.md`. A finished client project changes `business/_context.md`. A new budget structure changes `personal/_context.md`.

The assistant can draft the update. After a session with an important change, ask: "Update the context file with today's changes." It reads the session log, finds what changed, and proposes the edit. Review the edit before you accept it. A context file that the model rewrites without review can drift from the facts. For the review pattern, read [how corrections become system memory](/articles/corrections-become-system-memory).

## Compare one file with many

A single file loads everything every time. The assistant reads work details to answer a personal question, and it reads Client A to find Client B.

A multi-domain structure loads only what the prompt needs. The load is smaller, and accidental mixing is less likely. The comparison is a filing cabinet with one drawer against a cabinet with twenty labeled drawers. Both hold the same papers. One is easier to search. For how much context each task should read, see [what context an agent should read](/articles/what-context-should-an-agent-read).

## Start with a root file and two domains

Do not build ten domains on the first day.

1. Create a root `CLAUDE.md` with a routing table.
2. Create two domain folders, such as `work` and `personal`.
3. Write a `_context.md` file for each domain.
4. Run the routing test below.
5. Add a third domain only after the test passes.

### A worked routing test

Write six prompts before you trust the route. Record the expected domain for each.

| Prompt | Expected load |
|---|---|
| "Summarize this week's lead cleanup." | `work/_context.md` |
| "Draft the outline for the next client article." | `business/_context.md` |
| "What is left in the household budget this month?" | `personal/_context.md` |
| "Compare the client schedule with the lead report." | work and business |
| "What's the status on Smith?" | none; the assistant asks which domain |
| "Write a note to the family about the weekend." | `personal/_context.md` only |

Run each prompt in a new session. Ask the assistant to name the context files it read, or read the hook log. The test passes when every load matches the table. The ambiguous "Smith" prompt passes only if the assistant asks a question. A guess is a failure.

When a prompt fails, change the keywords in the root table, and run all six prompts again. The structure is flexible, so you can change it as your domains change.


## Related: AI memory

- [Document your business processes so an AI can follow them without a briefing](/articles/how-to-document-business-processes-for-ai)
- [Reorganize an existing AI vault so the assistant finds the right context](/articles/how-to-organize-ai-knowledge-vault)
- [Turn repeated AI formatting instructions into rules the model reads every session](/articles/ai-doesnt-follow-my-instructions)

----

```text
                  .|########||.                                       .|########||.                                       .|########||.
               |##||.      .||##|.                                 |##||.      .||##|.                                 |##||.      .||##|.
             |#|.              .|#|.                             |#|.              .|#|.                             |#|.              .|#|.
           |#|                    |#|                          |#|                    |#|                          |#|                    |#|
         .#|                        |#.                      .#|                        |#.                      .#|                        |#.
        .#.                          .#|                    .#.                          .#|                    .#.                          .#|
       |#.                            .#|                  |#.                            .#|                  |#.                            .#|
      |#             ......             #|                |#             ......             #|                |#             ......             #|
     .#           ||#########|           #|              .#           ||#########|           #|              .#           ||#########|           #|
    .#.         |######||######|.        .#.            .#.         |######||######|.        .#.            .#.         |######||######|.        .#.
    #.        .##|###|##|#|######|        .#            #.        .##|###|##|#|######|        .#            #.        .##|###|##|#|######|        .#
   ||        |##|#||||||||||||#||#|        ||          ||        |##|#||||||||||||#||#|        ||          ||        |##|#||||||||||||#||#|        ||
   #        |#||||||||||||||||||||#|        #.         #        |#||||||||||||||||||||#|        #.         #        |#||||||||||||||||||||#|        #.
  ||       |#||||||||||||||||||||||#|       ||        ||       |#||||||||||||||||||||||#|       ||        ||       |#||||||||||||||||||||||#|       ||
  #       .#||||||||||||||||||||||||#|       #        #       .#||||||||||||||||||||||||#|       #        #       .#||||||||||||||||||||||||#|       #
 ||   ....|||#||||||##|#|||#|#||##||||....|. ||      ||   ....|||#||||||##|#|||#|#||##||||....|. ||      ||   ....|||#||||||##|#|||#|#||##||||....|. ||
 #.  .  ....|#  ....#|||   ||| .#|||  ....#. .#      #.  .  ....|#  ....#|||   ||| .#|||  ....#. .#      #.  .  ....|#  ....#|||   ||| .#|||  ....#. .#
 #   .  ||||#| .#####||  . .#| .#|||  ||||#   #.     #   .  ||||#| .#####||  . .#| .#|||  ||||#   #.     #   .  ||||#| .#####||  . .#| .#|||  ||||#   #.
.|   |||||  #. |#|||||. ||  #. |#||. .|||||   ||    .|   |||||  #. |#|||||. ||  #. |#||. .|||||   ||    .|   |||||  #. |#|||||. ||  #. |#||. .|||||   ||
||   |....  #. ....|#.      |. ...|. ....||   ||    ||   |....  #. ....|#.      |. ...|. ....||   ||    ||   |....  #. ....|#.      |. ...|. ....||   ||
#.  .||||||##||||||##||####|||||||#||||||#|   .#    #.  .||||||##||||||##||####|||||||#||||||#|   .#    #.  .||||||##||||||##||####|||||||#||||||#|   .#
#    .||####|###########################|.     #    #    .||####|###########################|.     #    #    .||####|###########################|.     #
#      .#||||||.#.|| # |. ..# #| #|||||#|      #    #      .#||||||.#.|| # |. ..# #| #|||||#|      #    #      .#||||||.#.|| # |. ..# #| #|||||#|      #
#      .#|||||| ..  |# ## |#| ...#|#|||#|      #    #      .#|||||| ..  |# ## |#| ...#|#|||#|      #    #      .#|||||| ..  |# ## |#| ...#|#|||#|      #
#      .#|||#|# .# .#| #| ##|.#..#|||||#|      #    #      .#|||#|# .# .#| #| ##|.#..#|||||#|      #    #      .#|||#|# .# .#| #| ##|.#..#|||||#|      #
#      .#||||||############|######|||||#|      #    #      .#||||||############|######|||||#|      #    #      .#||||||############|######|||||#|      #
#   |...||#||||||#||||#|#||||||#|||||#||| |.|  #    #   |...||#||||||#||||#|#||||||#|||||#||| |.|  #    #   |...||#||||||#||||#|#||||||#|||||#||| |.|  #
#. .. ||||# .|||##|.  |#| .|| || .|||#. #|  # .#    #. .. ||||# .|||##|.  |#| .|| || .|||#. #|  # .#    #. .. ||||# .|||##|.  |#| .|| || .|||#. #|  # .#
|| |  ...||  ...##| |  #| .|. |. #####  .. .| ||    || |  ...||  ...##| |  #| .|. |. #####  .. .| ||    || |  ...||  ...##| |  #| .|. |. #####  .. .| ||
|| ||||| || ||||#|  .  |. |. |#. ||||| |#| || ||    || ||||| || ||||#|  .  |. |. |#. ||||| |#| || ||    || ||||| || ||||#|  .  |. |. |#. ||||| |#| || ||
.# |.....#|....|#.||||.|||##.|#|....||.#||.#. #.    .# |.....#|....|#.||||.|||##.|#|....||.#||.#. #.    .# |.....#|....|#.||||.|||##.|#|....||.#||.#. #.
 #.|||||||#############################| ||| .#      #.|||||||#############################| ||| .#      #.|||||||#############################| ||| .#
 ||       ##||#||#||||||#||#||#||#||##.      ||      ||       ##||#||#||||||#||#||#||#||##.      ||      ||       ##||#||#||||||#||#||#||#||##.      ||
  #       .#|||||||||#||#|||||||||||#|       #        #       .#|||||||||#||#|||||||||||#|       #        #       .#|||||||||#||#|||||||||||#|       #
  ||       |#||||||||||||||||||||||#|       ||        ||       |#||||||||||||||||||||||#|       ||        ||       |#||||||||||||||||||||||#|       ||
  .#        |#||||||||||||||||||||#|        #.        .#        |#||||||||||||||||||||#|        #.        .#        |#||||||||||||||||||||#|        #.
   ||        |#||||||||||||||||||#|        ||          ||        |#||||||||||||||||||#|        ||          ||        |#||||||||||||||||||#|        ||
    #.        .######|#|#########|        .#            #.        .######|#|#########|        .#            #.        .######|#|#########|        .#
    .#.         |#####||||#####|         .#.            .#.         |#####||||#####|         .#.            .#.         |#####||||#####|         .#.
     |#           ||########||           #.              |#           ||########||           #.              |#           ||########||           #.
      |#             ......             #|                |#             ......             #|                |#             ......             #|
       |#.                            .#|                  |#.                            .#|                  |#.                            .#|
        |#.                          .#.                    |#.                          .#.                    |#.                          .#.
         .#|                        |#.                      .#|                        |#.                      .#|                        |#.
           |#|                    |#|                          |#|                    |#|                          |#|                    |#|
            .|#|.              .|#|.                            .|#|.              .|#|.                            .|#|.              .|#|.
               |##||.      .||##|                                  |##||.      .||##|                                  |##||.      .||##|
                 .||########||.                                      .||########||.                                      .||########||.

Scale With Search  2026  [scalewithsearch.com](https://scalewithsearch.com)
```
