Skip to content
Skill

Search sessions

Searches saved pi and Claude Code chat transcripts for past discussions

Search sessions is an open-source agent skill for developer tools. It is available on Claude Code.

Scripts
None
Platforms
Claude Code
GitHub stars
39
Last commit
License
MIT
Listing updated

Similar skills

About Search sessions

This skill lets an agent look through transcripts stored locally by pi and Claude Code, including Claude Code subagent sessions. It runs ripgrep to find JSONL session files that contain a query, then uses jq to pull out user and assistant messages that match, so the agent can report the file, timestamp, role and an excerpt.

Search scope depends on the request. A question about the current folder or project limits the search to the session directory derived from the working directory, while a request that names pi or Claude Code searches only that store. When no client is named, the skill searches pi first and then Claude Code and reports the two groups separately.

The skill expects ripgrep and jq to be installed and reads from the default pi and Claude Code history folders under the home directory. It has no bundled scripts; the commands are written into the instructions.

When your agent uses it

Search saved pi chats, pi conversations, pi sessions, Claude Code chats, Claude Code conversations, and Claude Code sessions. Triggers: "search pi chats", "search pi conversations", "search pi sessions", "find in pi chats", "search Claude Code sessions", "search Claude Code conversations", "search Claude chats", "find in Claude history", "where did we discuss", "search agent conversations".

From the skill's SKILL.md. Your agent reads this description to decide when to load the skill.

What it can access

From a static check of its 1 file (5 KB) on GitHub on 5 December 2026. Nothing was run. Read the files before you install a skill: it can tell your agent to run anything its tools allow.

Check another skill before you install it.

Install

Copy the skill folder to ~/.claude/skills/search-sessions to use it in all your projects:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/richardgill/nix.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/search-sessions &&
cp -R "$tmp/built/ai-agents/ampcode/skills/search-sessions" ~/.claude/skills/search-sessions &&
rm -rf "$tmp"

For one project only, put the folder in .claude/skills/search-sessions inside it instead.

Claude Code docs on skills

Copy the skill folder to ~/.agents/skills/search-sessions to use it in every repository:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/richardgill/nix.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/search-sessions &&
cp -R "$tmp/built/ai-agents/ampcode/skills/search-sessions" ~/.agents/skills/search-sessions &&
rm -rf "$tmp"

For one repository only, put the folder in .agents/skills/search-sessions inside it instead.

Codex docs on skills

Copy the skill folder to ~/.cursor/skills/search-sessions to use it in every project:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/richardgill/nix.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/search-sessions &&
cp -R "$tmp/built/ai-agents/ampcode/skills/search-sessions" ~/.cursor/skills/search-sessions &&
rm -rf "$tmp"

For one project only, put the folder in .cursor/skills/search-sessions inside it instead.

Cursor docs on skills

Run in a terminal (add --scope workspace to install it for the current workspace only):

gemini skills install https://github.com/richardgill/nix.git --path built/ai-agents/ampcode/skills/search-sessions

Or copy the folder to ~/.gemini/skills/search-sessions yourself.

Gemini CLI docs on skills

For GitHub Copilot in VS Code, copy the skill folder to ~/.copilot/skills/search-sessions:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/richardgill/nix.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/search-sessions &&
cp -R "$tmp/built/ai-agents/ampcode/skills/search-sessions" ~/.copilot/skills/search-sessions &&
rm -rf "$tmp"

For one project only, put the folder in .github/skills/search-sessions inside it instead.

VS Code docs on skills

Get the folder:

git clone --depth 1 https://github.com/richardgill/nix.git

Then copy nix/built/ai-agents/ampcode/skills/search-sessions into your agent's skills folder as search-sessions. Agents that support SKILL.md read one folder per skill.

The SKILL.md format

What it does

Current folder search
Limits matching to sessions recorded for the directory the agent is working in.
Cross-client history search
Searches pi and Claude Code transcripts across all saved sessions.
Message-level filtering
Matches only user and assistant messages and prints a short excerpt for each hit.
Subagent session coverage
Includes Claude Code subagent transcripts in the search.
Grouped results
Separates matches by client and reports how many files matched.
Resume pointers
Shows how to reopen a pi session or inspect a matched Claude Code file.

Good for

  • Find where we discussed a specific bug in earlier chats
  • Search past Claude Code sessions for a function or file name
  • Locate a pi conversation about a particular design decision
  • Recover the context of an earlier decision made in this project

Search sessions FAQ

What does the skill need to run?

It uses rg (ripgrep) and jq from the shell, and it reads transcripts from ~/.pi/agent/sessions and ~/.claude/projects.

When does Search sessions trigger?

It triggers on requests such as search pi chats, search Claude Code sessions, find in Claude history, where did we discuss, or search agent conversations.

Does Search sessions change or delete any session files?

No. The commands only read the saved JSONL files and print matching messages.

How do I resume a matched pi session?

The skill's output notes say to use pi --session followed by the session reference.

How do I install Search sessions in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/search-sessions to use it in all your projects, or to .claude/skills/search-sessions in one project.

Does Search sessions run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

Which AI agents can use Search sessions?

Claude Code. It reads skills in the SKILL.md format; the install steps on this page show where to put the folder.

What are the best alternatives to Search sessions?

The closest alternatives to Search sessions are Claude code projects jsonl worktree fanout, Scan sessions and learn, Towit, Codebase index and Agent insights.

Where this comes from

  • Description: from the skill's own SKILL.md.

More from richardgill/nix

  1. Lets your agent manage Todoist tasks through the todoist command-line tool

    • Open source
    • 39 GitHub stars
    • Productivity
  2. Creates git worktrees in tmux sessions and starts an AI agent on a prompt

    • Open source
    • 39 GitHub stars
    • Developer tools
  3. Plans a clean-room rewrite of existing behavior, from requirements through phased

    • Open source
    • 39 GitHub stars
    • Developer tools
  4. Delegates work to supervised Pi agents running in tmux sessions and worktrees

    • Open source
    • 39 GitHub stars
    • Developer tools
  5. Lets your agent run web searches, fetch page content and quick answers via Kagi CLI

    • Open source
    • 39 GitHub stars
    • Web search and scraping
  6. Lets an agent handle Gmail tasks through the gws command-line tool

    • Open source
    • 39 GitHub stars
    • Communication