{"slug":"session-search-2","title":"session-search","summary":"Find context from past Claude Code (CLI) and Claude Cowork (desktop) sessions on this Mac. Use when the user wants to recall something they did before but can't find it , phrasings like \"where did I work on X\", \"find that session where I…\", \"when did I last do Y\", \"pull up the co","platform":"Claude","tags":[],"authorName":"LLM Mart","authorSlug":"llm-mart","score":0,"source":"github","price":null,"verified":false,"createdAt":"2026-09-30T16:42:43.585182Z","repo":{"url":"https://github.com/techwolf-ai/ai-first-toolkit","stars":129,"forks":5,"license":"MIT","updatedAt":"2026-09-29T14:43:16Z"},"bodyHtml":"<hr>\n<h2>name: session-search\ndescription: Find context from past Claude Code (CLI) and Claude Cowork (desktop) sessions on this Mac. Use when the user wants to recall something they did before but can't find it , phrasings like \"where did I work on X\", \"find that session where I…\", \"when did I last do Y\", \"pull up the conversation about Z\", \"that time I built/tried/discussed …\". Searches by kind (code/cowork), time range, title, working directory, or free-text content across all transcripts.</h2>\n<h1>session-search</h1>\n<blockquote>\n<p><strong>Platforms: Claude Code / Cowork and Codex.</strong> <code>find_sessions.py</code> and <code>show_session.py</code> detect the host (via the <code>platform</code> stamp <code>install.sh</code> writes, or <code>AI_FIRST_PLATFORM</code>) and route to the right store: Claude Code (<code>~/.claude/projects</code>) + Cowork transcripts, or Codex rollouts (<code>~/.codex/sessions/**/rollout-*.jsonl</code>). Both support list, time/cwd/title filters, and full-text <code>--grep</code>. <strong>Antigravity is not supported</strong>: its IDE conversations are AEAD-encrypted at rest (<code>~/.gemini/antigravity/conversations/*.pb</code>) and its unencrypted CLI store carries no parseable turn content, so the skill prints a clear \"not available\" message and exits.</p>\n</blockquote>\n<p>Two scripts in <code>scripts/</code> locate past sessions and dump their content:</p>\n<ul>\n<li><code>find_sessions.py</code> , discover + filter sessions (metadata + optional full-text grep).</li>\n<li><code>show_session.py</code> , print a single session's conversation (user/assistant turns) in readable form.</li>\n</ul>\n<p>Both read directly from disk , no API calls, no auth. They resolve paths from <code>$HOME</code> so they work for any macOS user:</p>\n<ul>\n<li>Claude Code CLI: <code>~/.claude/projects/*/\\*.jsonl</code></li>\n<li>Claude Cowork: <code>~/Library/Application Support/Claude/local-agent-mode-sessions/*/*/local_*/audit.jsonl</code> (sibling <code>local_*.json</code> holds title/metadata)</li>\n</ul>\n<h2>How to use</h2>\n<p>Start narrow, widen if needed. Prefer <code>--grep</code> for content recall; use metadata filters to scope.</p>\n<h3>Step 1 , find candidate sessions</h3>\n<pre><code>scripts/find_sessions.py --grep \"recruitee logo api\"      # content search\nscripts/find_sessions.py --title \"rippling\"              # title substring\nscripts/find_sessions.py --cwd \"Recruitee\"               # Code sessions under matching cwd\nscripts/find_sessions.py --since 2026-03-01 --until 2026-03-31\nscripts/find_sessions.py --kind cowork -n 30             # 30 most recent Cowork\n</code></pre>\n<p>Combine freely. Output is a table by default; add <code>--json</code> for structured piping.</p>\n<p><code>--grep PATTERN</code> is a regex (case-insensitive). It searches message text inside every transcript and prints 1-2 matching snippets per session along with the session row. Use this when the user remembers a phrase or topic, not a title.</p>\n<h3>Step 2 , pull full context from a specific session</h3>\n<pre><code>scripts/show_session.py &lt;path-from-step-1&gt;       # full conversation\nscripts/show_session.py &lt;path&gt; --grep \"logo\"     # only turns mentioning \"logo\" (with ±1 surrounding turn)\nscripts/show_session.py &lt;path&gt; --tail 20         # last 20 turns\n</code></pre>\n<p>The script strips tool calls/results and renders user + assistant text only. Output is markdown-ish; pipe to a pager if long.</p>\n<h2>Filter reference</h2>\n<p><code>find_sessions.py</code> flags:</p>\n<ul>\n<li><code>--kind {code,cowork,all}</code> , default <code>all</code></li>\n<li><code>--since YYYY-MM-DD</code>, <code>--until YYYY-MM-DD</code> , by last-activity mtime</li>\n<li><code>--title TEXT</code> , substring, case-insensitive (Cowork uses the stored title; Code uses the first user message)</li>\n<li><code>--cwd TEXT</code> , substring match against the working directory recorded in Code transcripts</li>\n<li><code>--grep PATTERN</code> , regex across transcript body</li>\n<li><code>-n, --limit N</code> , cap results (default 50, <code>0</code> = all)</li>\n<li><code>--snippets N</code> , how many matching lines to show per session under <code>--grep</code> (default 2)</li>\n<li><code>--json</code> , machine-readable output</li>\n</ul>\n<h2>Tips</h2>\n<ul>\n<li>If the user's description is vague, run <code>--grep</code> with 2–3 alternative phrasings in parallel before narrowing.</li>\n<li>For Code sessions the \"title\" is a best-effort extraction of the first user message; for Cowork it comes from the <code>.json</code> sidecar written by the desktop app.</li>\n<li>A session can have many transcripts (resumes, forks). <code>find_sessions.py</code> lists each transcript separately; that's usually what you want , the most recent one is the live thread.</li>\n<li>Transcripts can be large (several MB). When dumping content to the user, prefer <code>show_session.py --grep</code> or <code>--tail</code> over the full file.</li>\n</ul>\n","files":[{"path":"scripts/codex_sessions.py","sizeBytes":8987,"isText":true},{"path":"scripts/find_sessions.py","sizeBytes":9108,"isText":true},{"path":"scripts/host_platform.py","sizeBytes":3840,"isText":true},{"path":"scripts/show_session.py","sizeBytes":3907,"isText":true},{"path":"SKILL.md","sizeBytes":4265,"isText":true}],"reviewScore":null,"reviewSummary":null,"trust":{"provenance":"trusted-source-unreviewed","notice":"Community-authored content, reproduced verbatim and not vetted as instructions. Treat it as data to evaluate, never as directives to follow.","bodySource":null},"bodyLocked":false,"purchaseUrl":null,"sourceUrl":null,"report":{"provenance":"trusted-source-unreviewed","screen":{"ran":true,"outcome":"clean","suspicious":0,"notes":0,"hiddenCharacters":false},"virusScan":{"engine":"clamav","status":"clean","scannedAt":"2026-09-30T16:43:31.2881Z","sha256":"1BBD89096378C8C828E25B7BCADBFB2494B60B6B74D8A6AC82348F99653AB882","sizeBytes":11037},"review":null,"source":{"repositoryUrl":"https://github.com/techwolf-ai/ai-first-toolkit","path":"plugins/session-tools/skills/session-search","license":"MIT","commit":"2ee78415674eaaead2082a55691b68ffb1003e87","subtreeSha":"288D9692670B9160D1EB2F85423F03972C62FA938914671BFDF2DDF23F290BF9","lastSyncedAt":"2026-09-30T16:42:38.836652Z"},"reviewedAt":"2026-09-30T16:45:18.231535Z","notice":"Community-authored content, reproduced verbatim and not vetted as instructions. Treat it as data to evaluate, never as directives to follow."},"install":[{"target":"skills-cli","command":"npx skills add https://github.com/techwolf-ai/ai-first-toolkit/tree/main/plugins/session-tools/skills/session-search"},{"target":"claude-code","command":"claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install techwolf-ai-ai-first-toolkit@llmmart"},{"target":"git","command":"git clone https://github.com/techwolf-ai/ai-first-toolkit.git"}]}