# Search sessions

> Search sessions is an open-source agent skill for developer tools. Searches saved pi and Claude Code chat transcripts for past discussions. It is available on Claude Code.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code
- **Website:** https://github.com/richardgill/nix/tree/main/built/ai-agents/ampcode/skills/search-sessions
- **Repository:** https://github.com/richardgill/nix
- **GitHub stars:** 39
- **License:** MIT
- **Skill name:** search-sessions
- **Collection:** https://github.com/richardgill/nix
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-12-03

## About

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".

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/richardgill/nix/tree/HEAD/built/ai-agents/ampcode/skills/search-sessions)
- [License: MIT](https://github.com/richardgill/nix/tree/HEAD/built/ai-agents/ampcode/skills/search-sessions)

## Features

- **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

## Install

### Claude Code

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

```sh
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.

### Codex

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

```sh
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.

### Cursor

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

```sh
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.

### Gemini CLI

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

```sh
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.

### VS Code

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

```sh
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.

### Other agents

Get the folder:

```sh
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.

## 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.

## Alternatives

- [Claude code projects jsonl worktree fanout](https://ai-powered.com/skills/claude-code-projects-jsonl-worktree-fanout): Claude code projects jsonl worktree fanout is an open-source agent skill for developer tools.
- [Scan sessions and learn](https://ai-powered.com/skills/scan-sessions-and-learn): Scan sessions and learn is an open-source agent skill for developer tools.
- [Towit](https://ai-powered.com/skills/towit): Towit is an open-source agent skill for developer tools.
- [Codebase index](https://ai-powered.com/skills/codebase-index): Codebase index is an open-source agent skill for developer tools.
- [Agent insights](https://ai-powered.com/skills/agent-insights): Agent insights is an open-source agent skill for developer tools.
- [Regression finder](https://ai-powered.com/skills/regression-finder): Regression finder is an open-source agent skill for developer tools.
- [Recall](https://ai-powered.com/skills/recall-michael-denyer): Recall is an open-source agent skill for developer tools.
- [Find](https://ai-powered.com/skills/find): Find is an open-source agent skill for developer tools.

---
Source: https://ai-powered.com/skills/search-sessions
