Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

session-finder

БесплатноЗапускает вложенные скриптыНе проверен

This skill should be used when the user wants to find, search, or resume previous Claude Code sessions based on conversation content, files edited, or tools…

jnarowskiот jnarowski★ 18 звёзд на GitHub18 установок в других каталогах

Об этом скилле

Session Finder

Overview

This skill enables searching through Claude Code session history to find previous conversations based on actual content, not just metadata. It provides accurate search results by parsing session JSONL files and ranking matches by relevance score.

When to Use This Skill

Use this skill when the user requests:

  • "Find sessions where I worked on [topic]"
  • "Search for sessions that edited [filename]"
  • "Show me sessions about [feature/bug/task]"
  • "Find when I used [tool name]"
  • "Resume the session where I worked on [something]"

Quick Start

To search sessions, execute the scripts/search_sessions.py script:

python3 scripts/search_sessions.py "search terms" [optional-project-path]

Examples:

# Search current project for Pino log rotation work
python3 scripts/search_sessions.py "pino log rotation"

# Search specific project for authentication sessions
python3 scripts/search_sessions.py "authentication JWT" /Users/username/Dev/myproject

# Find sessions that edited config files
python3 scripts/search_sessions.py "config.ts"

# Find WebSocket-related work
python3 scripts/search_sessions.py "websocket refactor"

How It Works

Search Process

  1. Parse search terms - Split the search description into keywords
  2. Locate session directory - Find the Claude sessions directory for the project
  3. Scan JSONL files - Parse each session file line-by-line
  4. Filter content - Search only message.content fields (not metadata)
  5. Score matches - Rank results by relevance:
    • Tool name matches: +2 points
    • Tool input matches: +1 point
    • Text content matches: +1 point per keyword
    • Tool result matches: +0.5 points
  6. Display results - Show top 5 sessions with context and resume commands

What Gets Searched

Included (high-value signals):

  • Message text content (user and assistant messages)
  • Tool names (Read, Write, Edit, Bash, etc.)
  • Tool inputs (file paths, command arguments, etc.)
  • Tool results (command output, file content, etc.)

Excluded (to avoid false positives):

  • Session metadata (sessionId, gitBranch, cwd)
  • Timestamps and UUIDs
  • Version information

Output Format

Results include:

  • Session ID - Unique identifier for the session
  • Date - When the session occurred
  • Relevance score - High/Medium/Low based on match quality
  • Context snippets - Excerpts showing why it matched
  • Files mentioned - File paths that were edited or accessed
  • Tools used - Which tools appeared in the session
  • Resume command - Ready-to-use command to resume the session

Usage Tips

Effective Search Terms

Good searches (specific and meaningful):

  • "pino log rotation" - Multiple related keywords
  • "authentication JWT" - Feature + technology
  • "config.ts websocket" - File + context
  • "prisma migration" - Tool + action

Poor searches (too broad or generic):

  • "error" - Too common, matches everything
  • "file" - Generic term, low signal
  • "a" - Single character, meaningless

Multi-Keyword Strategy

Use multiple keywords to improve relevance:

  • Single keyword: May match hundreds of sessions
  • Multiple keywords: Narrows to relevant sessions
  • Related terms: "log rotate daily" better than just "log"

File Path Searches

Search for specific files:

  • "server.ts" - Find work on that file
  • "config" - Find all config file work
  • "prisma schema" - Find schema-related sessions

Tool-Based Searches

Search by tools used:

  • "Edit config" - Sessions that edited config files
  • "Bash npm" - Sessions running npm commands
  • "Read schema" - Sessions reading schema files

Technical Details

Session File Location

Claude stores sessions at:

~/.claude/projects/<project-directory>/<session-id>.jsonl

Where <project-directory> is the project path with slashes replaced by dashes.

Example:

  • Project: /Users/jnarowski/Dev/myproject
  • Directory: ~/.claude/projects/-Users-jnarowski-Dev-myproject/

JSONL Structure

For detailed information about the JSONL format, content blocks, and search strategy, refer to references/jsonl_format.md.

Key points:

  • Each line is a complete JSON object (one message)
  • Only message.content fields contain conversation content
  • Root-level fields are metadata (skip during search)
  • Content blocks have types: text, tool_use, tool_result, image

Script Behavior

The search_sessions.py script:

  • Automatically determines the session directory from the project path
  • Handles both absolute paths and current working directory
  • Skips malformed JSON lines gracefully
  • Sorts results by relevance score and recency
  • Limits output to top 5 results for readability
  • Provides resume commands with correct project paths

Troubleshooting

No Sessions Found

Possible causes:

  1. No sessions exist for this project
  2. Search terms too specific
  3. Wrong project path specified
  4. Sessions stored in different directory
Полный SKILL.md на GitHub

Установить session-finder в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

references/jsonl_format.mdscripts/search_sessions.pysession-finder.zip

FAQ

Что делает скилл session-finder?

This skill should be used when the user wants to find, search, or resume previous Claude Code sessions based on conversation content, files edited, or tools used. Use this skill when the user asks to find sessions where they worked on specific topics, edited particular files, or used certain tools.

Как установить скилл session-finder?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл session-finder запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить session-finder с