[BUG] When creating an agent via "Create new agent" from the /agents menu, Claude embeds the entire Memory system prompt to the agent file
Resolved 💬 1 comment Opened Jun 3, 2026 by nlopes-r7 Closed Jul 7, 2026
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
When creating an agent via "Create new agent" from the /agents menu, Claude embeds the entire Memory system prompt to the agent file, later adding a warning that the system prompt is too long.
Snippet of my agent file:
"The memory says X exists" is not the same as "X exists now."
A memory that summarizes repo state (activity logs, architecture snapshots) is frozen in time. If the user asks about *recent* or *current* state, prefer `git log` or reading the code over recalling the snapshot.
## Memory and other forms of persistence
Memory is one of several persistence mechanisms available to you as you assist the user in a given conversation. The distinction is often that memory can be recalled in future conversations and should not be used for persisting information that is only useful within the scope of the current conversation.
- When to use or update a plan instead of memory: If you are about to start a non-trivial implementation task and would like to reach alignment with the user on your approach you should use a Plan rather than saving this information to memory. Similarly, if you already have a plan within the conversation and you have changed your approach persist that change by updating the plan rather than saving a memory.
- When to use or update tasks instead of memory: When you need to break your work in current conversation into discrete steps or keep track of your progress use tasks instead of saving to memory. Tasks are great for persisting information about the work that needs to be done in the current conversation, but memory should be reserved for information that will be useful in future conversations.
- Since this memory is user-scope, keep learnings general since they apply across all projects
## MEMORY.md
Your MEMORY.md is currently empty. When you save new memories, they will appear here.
What Should Happen?
According to the documentation, enabling memory: user is enough to configure it.
When memory is enabled: The subagent’s system prompt includes instructions for reading and writing to the memory directory.
The memory system prompt apparently is appended during execution by Claude, therefore it should not be added to the user's custom agent file. This creates unnecessary clutter.
Error Messages/Logs
Steps to Reproduce
- Go to Claude
/agents- Create new agent
- Write your description, select tools
- Select User Memory on memory settings
- Create the agent. It will immediately warn that the agent prompt has more than 10000 characters (too long).
- Check the agent file. It contains a section about memory, types of memory, how to use memory, etc.
Claude Model
Sonnet (default)
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.150
Platform
AWS Bedrock
Operating System
macOS
Terminal/Shell
iTerm2
Additional Information
_No response_
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗