claude-code - 💡(How to fix) Fix [BUG] `memory:` field in subagent frontmatter not functional — reproduces on v2.1.137; tools allowlist appears to override auto-enable

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…

Root Cause

The persistent-memory feature shipped in v2.1.33 (Feb 2026) and is positioned as a primary value-add for subagent system design. Multiple users (including those producing 50+ daily invocations against memory-configured agents) cannot use it. Auto-closing as inactive doesn't reflect actual usage state — it reflects that frustrated users moved on to workarounds (external KB, manual file management).

Fix Action

Fix / Workaround

A plausible prompt-engineering contributor to this subpattern: dev-lead's memory section has elaborate Curate criteria ("Append only when X, Y, Z fires") that, combined with Opus 4.7's more-literal interpretation, may cause the agent to self-censor every potential write. Working agents (tdd-test-writer, docs-updater) have brief 2-line permissive memory sections. Need to test by simplifying the broken agents' memory sections — but this is a workaround, not a fix.

The persistent-memory feature shipped in v2.1.33 (Feb 2026) and is positioned as a primary value-add for subagent system design. Multiple users (including those producing 50+ daily invocations against memory-configured agents) cannot use it. Auto-closing as inactive doesn't reflect actual usage state — it reflects that frustrated users moved on to workarounds (external KB, manual file management).

  1. Re-open #31294 or treat this as a fresh report
  2. Confirm whether explicit tools: allowlist is intended to override memory: auto-enable (doc clarification needed regardless)
  3. Investigate why Task()-spawned Opus subagents with proper tool access don't create MEMORY.md
  4. Provide an officially-supported workaround until the root cause is fixed
RAW_BUFFERClick to expand / collapse

[BUG] memory: field in subagent frontmatter not functional — reproduces on v2.1.137; tools allowlist appears to override auto-enable

Re-reporting the bug from #31294 (closed-as-inactive 2026-04-11 by github-actions bot, not because it was fixed). Reporter (@Mationetap) explicitly rejected the bot's suggested duplicates as not relevant. @gvelesandro is collecting reports of the same pattern at https://www.agentsneedcontext.com/agent-failure-postmortem.

This issue adds a new finding from a 5-agent reproduction: the explicit tools: allowlist appears to take precedence over the documented "memory: auto-enables Read/Write/Edit" behavior, which may be one of the mechanisms behind the bug.

Environment

  • Claude Code: v2.1.137 (current)
  • macOS Darwin 25.4.0
  • 5 user-defined subagents with memory: configured (mix of user and project scopes)

Reproduction

5 subagents in ~/.claude/agents/, all with memory: field:

Agentmodelmemory:Has Write/Edit in tools:MEMORY.md created?
tdd-test-writersonnetuser✅ explicit✅ yes (multiple files, recent activity)
docs-updatersonnetuser✅ explicit✅ yes (multiple files)
dev-leadopususer✅ explicit❌ empty after 5+ invocations in 3 days
design-leadopususer❌ NOT in explicit tools:❌ empty
code-revieweropusproject❌ NOT in explicit tools:❌ empty (no project dirs created across 5 projects)

Telemetry shows 50+ invocations across these agents in the last 3 days with status:completed and no errors.

Two distinct subpatterns visible

Subpattern A — explicit tools: allowlist excludes Write/Edit (code-reviewer, design-lead)

Per the Anthropic subagent docs: "Read, Write, and Edit tools are automatically enabled so the subagent can manage its memory files."

This phrasing implies the auto-enable is additive. But agents whose explicit tools: allowlist excludes Write, Edit show no memory file creation. Suggests the allowlist takes precedence over the auto-enable, contradicting the documented behavior.

Test: I just added Write, Edit to the tools: field of code-reviewer and design-lead. Will report back whether memory accumulates after the next invocation.

Subpattern B — has Write/Edit but still doesn't write (dev-lead)

dev-lead has Read, Edit, Write, Glob, Grep, Bash, Agent in tools: and memory: user configured. Despite multiple invocations in the last 3 days (architecture reviews, multi-transport refactor, iOS popup), the directory ~/.claude/agent-memory/dev-lead/ remains empty. No MEMORY.md was ever created.

This matches the bug as @Mationetap originally reported it: the memory infrastructure simply doesn't activate for Task()-spawned subagents.

A plausible prompt-engineering contributor to this subpattern: dev-lead's memory section has elaborate Curate criteria ("Append only when X, Y, Z fires") that, combined with Opus 4.7's more-literal interpretation, may cause the agent to self-censor every potential write. Working agents (tdd-test-writer, docs-updater) have brief 2-line permissive memory sections. Need to test by simplifying the broken agents' memory sections — but this is a workaround, not a fix.

Why this matters

The persistent-memory feature shipped in v2.1.33 (Feb 2026) and is positioned as a primary value-add for subagent system design. Multiple users (including those producing 50+ daily invocations against memory-configured agents) cannot use it. Auto-closing as inactive doesn't reflect actual usage state — it reflects that frustrated users moved on to workarounds (external KB, manual file management).

Asks

  1. Re-open #31294 or treat this as a fresh report
  2. Confirm whether explicit tools: allowlist is intended to override memory: auto-enable (doc clarification needed regardless)
  3. Investigate why Task()-spawned Opus subagents with proper tool access don't create MEMORY.md
  4. Provide an officially-supported workaround until the root cause is fixed

Workaround currently being tested

Adding Write, Edit to all explicit tools: lists for memory-enabled subagents. Will edit this issue with results in 3-5 days of usage.


Filed by a Claude Code power user with 8 subagents + 59 skills + 6 active projects. Full background research and observability data in: 2026-04-17 claude-code-subagent-design-refresh.md, 2026-05-06 agent-prompt-engineering-techniques.md (private knowledge base, willing to share excerpts on request).

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

claude-code - 💡(How to fix) Fix [BUG] `memory:` field in subagent frontmatter not functional — reproduces on v2.1.137; tools allowlist appears to override auto-enable