Two Claude Code subscriptions, plus one each of Codex, Gemini and Kimi, run on one laptop with dozens of sessions at once. What keeps them consistent isn't a framework. It's where a session may start, which files each agent reads, and one file every agent can find.
A single coding agent in a single folder is easy to keep consistent. A fleet is not.
This is not a thought experiment. The setup is one laptop and five paid subscriptions across four agent products:
| Agent | Product | Account |
|---|---|---|
| Claude1 | Anthropic Claude Code | work account |
| Claude2 | Anthropic Claude Code | personal account |
| Codex | OpenAI Codex CLI | one subscription |
| Gemini | Google Antigravity CLI (agy) |
one subscription |
| Kimi | Moonshot Kimi Code | one subscription |
Claude gets two seats because it does most of the work; the other three bring a second opinion, a different model family, and spare capacity. Each subscription runs many sessions at once, and each session can spawn subagents. They all work on the same 27 repositories under one folder, ~/Projects, hand work to each other, and pick up where another session left off.
None of them shares a brain with any other. What keeps them aligned is a short list of rules, each of them boring, each of them enforced. This post walks through them, starting with the picture, then the actual files on disk, and ends with the build that puts all five to work on one real task. The post and the kit it describes were published together, once that build worked.
The fleet
The fleet, and what keeps it aligned
- THE FLEET · Four products, five subscriptions Claude, Gemini, Codex and Kimi are separate products. Claude runs on two subscriptions, one work and one personal; Codex, Gemini and Kimi run on one each. Every subscription has its own home folder on disk.
- THE FLEET · Every subscription runs many sessions One Claude account can run 25 or 30 sessions at the same time, and every session can spawn subagents. Across five subscriptions, fifty or more agents live on one laptop on an ordinary day.
- RULE ZERO · One launch folder Every session, for every agent and every subscription, starts in ~/Projects or a folder below it. A session that starts anywhere else is stopped before it does any work.
- READ-FIRST · A door for every agent Each agent looks for instructions under its own file name and in its own way. Every level where an agent can start therefore needs a door that agent recognises.
- READ-FIRST · Every door leads to one READ-FIRST Doors are pointers and symlinks, never copies. Whichever file an agent opens, it arrives at the same short list of must-reads: the deploy process and the knowledge process.
- WHAT IS SHARED · Shared artifacts are the shared brain Agents don't share notes. They share files: rules, decisions, gotchas and session handoffs, all in one git-tracked folder (the tracker itself is Linear) that every agent can read and write.
- WHAT IS NOT SHARED · Private notes stay private Each agent keeps its own notes, or none. Claude's are pinned to one folder used by both Claude accounts and every session. Gemini keeps a global notes file. Codex ships a memories feature that is unused here; Kimi has none.
- GAP → FIXED · The gap, and the fix Kimi reads AGENTS.md only in the exact folder it starts in, and 21 of the 27 repos had none: a Kimi session there got no rules. Gemini had no GEMINI.md anywhere. 36 doors later, every level has one, and Kimi was verified reading them.
lit = this step · dots = sessions reading · dashed = a gap · tap a box · ← → or Play · Interactive version in the original post
The rest of this post takes the picture apart: the files each agent actually reads, what "memory" means for an agent, how one wrong folder split it, the rules that prevent it, how each agent finds those rules from wherever it starts, and the build that tests all of it.
The files each agent actually reads
Before talking about memory, it helps to see the files. Each agent keeps a home folder in the user's home directory, and inside it the same handful of things show up under different names: a login, settings, instruction files, skills, notes and session history. Only one row of the picture below is shared between agents.
Five homes, six kinds of file, one shared row
- HOME FOLDERS · One home folder per subscription Every subscription lives in its own folder under the home directory. The two Claude seats are the same program pointed at two folders: the second one is started with CLAUDE_CONFIG_DIR set to its own home.
- LOGIN · Logins stay private Each home holds its own login: the work and personal Claude accounts in the macOS keychain, Codex in auth.json, Kimi in credentials/, Gemini in oauth_creds.json. These are never symlinked and never committed.
- SETTINGS · Settings decide behaviour Settings hold hooks, permissions and paths. Claude has one real settings.json; the second Claude home links to it, so both seats get the same launch hook and the same notes pin. Gemini's settings tell it to read AGENTS.md as well as GEMINI.md.
- INSTRUCTIONS · Instruction files are the rules CLAUDE.md, AGENTS.md and GEMINI.md are the same idea under three names: plain Markdown rules written by people, kept in git, and loaded into every session before the first prompt. They tell the agent what to do. The agent does not write them.
- SKILLS · Skills are procedures, linked from one library A skill is a folder with a SKILL.md that says how to do one job: close a session, write a handoff, ship a release. One repository holds the library; the agents' skills/ folders hold symlinks into it, so an edit reaches every linked agent at once.
- NOTES · Notes are what the agent writes for itself Notes are the opposite of instructions: the agent writes them, for its own next session. For Claude this is a memory folder with an index, MEMORY.md, whose first part loads at every start, and topic files it opens when needed. Nobody else reads them.
- SHARED · Only one row is shared Every row above is per agent. The bottom row is plain files in git under ~/Projects/_common, and every instruction file points at it. That is the only place all five agents read and write the same thing.
lit = this step · dashed = missing or unused · tap a box · ← → or Play · Interactive version in the original post
On disk, the shared part looks like this. Arrows are symlinks:
~/Projects/
├── CLAUDE.md workspace rules; imports _common
├── AGENTS.md → CLAUDE.md same text, other agents
├── READ-FIRST.md → _common/docs/READ-FIRST.md
├── _common/
│ ├── CLAUDE.md the cross-agent rulebook
│ ├── AGENTS.md → CLAUDE.md
│ ├── docs/READ-FIRST.md the one real copy
│ ├── docs/next-session-handoff/
│ └── blogs/ this post
└── <project>/<repo>/
├── CLAUDE.md repo rules + READ-FIRST banner
├── AGENTS.md door for Codex, Kimi, Gemini
└── READ-FIRST.md → ../../_common/docs/READ-FIRST.md
CLAUDE.md versus MEMORY.md
They are easy to confuse because both load at the start of a session. CLAUDE.md is instructions: written by people, kept in git, the same for every session that starts below it. MEMORY.md is notes: written by the agent, kept outside git in Claude's home, read only by Claude. A rule belongs in CLAUDE.md or the shared rulebook. A note is at most a pointer to it.
Four kinds of "memory"
The word memory hides four different things, and mixing them up is where most confusion starts.
Four kinds of memory, and which one is shared
- KIND 1 · Context is the only real cache The context window is what the model is looking at right now: the conversation, the files it read, the instructions it loaded. It is fast, private and gone when the session ends. Every agent has one; none of them shares it.
- KIND 2 · Session history is a log, not knowledge Every agent saves transcripts so a session can be resumed. They are durable but raw, and they are not loaded into new sessions. Claude and Kimi file them by start folder; Codex by date; Gemini by project.
- KIND 3 · Agent notes are durable, but private Some agents keep curated notes that load at the start of every session. That is the part usually called memory. It persists, but each agent's notes are its own: no other agent reads them.
- KIND 4 · The shared record is what every agent reads The fourth kind is plain files in git: rules, decisions, gotchas and handoffs in ~/Projects/_common/docs (the tracker is Linear). Every agent reads it through its door, and every agent writes to it.
- HOW THEY CONNECT · Notes are a cache of the record Agent notes hold pointers and working facts. Anything another agent would need is lifted into the shared record at the end of a session, and the note keeps a one-line pointer. The record is the source; notes are a convenience.
lit = this step · tap a box · ← → or Play · Interactive version in the original post
To be precise about the second and third kinds for Claude Code: the notes folder (MEMORY.md plus topic files) is the part pinned to one location. The transcripts that let a session be resumed still live under a folder named after the start folder, which is one more reason to start every session in the same place.
How a wrong folder became a split memory
For five weeks, the agents disagreed about the facts, and none of them knew it. Some sessions knew a workstream had shipped; others still thought it was open. A rule given in one session ("ship to production by default", "name commits this way") was absent in the next. Each session was internally consistent. The notes had split in two, and each half looked complete.
The cause was small: the folder the terminal opened in.
How a wrong folder became a split memory
- THE INCIDENT · Two ways to start a session Terminals opened in the home folder. Most of the time a cd ~/Projects came first. Over five weeks, 32 of 168 sessions skipped it.
- THE INCIDENT · Two start folders, two notes folders Claude Code names its notes folder after the start folder. Same agent, same account, two different notes folders, and nothing warned anyone.
- THE INCIDENT · 26 notes no other session could see Home-folder sessions wrote 26 notes that existed only in the hidden folder: the state of three workstreams, the commit-naming rule, the default deploy path and a handful of references.
- WHY IT COMPOUNDS · Small leak, big loss If a share p of sessions starts in the wrong place, the next session sees the last one's notes only when both started in the same place: P(visible) = p² + (1 − p)².
- WHY IT COMPOUNDS · The right folder was too long, too The correct notes index had grown to 606 lines. Only about the first 150 load at the start of a session, so most of the right notes were invisible as well.
- THE FIX · The fix: pin it One setting, autoMemoryDirectory, now points every Claude session, from any folder and any account, at one notes folder. The old home folder was merged in, backed up and replaced by a locked stub.
lit = this step · dots = notes being written · tap a box · ← → or Play · Interactive version in the original post
The arithmetic is worth a second look. With p=32/168≈0.19p = 32/168 \approx 0.19p=32/168≈0.19:
P(visible)=p2+(1−p)2≈0.192+0.812≈0.69.P(\text{visible}) = p^2 + (1-p)^2 \approx 0.19^2 + 0.81^2 \approx 0.69 .P(visible)=p2+(1−p)2≈0.192+0.812≈0.69.
About three notes in ten written in a session were invisible to whichever session came next. The model treats sessions as independent coin flips, which they are not, but the shape holds: a split costs more than the raw miss rate suggests, and nothing fails loudly.
The lesson
Whatever picks the notes folder has to be controlled, not merely encouraged. The home-folder notes had been "retired" weeks earlier with a DEPRECATED marker file. A marker is advice, and agents don't read advice in files they never open.
Each agent loads context differently
The deeper reason is that every agent finds its instructions, history and notes in its own way:
| Claude Code | Codex CLI | Kimi Code | Gemini / Antigravity | |
|---|---|---|---|---|
| Instruction files |
CLAUDE.md in the start folder and every parent, plus @ imports |
AGENTS.md from the repo root down, plus ~/.codex/AGENTS.md
|
AGENTS.md in the start folder only |
GEMINI.md up to the repo root, plus ~/.gemini/GEMINI.md; AGENTS.md once configured |
| Session history | per start folder | per date | per start folder | per project |
| Curated notes |
MEMORY.md + topic files: per start folder unless pinned |
memories feature (unused here) | none | global GEMINI.md
|
| Skills | symlinked from one library | symlinked from one library | none then (filled since) | none then (filled since) |
| Hooks | yes | no | no | yes (Gemini CLI) |
| Launch guard used | hook + notes pin | PATH stand-in | PATH stand-in | PATH stand-in |
Three consequences shaped everything that follows. The start folder is load-bearing for every agent. Parent folders leak: Claude reads ~/CLAUDE.md from inside ~/Projects too, so anything placed there must be conditional. And an agent without hooks can only be stopped before it starts, by the shell or by a stand-in first on PATH.
One more fact turned up while testing: the Gemini CLI now refuses individual accounts outright, with "This client is no longer supported for Gemini Code Assist for individuals… migrate to the Antigravity suite". For personal subscriptions, Gemini's coding agent is the Antigravity CLI (agy), and it gets the same guard.
Six guarantees
The goal fits in six sentences. Each one is made true by a specific file or setting, not by good intentions.
Six guarantees and what enforces each one
- GUARANTEE 1 · One launch point No session for any agent works in a folder outside ~/Projects. Five independent layers enforce it, from a shell default to a hook that rejects every prompt.
- GUARANTEE 2 · One Claude notes folder Exactly one Claude notes folder receives writes, whatever the start folder and whichever Claude account is running.
- GUARANTEE 3 · One rulebook Every agent's entry file, at every level, leads to the same READ-FIRST and the same rulebook in ~/Projects/_common.
- GUARANTEE 4 · Small enough to load Notes that don't load don't exist. The notes index stays under 150 lines of pointers; detail lives in topic files.
- GUARANTEE 5 · Durable facts are shared facts Anything Codex, Kimi or Gemini would need lives in the shared record, not only in Claude's notes. Handoffs are written straight into it.
- GUARANTEE 6 · One copy of shared content Shared material is written once in _common and surfaced wherever it is needed. This post is an example: it lives in _common/blogs and the blog reads it from there.
lit = this step · tap a box · ← → or Play · Interactive version in the original post
None of this is clever. Every item is something a tired person would agree with late at night, and none of them was true until it was enforced.
Five layers, cheapest first
The launch point is enforced by five independent layers. The diagram follows one session started in the wrong folder through all of them, and shows which agents each layer covers.
A session starts in the wrong folder
- START · The mistake A new terminal tab opens in the home folder, or a session is started from Dropbox or /tmp out of habit. Nothing about the agent itself prevents this.
- LAYER 1 · 1 · The shell moves it One line in ~/.zshrc: an interactive shell that opens in ~, /Users or / moves to ~/Projects. Scripts are untouched, so nothing automated changes folder unexpectedly.
- LAYER 2 · 2 · The agent command moves it claude, codex, kimi, gemini and agy are small shell functions: typed anywhere outside ~/Projects, they move there first and then start the real agent.
- LAYER 2B · 2b · Stand-ins refuse to start Agents without a usable hook get a tiny stand-in first on PATH. It checks the real folder and either runs the agent or prints WRONG FOLDER and exits.
- LAYER 3 · 3 · The hook blocks every prompt A short script runs when a Claude session starts and on every prompt. Outside ~/Projects it rejects the prompt before the model sees it, so the session can't do any work until it restarts in the right place.
- LAYER 4 · 4 · Locked notes say stop ~/CLAUDE.md and ~/AGENTS.md say, conditionally, that a session started exactly in the home folder must do no work. They are locked with macOS immutable flags, so no agent can edit or delete them.
- LAYER 5 · 5 · The notes pin holds anyway Even if every layer above failed, autoMemoryDirectory keeps every Claude session on one notes folder. The split can't come back.
- RESULT · The session runs where it should The session ends up in ~/Projects, where every door leads to the same READ-FIRST and Claude writes to the one notes folder.
lit = this step · dots = the session moving through the layers · tap a box · ← → or Play · Interactive version in the original post
Walking the levels: READ-FIRST under every folder
Launching in the right place is half of it. The other half is that an agent finds the rules from whichever folder below ~/Projects it starts in. The folder tree has six levels, and each agent reads them differently. The real example here is a session started in one repo, hypothesys-ai-app.
Six levels, four agents, one READ-FIRST
- THE TREE · Six levels Home, the agents' own global folders, the workspace, the shared folder, a project (a folder of related repos) and a repo. A session can start in any of the bottom four.
- CLAUDE · Claude: walks up every parent Started in the repo, Claude reads the repo's CLAUDE.md and then every parent's, reaching the workspace CLAUDE.md, which imports the shared rulebook. It never needed a new door.
- CODEX · Codex: repo root down, plus a global file Codex reads AGENTS.md from the repo root down to the start folder, and its own global ~/.codex/AGENTS.md, which already pointed at the shared rulebook. Codex was covered; the new repo door adds the repo's own context.
- KIMI · GAP · Kimi: the start folder only Kimi reads AGENTS.md in the exact folder it starts in and nowhere else: no parents, no global file. 21 of the 27 repos had none, so a Kimi session there started with no rules at all.
- KIMI · FIXED · Kimi: fixed with a door Every repo now has an AGENTS.md door that points at READ-FIRST and the rulebook. A Kimi session started in hypothesys-ai-app was asked what it loaded, and named the door and READ-FIRST.
- GEMINI · FIXED · Gemini: global note + AGENTS.md Gemini had no GEMINI.md anywhere. It now has a global note, and its settings make it read AGENTS.md as well, so the same repo doors serve it.
- PROJECT LEVEL · Project folders get a door too A session can also start in a project folder such as hypothesys-ai/, which is not a repo. Each project folder now has its own AGENTS.md and READ-FIRST link.
- RESULT · Every path ends at one READ-FIRST Four agents, four ways of reading, one destination. Editing READ-FIRST once changes what every agent reads, from every folder, on every subscription.
lit = what this agent reads · dashed = what was missing · tap a box · ← → or Play · Interactive version in the original post
Handoffs: the record that any session can resume from
Sessions end, and the next one may be a different subscription, a different agent, or the next morning. Closing a session is therefore a ritual rather than a hope:
-
last-callsweeps loose ends, checks the docs, reconciles Linear with what git shows actually shipped, audits the doors, and scores readiness by counting checklist rows. -
next-session-handoffwrites a paste-ready opening message for the next session: where things stand, the single next action, branch state derived from git, what is done and how to verify it, what is blocked, what not to touch, and the commands to resume. -
where-are-weopens the next session: it reads Linear, the latest handoff and every repo's recent commits, and names the thread to pick up.
The design choice that matters is where the handoff lands: in _common/docs/next-session-handoff/, in git, readable by every agent. Claude's notes folder only holds a link to it.
Many sessions at once, without collisions
Parallel sessions add two problems: getting the same skills to every agent, and keeping parallel workers out of each other's files.
Skills are written once and linked everywhere. One repository holds the skills library. A sync script reads each skill's frontmatter and symlinks it into the agents' homes: today that is both Claude homes (through one shared skills/ folder) and the Codex home. Kimi's and Gemini's skills/ folders are still empty; filling them is part of the build below. A git hook reruns the sync after any pull that touches skills.
Parallel work gets fences:
- each worker gets its own git worktree, so no two agents edit the same checkout;
- each shared contract (schema, migrations, lockfile, shared types) has exactly one owning worker;
- the shared foundation lands first, then workers go in waves;
- workers record assumptions in a file instead of stopping to ask, and reviews are tied to an exact commit;
- fan-out is bounded: a hard ceiling on concurrent workers, timeouts, capped retries, and a resource check before dispatch. An unbounded fan-out can take down the laptop it runs on; the machine is the real concurrency limit, not the token budget.
Roadmap: cross-agent active memory
Everything above shares knowledge: files that change slowly and are read at the start of a session. What is not shared yet is active memory: what each session is doing right now, what it has claimed, and what it just learned. (Update: the first step shipped in One Roof 1.9.35, a factual brief every new session gets about what the others are doing; see Chorus coding.)
From shared files to shared live state
- TODAY · Today: a shared record, private notes Durable knowledge is shared through files in git. Each agent keeps private notes as a cache, and anything durable is lifted into the record at session close.
- NEXT · Next: an agent-neutral notes folder A _common/memory/ folder with small, structured notes in one format for every agent, read through READ-FIRST. Agents whose notes can be pointed at a folder are pointed there; the others are seeded from it.
- LATER · Later: live shared state With thirty sessions running at once, sessions need to know what the others are doing: who is working on what, which files are claimed, what was just learned. That is a small shared service with tools every agent can call.
lit = this stage · dashed = not built · tap a box · ← → or Play · Interactive version in the original post
Key takeaways
- The start folder is load-bearing. It decides which rules every agent loads and, for Claude, which notes folder it writes to. One launch folder, enforced in layers, removes a whole class of silent drift.
- Block, don't warn. A marker file or a polite note is advice. A hook that rejects prompts, or a stand-in that refuses to start, is a control.
- Every agent needs a door at every level. Agents read instructions under different names and from different folders. Doors are pointers, never copies, and a check fails when one is missing.
- One READ-FIRST, kept short. One must-read list, one copy, reachable from every door. Everything else lives in a folder for its type.
- "Memory" is four things. Context is the cache, transcripts are a log, agent notes are private, and the shared record in git is the only thing every agent sees. Durable knowledge belongs in the record.
- Pin what can be pinned. Claude's notes folder is pinned with one setting; the guards make sure the pin rarely has to matter.
- Handoffs belong in git, in a format a different agent can act on cold.
- Bound the fan-out. Separate worktrees, one owner per shared file, a ceiling on parallel workers. The laptop is the limit.
None of this needs a framework. Most of it is a few lines of shell and a handful of small files.
What is still open
- Agents with neither hooks nor a command-line entry (some editor-embedded agents) are covered only by the shell layer.
- Cloud sessions have no local notes; they stay consistent only through the shared record in git.
- A second machine needs the same setup reapplied.
- Two seats of the same agent share settings, skills and notes by design; only the logins differ. Whether that is right for a work and a personal account is one of the things the build will show.
- New agents with their own notes, such as Hermes or OpenClaw, add another private store. The rule for adding any agent is the same: it reads the shared record through a door, and its notes either point at the shared layer or hold nothing durable.
The build: five agents, one real task
Everything above was in place at the time of writing, with three gaps found while writing this post (all three closed since): the Antigravity CLI is not installed yet (only its launch guard is), Kimi's and Gemini's skills/ folders are empty, and the second Claude seat's home still has to be checked against its account. The build closes those gaps and then puts all five agents to work on one task.
From set-up to a shared task
- PHASE 1 · 1 · Inventory Map each of the five seats to its home folder, its login and its plan. Any home that is not in the table is either removed or explained.
- PHASE 2 · 2 · Set up each agent Log in each seat, start it from ~/Projects, confirm the guard stops it anywhere else, link the skills library into Kimi and Gemini, and ask each one which instruction files and notes it loaded.
- PHASE 3 · 3 · One real task Split one small, real piece of work across the five. Each agent works in its own git worktree, lands through the same one-at-a-time script, and hands off through the shared record. What each agent saw and missed is written down.
- PHASE 4 · 4 · Publish together The findings go into this post, the kit is updated to match what actually worked, and the two are published on the same day.
lit = this phase · dashed = not done yet · tap a box · ← → or Play · Interactive version in the original post
The kit
All of this is packaged as an installable repository, oneroof: the launch guard, the notes pin, the rulebook template, the doors, the handoff skills, the skills sync and a bounded worker runner, with an install command, a doctor command and tests that run in a throwaway home folder. It is public: github.com/gaurav8936/oneroof, with signed builds on its releases page and an overview at gaurav8936.github.io/oneroof. More of my public work is at gaurav8936.github.io and github.com/gaurav8936.
The least glamorous lesson is the most important one. Before giving a fleet of agents more autonomy, more tools or more memory, make sure every one of them starts in the same place and can find the same one file.
Links
- One Roof (the kit and the IDE): project page and download · source · releases
- Me: gaurav8936.github.io (portfolio) · github.com/gaurav8936 (all my public repositories)
- The next post: One Roof builds One Roof: 48 hours of a self-hosting dev loop
Originally published at https://agentair.ai/blog/one-workspace.
Top comments (0)