Markdown Converter
Agent skill for markdown-converter
Search through your Claude Code conversation history using multiple methods to find relevant prompts, discussions, and insights.
Sign in to like and favorite skills
Search across all your Claude Code conversation history for: $ARGUMENTS
Search through your Claude Code conversation history using multiple methods to find relevant prompts, discussions, and insights.
First, search the main conversation database:
# Search user messages for keywords sqlite3 ~/.claude/__store.db " SELECT b.session_id, datetime(b.timestamp, 'unixepoch') as date, substr(u.message, 1, 100) as preview FROM user_messages u JOIN base_messages b ON u.uuid = b.uuid WHERE u.message LIKE '%$ARGUMENTS%' ORDER BY b.timestamp DESC LIMIT 10;"
Search through project-specific conversation history:
import json import re from datetime import datetime def search_project_history(search_term): try: with open('/Users/YOUR_USERNAME/.claude.json', 'r') as f: data = json.load(f) results = [] if 'projects' in data: for project_path, project_data in data['projects'].items(): if 'history' in project_data: for i, item in enumerate(project_data['history']): text = "" if isinstance(item, dict) and 'display' in item: text = item['display'] elif isinstance(item, str): text = item if search_term.lower() in text.lower(): results.append({ 'project': project_path.split('/')[-1], 'index': i, 'text': text[:200] + "..." if len(text) > 200 else text, 'relevance': text.lower().count(search_term.lower()) }) # Sort by relevance results.sort(key=lambda x: x['relevance'], reverse=True) return results[:15] # Top 15 results except Exception as e: return [{'error': f"Search failed: {e}"}] # Execute search results = search_project_history("$ARGUMENTS") for result in results: if 'error' in result: print(f"ā {result['error']}") else: print(f"š Project: {result['project']}") print(f"š¢ Relevance: {result['relevance']} matches") print(f"š¬ Text: {result['text']}") print("---")
Find and resume specific conversation sessions:
# Get recent sessions with context sqlite3 ~/.claude/__store.db " SELECT DISTINCT b.session_id, datetime(MIN(b.timestamp), 'unixepoch') as start_date, datetime(MAX(b.timestamp), 'unixepoch') as end_date, COUNT(*) as message_count, b.cwd as working_directory FROM base_messages b GROUP BY b.session_id ORDER BY MAX(b.timestamp) DESC LIMIT 10;"
Search for complex patterns and contexts:
import re def advanced_prompt_search(pattern, context_words=5): """ Search for regex patterns with surrounding context """ # This would search through conversation files # and return matches with surrounding context search_patterns = [ r'(?i)' + re.escape("$ARGUMENTS"), # Case insensitive exact match r'(?i).*' + re.escape("$ARGUMENTS") + r'.*', # Contains term r'(?i)\b' + re.escape("$ARGUMENTS") + r'\b', # Whole word match ] print(f"š Searching for patterns related to: '$ARGUMENTS'") print(f"š Including {context_words} words of context around matches") # Implementation would search through all conversation sources return "Advanced search results would appear here" advanced_prompt_search("$ARGUMENTS")
Search through conversation summaries for high-level topics:
# Search conversation summaries sqlite3 ~/.claude/__store.db " SELECT cs.summary, datetime(cs.updated_at, 'unixepoch') as last_updated FROM conversation_summaries cs WHERE cs.summary LIKE '%$ARGUMENTS%' ORDER BY cs.updated_at DESC;"
Find conversations from specific time periods:
# Search conversations from last 7 days sqlite3 ~/.claude/__store.db " SELECT b.session_id, datetime(b.timestamp, 'unixepoch') as date, substr(u.message, 1, 150) as preview FROM user_messages u JOIN base_messages b ON u.uuid = b.uuid WHERE u.message LIKE '%$ARGUMENTS%' AND b.timestamp > strftime('%s', 'now', '-7 days') ORDER BY b.timestamp DESC;"
After finding relevant conversations, resume them:
# Resume a specific session (replace SESSION_ID) claude --resume SESSION_ID # Or use interactive session selector claude --resume
š PROMPT SEARCH RESULTS for: "$ARGUMENTS" š SUMMARY - Database matches: X results - Project history matches: Y results - Session matches: Z sessions šÆ TOP MATCHES [Ranked list of most relevant conversations] š RECENT DISCUSSIONS [Time-ordered recent mentions] š RESUMABLE SESSIONS - Session ID: abc123 | Date: 2024-01-15 | Context: "Working on ML pipeline" - Use: claude --resume abc123 š” RELATED TOPICS [Automatically detected related search terms]
Execute comprehensive prompt search starting with database query, then expanding to project histories and conversation summaries.