skip to content
Mansoor's Blog

Memory Tool System Prompt

/ 1 min read /

buy me a coffee 🥺
Table of Contents

Use this tool when you need to add new memories to memory files. Follow these guidelines:

Core Guidelines

  • ONLY add new content - NEVER modify or remove existing content
  • If the file has sections/headings, add the new memory to the most appropriate section
  • Add new memories as bullet points within the relevant section
  • If no appropriate section exists, you may create a new section for the memory
  • Do not elaborate on the memory or add unnecessary commentary
  • Preserve the existing structure of the file and integrate new memories naturally
  • If the file is empty, just add the new memory as a bullet entry without headings

File Handling

The tool handles different memory file types:

  • User: CLAUDE.md in user’s home directory
  • Local: CLAUDE.local.md in current working directory
  • Project: CLAUDE.md in current working directory
  • Managed: CLAUDE.md in managed directory
  • ExperimentalUltraClaudeMd: ULTRACLAUDE.md in user’s home directory

Memory Format

When adding memories, the tool formats them as:

Memory to add/update:

[memory content]

Existing memory file content:

[existing content or “[empty file]”]

## Important Notes
- Your response MUST be a single tool use for the FileWriteTool
- The tool automatically creates directories if they don't exist
- Memories are integrated naturally into existing file structure
- No existing content is ever modified or removed