Private Tags
Overview
Use<private> tags to mark content you don’t want persisted in claude-mem’s observation database. This gives you fine-grained control over what gets remembered across sessions.
How It Works
Wrap any content in<private> tags:
Use Cases
1. Sensitive Information
2. Temporary Context
3. Debugging Information
4. Exploratory Prompts
Technical Details
Tag Behavior
- Multiline support: Tags can wrap multiple lines of content
- Multiple tags: You can use multiple
<private>sections in one message - Nested tags: Inner tags are included in outer tag removal
- Always active: No configuration needed - works automatically
What Gets Filtered
The<private> tag filters content from storage and memory:
- User prompt storage - Tags are stripped before saving to the user_prompts table
- Tool inputs - Parameters passed to tools are filtered before observation creation
- Tool responses - Output from tools is filtered before observation creation
- All searchable content - Private content never reaches the database or search indices
<private> tags during the session, and they only disappear when content is persisted to the database.
What Doesn’t Get Filtered
- Session summaries (generated from non-private observations only)
- Claude’s responses (not captured by claude-mem)
Examples
Example 1: API Keys
Example 2: Personal Notes
Best Practices
- Don’t over-tag: Only use
<private>for content you genuinely don’t want stored - Context matters: Claude’s understanding of your project comes from observations - excessive private tagging reduces future context quality
- Secrets belong elsewhere: While
<private>prevents storage, sensitive data should still use proper secrets management - Test it works: Check
~/.claude-mem/silent.logif you’re unsure whether tags are being stripped
Verification
To verify tags are working:- Submit a prompt with
<private>tags - Check the database to ensure private content is not stored:
- The private content should NOT appear in either user_prompts or observations
- The
<private>tags themselves should also be stripped
Architecture
The<private> tag uses an edge processing pattern:
- Content is filtered at the hook layer before any storage
- UserPromptSubmit hook: Strips tags from user prompts before saving to the user_prompts table (your typed prompts are cleaned before database storage)
- PostToolUse hook: Strips tags from serialized tool_input and tool_response JSON before observation creation
- Filtering happens before data reaches the worker service or database
- This keeps the worker simple and follows a one-way data stream
- Tags remain visible in the live conversation but are stripped from all persistent storage
Related Features
- Search Tools - How to search past observations
- Getting Started - Basic usage guide
- Configuration - System settings and environment variables
Troubleshooting
Tags Not Being Stripped
- Verify correct syntax:
<private>content</private> - Check
~/.claude-mem/silent.logfor errors - Ensure worker is running:
npm run worker:status - Restart worker:
npm run worker:restart
Partial Content Stored
If content appears partially in observations:- Ensure tags are properly closed
- Check for typos in tag names
- Verify content is inside tool executions (not just in your prompt text)
Silent Log Shows Errors
If you see errors in~/.claude-mem/silent.log:

