# Claude code projects jsonl worktree fanout

> Claude code projects jsonl worktree fanout is an open-source agent skill for developer tools. Locates Claude Code session transcripts split across git worktree project folders. It is available on Claude Code.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code
- **Website:** https://github.com/wan-huiyan/agent-traffic-control/tree/main/plugins/agent-traffic-control/skills/claude-code-projects-jsonl-worktree-fanout
- **Repository:** https://github.com/wan-huiyan/agent-traffic-control
- **GitHub stars:** 5
- **License:** MIT
- **Skill name:** claude-code-projects-jsonl-worktree-fanout
- **Collection:** https://github.com/wan-huiyan/agent-traffic-control
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-12-04

## About

This skill explains why a search of the usual Claude Code project folder can miss an earlier session. Each git worktree gets its own separately named directory under the Claude projects store, so a conversation held inside a worktree lives somewhere else. The skill shows how to recognise that naming pattern and how to widen the search to the canonical project directory and all of its worktree siblings.

The workflow combines shell commands that list and filter matching directories, a date-bounded find for transcript files, and keyword counting across the matches. It also includes a short Python snippet that pulls only genuine user prompts from the JSONL lines, skipping injected skill text, tool results and system wrappers. Subagent transcripts are excluded because they hold dispatched runs rather than user conversations.

It expects a Claude Code installation with its default local history, plus a POSIX shell with find, grep and stat. No scripts are bundled; the commands are meant to be run by the agent or the user directly.

## When your agent uses it

> Find a prior session's transcript that `~/.claude/projects/<project>/` does not hold: each git worktree gets its own separately namespaced project directory.

## What it can access

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

- [Instructions only, no scripts](https://github.com/wan-huiyan/agent-traffic-control/tree/HEAD/plugins/agent-traffic-control/skills/claude-code-projects-jsonl-worktree-fanout)
- [License: MIT](https://github.com/wan-huiyan/agent-traffic-control/tree/HEAD/plugins/agent-traffic-control/skills/claude-code-projects-jsonl-worktree-fanout)

## Features

- **Worktree directory mapping:** Explains how a git worktree path is encoded into its own Claude projects directory name.
- **Fan-out search commands:** Provides find and grep commands that cover the canonical project and all worktree siblings at once.
- **Date-bounded transcript lookup:** Narrows JSONL transcript files by modification date to speed up finding an older session.
- **Subagent transcript filtering:** Excludes subagent dispatch logs so results reflect user-facing conversations.
- **User prompt extraction:** Includes a Python snippet that reads only real user messages from session JSONL files.
- **Verification check:** Gives a simple count to confirm whether a project uses worktree directories.

## Good for

- Find an old Claude Code session that was run inside a git worktree
- Search every worktree transcript for a keyword from a past discussion
- Audit all sessions ever run against a project that uses worktrees
- Pull the user's prompts from a previous session without tool noise

## Install

### Claude Code

This skill ships in the `agent-traffic-control` plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

```sh
/plugin marketplace add wan-huiyan/agent-traffic-control
/plugin install agent-traffic-control@wan-huiyan-agent-traffic-control
```

Or copy only this skill to `~/.claude/skills/claude-code-projects-jsonl-worktree-fanout`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/wan-huiyan/agent-traffic-control.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/claude-code-projects-jsonl-worktree-fanout &&
cp -R "$tmp/plugins/agent-traffic-control/skills/claude-code-projects-jsonl-worktree-fanout" ~/.claude/skills/claude-code-projects-jsonl-worktree-fanout &&
rm -rf "$tmp"
```

For one project only, put the folder in `.claude/skills/claude-code-projects-jsonl-worktree-fanout` inside it instead.

### Codex

Copy the skill folder to `~/.agents/skills/claude-code-projects-jsonl-worktree-fanout` to use it in every repository:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/wan-huiyan/agent-traffic-control.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/claude-code-projects-jsonl-worktree-fanout &&
cp -R "$tmp/plugins/agent-traffic-control/skills/claude-code-projects-jsonl-worktree-fanout" ~/.agents/skills/claude-code-projects-jsonl-worktree-fanout &&
rm -rf "$tmp"
```

For one repository only, put the folder in `.agents/skills/claude-code-projects-jsonl-worktree-fanout` inside it instead.

### Cursor

Copy the skill folder to `~/.cursor/skills/claude-code-projects-jsonl-worktree-fanout` to use it in every project:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/wan-huiyan/agent-traffic-control.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/claude-code-projects-jsonl-worktree-fanout &&
cp -R "$tmp/plugins/agent-traffic-control/skills/claude-code-projects-jsonl-worktree-fanout" ~/.cursor/skills/claude-code-projects-jsonl-worktree-fanout &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/claude-code-projects-jsonl-worktree-fanout` 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/wan-huiyan/agent-traffic-control.git --path plugins/agent-traffic-control/skills/claude-code-projects-jsonl-worktree-fanout
```

Or copy the folder to `~/.gemini/skills/claude-code-projects-jsonl-worktree-fanout` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/claude-code-projects-jsonl-worktree-fanout`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/wan-huiyan/agent-traffic-control.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/claude-code-projects-jsonl-worktree-fanout &&
cp -R "$tmp/plugins/agent-traffic-control/skills/claude-code-projects-jsonl-worktree-fanout" ~/.copilot/skills/claude-code-projects-jsonl-worktree-fanout &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/claude-code-projects-jsonl-worktree-fanout` inside it instead.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/wan-huiyan/agent-traffic-control.git
```

Then copy `agent-traffic-control/plugins/agent-traffic-control/skills/claude-code-projects-jsonl-worktree-fanout` into your agent's skills folder as `claude-code-projects-jsonl-worktree-fanout`. Agents that support SKILL.md read one folder per skill.

## FAQ

### Why can a past session seem missing from Claude Code history?

Each git worktree gets its own project directory under ~/.claude/projects/, so a session started inside a worktree is stored separately from the canonical project directory.

### Does Claude code projects jsonl worktree fanout need any extra tools or setup?

It relies on a Claude Code installation with its local project history, plus standard shell utilities such as find, grep and stat, and Python for the prompt extraction snippet.

### Are subagent transcripts included in the search?

No. The skill recommends excluding subagent JSONL files because they record dispatched agent runs rather than user conversations.

### Does deleting a worktree remove its transcripts?

No. According to the skill, the project directory for a removed worktree is not cleaned up automatically, so historical transcripts remain.

### How do I install Claude code projects jsonl worktree fanout in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/claude-code-projects-jsonl-worktree-fanout to use it in all your projects, or to .claude/skills/claude-code-projects-jsonl-worktree-fanout in one project. Or install the agent-traffic-control plugin, which includes it: /plugin marketplace add wan-huiyan/agent-traffic-control, then /plugin install agent-traffic-control@wan-huiyan-agent-traffic-control.

### Does Claude code projects jsonl worktree fanout 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 Claude code projects jsonl worktree fanout?

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 Claude code projects jsonl worktree fanout?

The closest alternatives to Claude code projects jsonl worktree fanout are Injected claude md is the worktrees copy not mains, Git worktree, Search sessions, Review sessions and Scan sessions and learn.

## Where this comes from

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

## Alternatives

- [Injected claude md is the worktrees copy not mains](https://ai-powered.com/skills/injected-claude-md-is-the-worktrees-copy-not-mains): Injected claude md is the worktrees copy not mains is an open-source agent skill for developer tools.
- [Git worktree](https://ai-powered.com/skills/git-worktree): Git worktree is an open-source agent skill for developer tools.
- [Search sessions](https://ai-powered.com/skills/search-sessions): Search sessions is an open-source agent skill for developer tools.
- [Review sessions](https://ai-powered.com/skills/review-sessions): Review sessions 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.
- [Harness read write base repo path in worktree stale tree](https://ai-powered.com/skills/harness-read-write-base-repo-path-in-worktree-stale-tree): Harness read write base repo path in worktree stale tree is an open-source agent skill for developer tools.
- [Concurrent session checkout clobbers shared worktree](https://ai-powered.com/skills/concurrent-session-checkout-clobbers-shared-worktree): Concurrent session checkout clobbers shared worktree 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.

---
Source: https://ai-powered.com/skills/claude-code-projects-jsonl-worktree-fanout
