Skip to content

Instantly share code, notes, and snippets.

@kvncrw
Last active March 11, 2026 14:07
Show Gist options
  • Select an option

  • Save kvncrw/d060d75454ee38806b4137df6432f6b6 to your computer and use it in GitHub Desktop.

Select an option

Save kvncrw/d060d75454ee38806b4137df6432f6b6 to your computer and use it in GitHub Desktop.
Claude Code /find-session skill — search and resume past AI coding sessions (requires cass)
name find-session
description Find and resume past Claude Code sessions. Triggers: find session, search past sessions, find where I worked on, resume session, cass search, what session did I, find the conversation where, search my history.

Find Session Skill

Search past AI coding sessions using cass and offer to resume them.

Dependencies

  • cass (Coding Agent Session Search) — Rust CLI/TUI that indexes and searches session histories from Claude Code, OpenCode, Cursor, Aider, and 11+ other AI coding tools. Provides sub-60ms full-text search across all your conversations. Install: cargo install coding_agent_session_search or grab a binary from releases.

Search Procedure

Step 1: Build search queries

Translate the user's description into keyword queries. Tips:

  • Use specific nouns/verbs from what they describe, not abstract descriptions
  • Try 2-3 different keyword strategies if first doesn't hit
  • Single-word queries often work better than multi-word
cass search "<keywords>" --limit 20 --json

Step 2: Parse and filter results

Results come as hits array. Filter out noise:

  • Skip paths containing observer-sessions (claude-mem internals)
  • Skip paths containing /subagents/ (sub-conversations)
  • Skip titles starting with <observed_from or Your task is to create a detailed summary
  • Deduplicate by session UUID (extract from source_path)

Step 3: Present results

For each match, show:

  • Date (convert epoch ms created_at to human date)
  • Workspace (extract project from source_path)
  • Title
  • Snippet (if relevant)
  • Message count

Step 4: Offer actions

  • Resume: Extract UUID from source_path (the filename without .jsonl extension), offer claude --resume <UUID>
  • Export: cass export <source_path> for markdown export
  • View context: cass expand <source_path> --line <N> to see messages around a match

Source Path Format

~/.claude/projects/<encoded-project>/<UUID>.jsonl
  • UUID is the session ID for claude --resume
  • Project is encoded with hyphens replacing path separators

Important Notes

  • cass index may be stale — if results seem incomplete, suggest cass index --full
  • Search returns hits not results in JSON output
  • created_at is epoch milliseconds, not seconds
  • Multiple queries are better than one complex query
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment