Search and retrieve previous agent session history for code patterns and design decisions.

Install

mkdir -p .claude/skills/session-search && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/3049" && unzip -o skill.zip -d .claude/skills/session-search && rm skill.zip

Installs to .claude/skills/session-search

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

For CLI agents WITHOUT subagent support (e.g., Codex CLI). Search previous code agent sessions for specific work, decisions, or code patterns.
142 charsno explicit “when” trigger
Intermediate

Key capabilities

  • Executes structured searches across session logs
  • Extracts specific design decisions
  • Parses JSONL session metadata
  • Summarizes code patterns from historical sessions

How it works

Utilizes aichat to query JSONL logs and jq to extract specific content from session files.

Inputs & outputs

You give it
Search query or pattern description
You get back
Summary of historical decisions and code snippets

When to use session-search

  • Find past authentication design decisions
  • Locate code patterns used in previous sessions
  • Review project progress from last month
  • Search for specific work snippets

About this skill

If you are Claude Code: Do NOT use this skill directly. Use the session-searcher subagent via the Task tool instead - it handles this more efficiently without polluting your context.

session-search

Search and find previous code agent sessions (Claude-Code or Codex-CLI) for specific work, decisions, or code patterns.

Workflow

  1. Understand the query: Identify what the user is looking for (code patterns, decisions, specific work, design direction)
  2. Search with aichat: Run aichat search --json -n 10 "[query]" (use -g "project" to filter by project)
  3. Parse results: Use jq to extract fields from JSONL output (session_id, project, created, snippet, file_path)
  4. Deep dive if needed: Read session files at ~/.claude/projects/*/[session-id].jsonl (max 3 files)
  5. Summarize: Return a focused summary with key findings and references

Run aichat search --help to see all options (date filters, branch filters, etc.) and JSONL field names.

Output Format

Return a concise summary containing:

  1. Key Findings: 2-3 bullet points answering the query
  2. Relevant Sessions: Session IDs and dates for reference
  3. Specific Content: Code snippets or quotes if directly relevant

Format as clean markdown, not raw JSON.

Example

Query: "Find sessions where we discussed authentication design"

aichat search --json -n 10 "authentication design"

Summary:

  • Session abc123 (Dec 10): Discussed JWT vs session-based auth, decided on JWT
  • Session def456 (Dec 8): Implemented refresh token rotation pattern

Constraints

  • ALWAYS use --json flag with aichat search (otherwise it spawns interactive UI)
  • NEVER return raw JSON output to the user - summarize and distill findings
  • NEVER read more than 3 session files per query
  • If no results found, suggest alternative search terms
  • ONLY report information directly observed in files - never infer or extrapolate

Error Handling

If aichat search command fails or is not found, ask user to install:

uv tool install claude-code-tools   # Python package
cargo install aichat-search         # Rust search TUI

Prerequisites:

  • Node.js 18+ (for action menus)
  • Rust/Cargo (for aichat-search)

If user doesn't have uv or cargo:

curl -LsSf https://astral.sh/uv/install.sh | sh           # uv
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh  # Rust

When not to use it

  • When using agents with native subagent support
  • When searching non-agent documentation
  • If the project lacks session log files

Prerequisites

Aichat toolJq command line utility

Limitations

  • Limited to reading three sessions per search
  • Requires structured CLI log format
  • Does not infer project state

How it compares

It specifically aggregates historical context from session-persistent logs rather than searching the codebase.

Compared to similar skills

session-search side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
session-search (this skill)17moReviewIntermediate
braindump75moNo flagsBeginner
super-search102moReviewBeginner
mem-search84moNo flagsIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

Search skills

Search the agent skills registry