Agent memory path uses dash instead of dot when agent name contains dots (e.g. hammer.mei → hammer-mei)
Summary
When a subagent's name contains dots (e.g. hammer.mei), Claude Code's injected Persistent Agent Memory system prompt section uses a dash instead of a dot in the memory directory path, creating a mismatch with the actual agent name.
Environment
- Claude Code version: 2.1.121
- OS: macOS
- Agent name:
hammer.mei(defined in.claude/agents/hammer.mei.md) - Agent memory scope:
project
What Claude Code injects (actual)
Claude Code automatically appends a "Persistent Agent Memory" section to the system prompt with this path:
/Users/<username>/workspace/myproject/.claude/agent-memory/hammer-mei/
Note: hammer-mei — dot replaced with dash.
What is expected
Per the official docs, the path should be:
.claude/agent-memory/<name-of-agent>/
Which for agent hammer.mei should be:
/Users/<username>/workspace/myproject/.claude/agent-memory/hammer.mei/
Impact
This creates two problems:
- Empty orphan directory: Claude Code creates
.claude/agent-memory/hammer-mei/(empty), while the real memory lives at.claude/agent-memory/hammer.mei/(a symlink with actual content). - Claude reads the wrong location: The injected system prompt points Claude to the empty
hammer-mei/directory, so it cannot access its existing memories.
Directory state
.claude/agent-memory/
├── hammer-mei/ ← empty directory, created by Claude Code (WRONG)
└── hammer.mei -> /Users/<username>/.tamago/hammer.mei-profile/agents/memory/hammer.mei/
← symlink to actual memory with 30+ memory files (CORRECT)
Observed behavior change
- v2.1.119: No
Persistent Agent Memorysection was injected into the system prompt (agent memory worked correctly via the agent's own system prompt) - v2.1.121: The section is now injected with the incorrect
hammer-meipath
There is no changelog entry between 2.1.119 and 2.1.121 that documents this change or the dot→dash conversion rule.
Documentation gap
The official docs at https://code.claude.com/docs/en/sub-agents state the path is .claude/agent-memory/<name-of-agent>/ but do not document any name normalization rules (e.g. replacing . with -). If this conversion is intentional, it should be documented.
Possible fixes
- If intentional: Document the dot→dash normalization rule clearly in the docs
- If a bug: Use the agent name verbatim (preserving dots) for the memory directory path, so
hammer.meimaps to.claude/agent-memory/hammer.mei/
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗