Skill-Based Search Usage
Once claude-mem is installed as a plugin, you can search your project history using natural language. Claude automatically invokes the search skill when you ask about past work.How It Works
v5.4.0 Migration: Claude-Mem now uses a skill-based search architecture instead of MCP tools, saving ~2,250 tokens per session start through progressive disclosure. Simple Usage:- Just ask naturally: “What did we do last session?”
- Claude recognizes the intent and invokes the search skill
- The skill uses HTTP API endpoints to query your memory
- Results are formatted and presented to you
- Token Efficient: ~250 tokens (skill frontmatter) vs ~2,500 tokens (MCP tool definitions)
- Natural Language: No need to learn specific tool syntax
- Progressive Disclosure: Only loads detailed instructions when needed
- Auto-Invoked: Claude knows when to search based on your questions
Quick Reference
| Operation | Purpose |
|---|---|
| Search Observations | Full-text search across observations |
| Search Sessions | Full-text search across session summaries |
| Search Prompts | Full-text search across raw user prompts |
| By Concept | Find observations tagged with concepts |
| By File | Find observations referencing files |
| By Type | Find observations by type |
| Recent Context | Get recent session context |
| Timeline | Get unified timeline around a specific point |
| Timeline by Query | Search and get timeline context in one step |
| API Help | Get search API documentation |
Example Queries
Natural Language Queries
Search Observations:Search by File
Search by Concept
Search by Type
Recent Context
Timeline Queries
Get timeline around a specific point:- See the complete narrative arc around key events
- All record types (observations, sessions, prompts) in chronological view
- Understand what was happening before and after important changes
Search Strategy
The search skill uses a progressive disclosure pattern to efficiently retrieve information:1. Ask Naturally
Start with a natural language question:2. Claude Invokes Search Skill
Claude recognizes your intent and loads the search skill (~250 tokens for skill frontmatter).3. Skill Uses HTTP API
The skill calls the appropriate HTTP endpoint (e.g.,/api/search/observations) with the query.
4. Results Formatted
Results are formatted and presented to you, usually starting with an index/summary format.5. Deep Dive if Needed
If you need more details, ask follow-up questions:- Token Efficient: Only loads what you need, when you need it
- Natural: No syntax to learn
- Progressive: Start with overview, drill down as needed
- Automatic: Claude handles the search invocation
Advanced Filtering
You can refine searches using natural language filters:Date Ranges
Multiple Types
Concepts
File-Specific
Project Filtering
Under the Hood: HTTP API
The search skill uses HTTP endpoints on the worker service (port 37777):GET /api/search/observations- Full-text search observationsGET /api/search/sessions- Full-text search session summariesGET /api/search/prompts- Full-text search user promptsGET /api/search/by-concept- Find observations by concept tagGET /api/search/by-file- Find work related to specific filesGET /api/search/by-type- Find observations by typeGET /api/context/recent- Get recent session contextGET /api/context/timeline- Get timeline around specific pointGET /api/timeline/by-query- Search + timeline in one callGET /api/search/help- API documentation
- Boolean operators (AND, OR, NOT)
- Phrase searches
- Column-specific searches
- Date range filtering
- Project filtering
Result Metadata
All results include rich metadata:Citations
All search results include citations using theclaude-mem:// URI scheme:
claude-mem://observation/123- Specific observationclaude-mem://session/abc-456- Specific sessionclaude-mem://user-prompt/789- Specific user prompt
Token Management
Token Efficiency Tips
- Start with index format: ~50-100 tokens per result
- Use small limits: Start with 3-5 results
- Apply filters: Narrow results before searching
- Paginate: Use offset to browse results in batches
Token Estimates
| Format | Tokens per Result |
|---|---|
| Index | 50-100 |
| Full | 500-1000 |
- 20 results in index format: ~1,000-2,000 tokens
- 20 results in full format: ~10,000-20,000 tokens
Common Use Cases
1. Debugging Issues
Find what went wrong:2. Understanding Decisions
Review architectural choices:3. Code Archaeology
Find when a file was modified:4. Feature History
Track feature development:5. Learning from Past Work
Review refactoring patterns:6. Context Recovery
Restore context after time away:Best Practices
- Index first, full later: Always start with index format
- Small limits: Start with 3-5 results to avoid token limits
- Use filters: Narrow results before searching
- Specific queries: More specific = better results
- Review citations: Use citations to reference past decisions
- Date filtering: Use date ranges for time-based searches
- Type filtering: Use types to categorize searches
- Concept tags: Use concepts for thematic searches
Troubleshooting
No Results Found
-
Check database has data:
-
Try broader natural language query:
-
Ask without filters first:
Worker Service Not Running
If search isn’t working, check the worker service:Performance Issues
If searches seem slow:- Be more specific in your queries
- Ask for recent work (naturally filters by date)
- Specify the project you’re interested in
- Ask for fewer results initially
Technical Details
Architecture Change (v5.4.0):- Before: 9 MCP tools (~2,500 tokens in tool definitions per session start)
- After: 1 search skill (~250 tokens in frontmatter, full instructions loaded on-demand)
- Savings: ~2,250 tokens per session start
- Migration: Transparent - users don’t need to change how they ask questions
- User asks a question about past work
- Claude recognizes the intent matches the search skill description
- Skill loads full instructions from
plugin/skills/search/SKILL.md - Skill uses
curlto call HTTP API endpoints - Results formatted and returned to Claude
- Claude presents results to user
Next Steps
- Architecture Overview - System components
- Database Schema - Understanding the data
- Getting Started - Automatic operation

