Expand description
Is a memory directory this agent’s alone? (SPEC_MEMORY_FOLLOWS_THE_AGENT_2026_09_24.md §2.1.2, phase M3b.)
A Claude memory directory is keyed by account + working directory, not by agent, so two agents can share one — the same account and working directory, or two unlinked agents with the same working directory. The memory record may project into, capture from, or delete in a directory only when it is proven exclusive; a shared one is left exactly as it is.
A directory is shared unless proven exclusive:
- Known shared locations — a blank working directory (the
~/.agentmux/agents/<slug>default, shared across same-name tabs),$HOME, or an ancestor of another agent’s working directory. And any folder the CLI keys by a whole repository rather than this working directory alone: a subdirectory or linked worktree of a repository, or a main checkout with linked worktrees (crate::backend::claude_layout::memory_project_root). - Vetoes — any other agent whose directory resolves, by any route, to the same canonical directory. Guesses count here (a veto only ever removes a directory; the resolver never uses one to find memory).
- A machine-wide claim — zone
memory-dir:<hash>in the global store. Every spawn that uses the folder records one, a shared one too: channels shareprojects/folders, and an agent in another channel is visible here only through its claim. A claim by another UID makes the folder shared. A claim is released only by the channel store that wrote it, once that store no longer has the agent and no active shared definition does — another channel can’t tell a live agent of its neighbour’s from a deleted one.