Symptom
Files under ~/.claude/agent-memory/<agent-name>/ (e.g. pact-secretary/session_processed_tasks.md) are user-scope single-file with no session or team isolation. When two PACT sessions run concurrently — e.g. one secretary on team A working on project X, another secretary on team B working on project Y — both write to the same path with last-writer-wins overwrites.
Observed: a PACT-prompt secretary (team pact-7642b0c9, project actor-discriminator bundle PR #808) overwrote a reflectica/webapp-frontend secretary's (team pact-3655e8cc) session_processed_tasks.md mid-cycle. The reflectica secretary discovered the overwrite during its #31 harvest when its own processed-tasks baseline was unrecognizably replaced with content describing a different project's tasks.
Impact
For the processed-tasks log specifically: the harvest skill's Step 8 says "overwrite, not append" — which is correct WITHIN a session but breaks across concurrent sessions because the dedup baseline gets silently replaced. The reflectica secretary recovered by:
- Falling back to the independent dedup signal (session-journal
agent_handoff events + own conversation history)
- Rewriting the log with team-namespacing to prevent recurrence within the same path
The team-namespaced format groups entries by team_id and is forward-compatible: each concurrent secretary writes under its own team section, no overwrite collision.
For other agent-memory files (feedback memos, MEMORY.md, etc.): the same collision class exists but the symptom is subtler — same-named feedback memos accumulate cross-session learning interleaved without team attribution.
Suggested fix
Two options (either resolves the failure mode):
-
Session/team isolation: change path from ~/.claude/agent-memory/<agent>/<file> to ~/.claude/agent-memory/<agent>/<team_id>/<file> (or include session_id). Backward-incompatible.
-
Single-file team-namespacing convention: keep the single-file path but require agents to write entries under team-scoped sections (e.g. ## team=<team_id> headers). The reflectica secretary applied this as a session workaround; promoting to a documented convention prevents recurrence.
(2) is the cheaper fix and doesn't require migrating existing agent-memory content. The PACT secretary skill could be updated to read/write the team-namespaced format with backward-compatible behavior (treat unnamespaced content as legacy/team-unknown).
Cross-references
Symptom
Files under
~/.claude/agent-memory/<agent-name>/(e.g.pact-secretary/session_processed_tasks.md) are user-scope single-file with no session or team isolation. When two PACT sessions run concurrently — e.g. one secretary on team A working on project X, another secretary on team B working on project Y — both write to the same path with last-writer-wins overwrites.Observed: a PACT-prompt secretary (team
pact-7642b0c9, project actor-discriminator bundle PR #808) overwrote a reflectica/webapp-frontend secretary's (teampact-3655e8cc)session_processed_tasks.mdmid-cycle. The reflectica secretary discovered the overwrite during its #31 harvest when its own processed-tasks baseline was unrecognizably replaced with content describing a different project's tasks.Impact
For the processed-tasks log specifically: the harvest skill's Step 8 says "overwrite, not append" — which is correct WITHIN a session but breaks across concurrent sessions because the dedup baseline gets silently replaced. The reflectica secretary recovered by:
agent_handoffevents + own conversation history)The team-namespaced format groups entries by
team_idand is forward-compatible: each concurrent secretary writes under its own team section, no overwrite collision.For other agent-memory files (feedback memos, MEMORY.md, etc.): the same collision class exists but the symptom is subtler — same-named feedback memos accumulate cross-session learning interleaved without team attribution.
Suggested fix
Two options (either resolves the failure mode):
Session/team isolation: change path from
~/.claude/agent-memory/<agent>/<file>to~/.claude/agent-memory/<agent>/<team_id>/<file>(or include session_id). Backward-incompatible.Single-file team-namespacing convention: keep the single-file path but require agents to write entries under team-scoped sections (e.g.
## team=<team_id>headers). The reflectica secretary applied this as a session workaround; promoting to a documented convention prevents recurrence.(2) is the cheaper fix and doesn't require migrating existing agent-memory content. The PACT secretary skill could be updated to read/write the team-namespaced format with backward-compatible behavior (treat unnamespaced content as legacy/team-unknown).
Cross-references
18ca924b(webapp-frontend feat: implement Agent Teams executor backend with hook integration #158 organizational state snapshot —agent_memory_cross_session_collisionpattern entity)session_processed_tasks.mdas a working example of the suggested convention