claude-code - 💡(How to fix) Fix Agent memory path uses dash instead of dot when agent name contains dots (e.g. hammer.mei → hammer-mei) [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#54208Fetched 2026-04-29 06:33:24
View on GitHub
Comments
0
Participants
1
Timeline
5
Reactions
0
Author
Participants
Timeline (top)
labeled ×4referenced ×1

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.

Root Cause

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.

Code Example

/Users/<username>/workspace/myproject/.claude/agent-memory/hammer-mei/

---

.claude/agent-memory/<name-of-agent>/

---

/Users/<username>/workspace/myproject/.claude/agent-memory/hammer.mei/

---

.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)
RAW_BUFFERClick to expand / collapse

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:

  1. 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).
  2. 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 Memory section 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-mei path

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

  1. If intentional: Document the dot→dash normalization rule clearly in the docs
  2. If a bug: Use the agent name verbatim (preserving dots) for the memory directory path, so hammer.mei maps to .claude/agent-memory/hammer.mei/

extent analysis

TL;DR

The most likely fix is to update Claude Code to use the agent name verbatim, preserving dots, for the memory directory path.

Guidance

  • Verify the issue by checking the Persistent Agent Memory section in the system prompt and the actual memory directory path for the agent.
  • Check the official documentation for any updates on name normalization rules for agent memory directory paths.
  • If the dot-to-dash conversion is intentional, document it clearly in the official docs to avoid confusion.
  • Consider reaching out to the Claude Code development team to report the issue and request a fix.

Example

No code snippet is provided as the issue is related to the behavior of the Claude Code system.

Notes

The issue seems to be specific to Claude Code version 2.1.121, and the behavior changed from version 2.1.119. There is no clear indication of whether the dot-to-dash conversion is intentional or a bug.

Recommendation

Apply a workaround by manually updating the Persistent Agent Memory section in the system prompt to use the correct memory directory path with the agent name verbatim, until the issue is officially addressed by the Claude Code development team.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING