session-search

Search past code agent sessions and summarize matching results with references.

2.0k|126|Updated Jul 30, 2025
One-click install
npx skills add https://github.com/pchalasani/claude-code-tools --skill session-search-pchalasani
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: session-search
Source: https://github.com/pchalasani/claude-code-tools/tree/main/plugins/aichat/skills/session-search
Command: npx skills add https://github.com/pchalasani/claude-code-tools --skill session-search-pchalasani

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill enables engineers to quickly locate and interpret earlier Claude Code or Codex-CLI sessions for reference, audit, or pattern discovery.

Core Features & Use Cases

  • Query-driven session discovery: search for sessions by topic, decision, or code pattern.
  • Structured results: extract session_id, project, created, snippet, and file_path for quick review.
  • Deep-dive workflow: read related session files from ~/.claude/projects/*/[session-id].jsonl for deeper analysis.

Quick Start

Use the session-search skill to locate relevant sessions. Run aichat search --json -n 10 "[query]" and use jq to extract fields like session_id, project, created, snippet, file_path. Then open the matching file paths for deeper inspection.

Frequently Asked Questions about session-search

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I search past Claude Code sessions for a specific code pattern?

To search past Claude Code sessions, run a query-driven discovery using the aichat search tool to retrieve up to 10 matching sessions. It parses results to extract session_id, project, creation date, snippet, and file_path for quick reference and audit.

What is the best way to find old aichat sessions by topic or decision?

Finding old aichat sessions by topic is handled by applying the aichat search tool with a text query. The tool returns matching sessions with structured fields including project name and snippets, enabling engineers to quickly locate earlier decisions or code patterns.

Can I read local session files for deeper analysis after finding a matching session?

Yes, you can read local session files for deeper analysis. After retrieving a session_id, the tool reads the corresponding JSONL file located at ~/.claude/projects/*/[session-id].jsonl to extract and return a more detailed, concise summary with references.

Does session-search work with Codex-CLI session histories?

Yes, session-search works with Codex-CLI session histories. It enables engineers to quickly locate and interpret earlier Claude Code or Codex-CLI sessions for reference, audit, or pattern discovery by searching and reading the local project files.

How to extract session_id and snippet from aichat search results?

To extract session_id and snippet from aichat search results, run aichat search --json -n 10 "[query]" and pipe the output through jq. This parses the JSON output to isolate fields like session_id, project, created, snippet, and file_path for quick review.

What are the limitations of searching past code agent sessions?

A limitation of searching past code agent sessions is that the initial search retrieves a maximum of 10 matching sessions. Deeper review requires reading local JSONL files from the ~/.claude/projects directory, which may restrict analysis to locally available session histories only.