find-claude-session

Find Claude sessions by searching content and return resume command.

Command for Claude Code

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/jnarowski/agentcmd/find-claude-session
Clone the repo
git clone --depth 1 https://github.com/jnarowski/agentcmd

Made for: Claude Code.

Per session 10 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,035 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00010 $0.01035
Opus 5 $0.00005 $0.00517
Sonnet 5 $0.00002 $0.00207
Haiku 4.5 $0.00001 $0.00103

Measured today against content hash b3f0eebeeb7f, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

find-claude-session scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured today.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/commands/find-claude-session.md · 127 lines

How it starts

The opening of the file, as written. The whole thing — 127 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Find Claude Session

Search through Claude Code session files to find specific sessions based on their content (messages, tool uses, file paths). Returns the command to resume the found session.

Variables

  • $search-description: $1 (required) - Description of what you're looking for (e.g., "sessions working on authentication", "sessions that edited config.ts", "sessions using WebSocket")
  • $project-path: $2 (optional) - Specific project path to search within. If not provided, searches all projects in /Users/jnarowski/.claude/projects

Instructions

  • Search through .jsonl session files in the Claude projects directory
  • Match against message content, tool uses, file paths, and text blocks
  • Use fuzzy/semantic matching - don't require exact keywords
  • Parse JSONL format correctly (one JSON object per line)
  • Extract relevant context snippets showing why each session matched
  • If multiple matches found, show top 5 with context
  • Return the full resume command: claude --resume <session-id> --project <project-path>

Workflow

  1. Determine search scope

    • If $project-path provided, search only: $project-path/.claude/projects/_/sessions/_.jsonl
    • Otherwise, search all: /Users/jnarowski/.claude/projects/*/sessions/*.jsonl
  2. Search session files

    • Read each .jsonl file line by line
    • Parse JSON objects (each line is a message/event)
    • Search in:
      • content blocks (text, tool uses, file paths)
      • Tool names (tool_use blocks)
      • File paths mentioned in any context
      • thinking blocks if present
    • Score relevance based on keyword matches and context
  3. Rank and present matches

    • Sort by relevance score (most matches, recency as tiebreaker)
    • For top 5 matches, extract:
      • Session ID (from filename or session metadata)
      • Project path
      • Timestamp/date of session
      • 2-3 relevant excerpts showing why it matched (truncate long messages)
    • Display results in a readable format
  4. Generate resume command

    • For each match, provide the exact command:
      claude --resume <session-id> --project <project-path>
      

Read the full file on GitHub · 127 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. today First seen · 127 lines · 10 tokens per session scan A b3f0eebeeb7f

Subscribe to this mod's changes

find-claude-session is a command published in the GitHub repository jnarowski/agentcmd (18 stars, last pushed 8mo ago), licensed MIT. It adds 10 tokens to every session and 1,035 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-01.