search-past-chats

Search past Claude Code conversation history when user asks about previous sessions, mentions "history", "past chats", "did we discuss", "what did we talk about", "show me more from that session", or wants to recall something from earlier conversations.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "search-past-chats" with this command: npx skills add mlshv/cc-history-search/mlshv-cc-history-search-search-past-chats

Search Past Chats Skill

Search through past Claude Code sessions for this project using keyword or regex patterns, and retrieve full context from specific sessions.

When to Use This Skill

Activate when the user:

  • Asks about previous conversations or sessions
  • Wants to find something discussed before
  • References past work without specifics ("that thing we did")
  • Asks "did we talk about X before?" or "what was that about Y?"
  • Mentions searching chat history or past chats
  • Asks for more context from a session found in search results
  • Wants to see the full conversation around a specific topic

Tool 1: Search Sessions

Find sessions matching a keyword or pattern.

node "${CLAUDE_PLUGIN_ROOT}/scripts/search-history.js" "<query>" [options]

Search Options

OptionDescriptionExample
--regexUse regex pattern--regex "error.*handler"
--limit NMax results (default: 10)--limit 5
--after YYYY-MM-DDSessions after date--after 2026-01-01
--before YYYY-MM-DDSessions before date--before 2026-01-15
--include-assistantSearch Claude's responses too--include-assistant
--context NShow N messages around match--context 2

Search Examples

# Basic search
node "${CLAUDE_PLUGIN_ROOT}/scripts/search-history.js" "authentication"

# Search with date filter
node "${CLAUDE_PLUGIN_ROOT}/scripts/search-history.js" --after 2026-01-01 "mcp"

# Search including Claude's responses
node "${CLAUDE_PLUGIN_ROOT}/scripts/search-history.js" --include-assistant "error handling"

# Show context around matches
node "${CLAUDE_PLUGIN_ROOT}/scripts/search-history.js" --context 2 "database schema"

# Regex search
node "${CLAUDE_PLUGIN_ROOT}/scripts/search-history.js" --regex "api.*token"

Search Output

Returns matching sessions with:

  • Session date and title
  • Session ID (use with get-session for more context)
  • Matching excerpts (marked [A] for assistant responses)
  • Match count

Tool 2: Get Session Context

Retrieve full messages from a specific session by ID.

node "${CLAUDE_PLUGIN_ROOT}/scripts/get-session.js" <session-id> [options]

Get-Session Options

OptionDescriptionDefault
--around "text"Center on message containing text-
--context NMessages before/after with --around10
--offset NStart from message N0
--limit NMax messages to return20

Get-Session Examples

# Get first 20 messages from session
node "${CLAUDE_PLUGIN_ROOT}/scripts/get-session.js" abc123-def456

# Get context around specific content
node "${CLAUDE_PLUGIN_ROOT}/scripts/get-session.js" abc123 --around "authentication" --context 5

# Paginate through session
node "${CLAUDE_PLUGIN_ROOT}/scripts/get-session.js" abc123 --offset 20 --limit 20

Workflow

  1. Search first: Use search-history.js to find relevant sessions
  2. Note the session ID: Search results include session IDs
  3. Get more context: Use get-session.js with the ID to see full conversation

Example:

# 1. Search finds session "abc123..." discussing authentication
node "${CLAUDE_PLUGIN_ROOT}/scripts/search-history.js" "authentication"

# 2. Get full context from that session
node "${CLAUDE_PLUGIN_ROOT}/scripts/get-session.js" abc123 --around "authentication" --context 10

Best Practices

  1. Start with broad keywords, then narrow down
  2. Use --include-assistant when you need Claude's explanations too
  3. Use --context to see conversation flow around matches
  4. Use get-session with --around to jump directly to relevant content
  5. Present findings concisely - offer to show more if needed

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Coding

OpenClaw Mobile Gateway Installer

Installs and manages OpenClaw mobile gateway as a system service. Invoke when users need one-command deploy, start, stop, upgrade, or uninstall.

Registry SourceRecently Updated
Coding

Agent Stack Picker

Recommend a minimal, battle-tested stack for AI-agent-driven product development. Use when choosing technology for web, mobile, desktop, backend, automation,...

Registry SourceRecently Updated
Coding

Github Actions Gen

Unknown: help. Use when you need github actions gen capabilities. Triggers on: github actions gen, type, lang, deploy, matrix, no-cache.

Registry SourceRecently Updated
1080ckchzh
Coding

Fontpick

Font pairing and typography helper for designers and developers. Get selectd font pairings by style (modern, classic, minimal, bold, code), generate CSS font...

Registry SourceRecently Updated