Skip to content
Skill

Claude code projects jsonl worktree fanout

Locates Claude Code session transcripts split across git worktree project folders

Claude code projects jsonl worktree fanout is an open-source agent skill for developer tools. It is available on Claude Code.

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

Similar skills

About Claude code projects jsonl worktree fanout

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.

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 (8 KB) on GitHub on 4 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

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):

/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:

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.

Claude Code docs on skills

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

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.

Codex docs on skills

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

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.

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

Gemini CLI docs on skills

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

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.

VS Code docs on skills

Get the folder:

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.

The SKILL.md format

What it does

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

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

More from wan-huiyan/agent-traffic-control