lore search
Search message content across all sessions with filtering options.
lore search <QUERY> [OPTIONS]Examples
Section titled “Examples”# Basic searchlore search "authentication"
# Filter by toollore search "bug fix" --tool claude-code
# Filter by date rangelore search "refactor" --since 2025-12-01 --until 2025-12-15
# Filter by project or branchlore search "api" --project myapplore search "feature" --branch main
# Combine filterslore search "database" --tool aider --project backend --since 2025-12-01
# Show more context around matcheslore search "error handling" --context 3
# JSON outputlore search "auth" --format jsonSample Output
Section titled “Sample Output”Session c9731a91 (claude-code, 2025-12-25 17:52) Directory: /Users/dev/myapp Branch: main
[User] Can you help me add authentication to this app? [Assistant] I'll help you add authentication. Let me first look at...
---
Session 8b2f1c3d (aider, 2025-12-20 14:30) Directory: /Users/dev/backend Branch: feat/auth
[User] The authentication middleware is failing on... [Assistant] I see the issue. The token validation...
Found 2 sessions with matchesOptions
Section titled “Options”| Option | Description |
|---|---|
--tool <NAME> | Filter by tool (e.g., claude-code, aider) |
--since <DATE> | Only sessions after this date |
--until <DATE> | Only sessions before this date |
--project <NAME> | Filter by project/directory name |
--branch <NAME> | Filter by git branch |
--context <N> | Show N messages around each match |
-f, --format <FMT> | Output format: text, json |
Date Formats
Section titled “Date Formats”The --since and --until options accept:
- ISO dates:
2025-12-01,2025-12-01T14:30:00 - Relative:
yesterday,last week,2 days ago
Search Tips
Section titled “Search Tips”- Search matches message content, project names, branches, and tool names
- Use quotes for multi-word phrases:
"error handling" - Results are grouped by session with context
- The
--contextoption shows surrounding messages for better understanding
JSON Output
Section titled “JSON Output”lore search "auth" --format json{ "query": "auth", "results": [ { "session_id": "c9731a91-...", "tool": "claude-code", "started_at": "2025-12-25T17:52:00Z", "matches": [ { "message_index": 0, "role": "user", "content": "Can you help me add authentication...", "timestamp": "2025-12-25T17:52:00Z" } ] } ]}See Also
Section titled “See Also”- lore sessions - List sessions
- lore show - View full session
- Searching Sessions Guide - Advanced search techniques