session-search

atondwal's avatarfrom atondwal

Search through historical Claude sessions for code, conversations, and commands. Use when user asks about previous sessions, past conversations, "did I ever", "find in history", or wants to retrieve code/info from earlier chats.

⭐0stars🔀0forks📁View on GitHub🕐Updated Jan 4, 2026

When & Why to Use This Skill

The Session Search skill empowers Claude to efficiently index and retrieve information from historical conversation logs, code snippets, and executed commands stored in local project directories. By providing a regex-capable search interface, it bridges the gap between separate sessions, allowing for seamless context recall and the ability to treat past interactions as a searchable personal knowledge base.

Use Cases

  • Code Retrieval: Quickly find specific function definitions, API implementations, or complex regex patterns used in previous coding sessions.
  • Context Restoration: Recall the reasoning behind past architectural decisions or project requirements discussed in earlier conversations.
  • Command History: Locate specific shell commands or deployment scripts (e.g., Docker, Kubernetes) that were successfully executed in past tasks.
  • Information Recovery: Retrieve specific links, documentation snippets, or troubleshooting steps provided by the assistant in previous interactions to avoid redundant work.
namesession-search
descriptionSearch through historical Claude sessions for code, conversations, and commands. Use when user asks about previous sessions, past conversations, "did I ever", "find in history", or wants to retrieve code/info from earlier chats.

Session Search

Search through your Claude session history stored in ~/.claude/projects/.

Usage

Run the search script with a regex or keyword pattern:

python ~/.claude/skills/session-search/search.py "pattern" [max_results]

Examples

# Find sessions mentioning a specific function
python ~/.claude/skills/session-search/search.py "def parse_config"

# Find discussions about a topic
python ~/.claude/skills/session-search/search.py "kubernetes|docker"

# Find code with specific imports
python ~/.claude/skills/session-search/search.py "from fastapi import"

# Limit results
python ~/.claude/skills/session-search/search.py "error" 10

Output

Returns matches with:

  • Session slug/ID and project path
  • Timestamp
  • Role (user/assistant)
  • Matching content with surrounding context
  • 1 message before/after for context

Results are sorted by recency (newest first), limited to 20 by default.