
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-controlOr 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.
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.
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.
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-fanoutOr copy the folder to ~/.gemini/skills/claude-code-projects-jsonl-worktree-fanout yourself.
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.
Get the folder:
git clone --depth 1 https://github.com/wan-huiyan/agent-traffic-control.gitThen 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.
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

Teaches agents to refuse a flawed instruction only with measured evidence attached
- Open source
- 5 GitHub stars
- Developer tools

Catches silent deletions when a subagent edits large files with repeated blocks
- Open source
- 5 GitHub stars
- Developer tools

Holds a pull request from merging by stopping its agent, disarming auto-merge, then
- Open source
- 5 GitHub stars
- Developer tools

Checks that a batch of pull requests does not cite file paths that will never exist
- Open source
- 5 GitHub stars
- Developer tools

Checks whether a pull request truly landed by comparing file content, not commit subjects
- Open source
- 5 GitHub stars
- Developer tools

Checks a branch for stale-base changes that would silently undo newer main work
- Open source
- 5 GitHub stars
- Developer tools



