claude-code-projects-jsonl-worktree-fanout

claude-code-projects-jsonl-worktree-fanout is a skill for Claude Code from wan-huiyan/agent-traffic-control. It costs 48 tokens per session (2,007 once invoked), scanned B, original, MIT.

A guide for finding Claude Code conversation transcripts stored under different Git worktrees. A transcript is a saved record of a previous coding session, and a worktree is a separate working copy of a repository.

In plain words
What is it for?
Use it to locate older sessions by searching the project folders associated with the main repository and its worktrees.
Why use it?
It explains why searching the main project’s transcript folder can miss a session that was started from another worktree.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: reads .claude/ paths; mentions subagents; mentions Claude Code.

Part of the agent-traffic-control plugin — 105 skills shipped together

Good fit Use it to locate older sessions by searching the project folders associated with the main repository and its worktrees.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/wan-huiyan/agent-traffic-control/claude-code-projects-jsonl-worktree-fanout
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add wan-huiyan/agent-traffic-control --skill claude-code-projects-jsonl-worktree-fanout
Clone the repo
git clone --depth 1 https://github.com/wan-huiyan/agent-traffic-control

Made for: Claude Code.

Or install agent-traffic-control, the plugin that ships this one along with the rest of its 105 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for claude-code-projects-jsonl-worktree-fanout

README.md
[![agentmods](https://agentmods.dev/badge/skills/wan-huiyan/agent-traffic-control/claude-code-projects-jsonl-worktree-fanout/github.svg)](https://agentmods.dev/skills/wan-huiyan/agent-traffic-control/claude-code-projects-jsonl-worktree-fanout)
Your own site
<a href="https://agentmods.dev/skills/wan-huiyan/agent-traffic-control/claude-code-projects-jsonl-worktree-fanout"><img src="https://agentmods.dev/badge/skills/wan-huiyan/agent-traffic-control/claude-code-projects-jsonl-worktree-fanout/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for claude-code-projects-jsonl-worktree-fanout

Your own site · 80×15
<a href="https://agentmods.dev/skills/wan-huiyan/agent-traffic-control/claude-code-projects-jsonl-worktree-fanout"><img src="https://agentmods.dev/badge/skills/wan-huiyan/agent-traffic-control/claude-code-projects-jsonl-worktree-fanout.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 48 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,007 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00048 $0.02007
Opus 5 $0.00024 $0.01004
Sonnet 5 $0.00010 $0.00401
Haiku 4.5 $0.00005 $0.00201

Measured 9d ago against content hash 7adacfa031bf, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade B, and why

claude-code-projects-jsonl-worktree-fanout scanned grade B with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

The user asks: *"find that session ~2 weeks ago where we discussed X"*. You grep `~/.claude/projects/-Users-<user>-Documents-foo-project/*.jsonl` for keywords, get partial or zero hits, and report "couldn't find it" — bu
plugins/agent-traffic-control/skills/claude-code-projects-jsonl-worktree-fanout/SKILL.md · 162 lines

How it starts

The opening of the file, as written. The whole thing — 162 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Claude Code projects/ JSONL transcripts fan out across worktrees

Problem

The user asks: "find that session ~2 weeks ago where we discussed X". You grep ~/.claude/projects/-Users-<user>-Documents-foo-project/*.jsonl for keywords, get partial or zero hits, and report "couldn't find it" — but the session does exist, just under a different directory because it ran inside a git worktree.

Claude Code maps each git worktree to its own project directory under ~/.claude/projects/. The canonical project at /Users/<user>/Documents/foo-project/ becomes:

~/.claude/projects/-Users-<user>-Documents-foo-project/

But a worktree created via git worktree add .claude/worktrees/<wt-name> becomes a separate sibling:

~/.claude/projects/-Users-<user>-Documents-foo-project--claude-worktrees-<wt-name>/

Each worktree dir holds its own JSONL transcripts for sessions started from that working directory. A project that's seen heavy worktree use (typical for superpowers:using-git-worktrees workflow) can have dozens of sibling dirs.

Context / Trigger Conditions

  • User asks about a prior session, conversation, or work in a project
  • Project uses superpowers:using-git-worktrees or has .claude/worktrees/ populated
  • Your initial grep of ~/.claude/projects/<project-name>/*.jsonl returned fewer hits than expected, or none
  • You want to enumerate every session that ever ran against the project (e.g. for a knowledge audit)
  • Symptom: ~/.claude/projects/ contains a <project-name> dir AND multiple <project-name>--claude-worktrees-<wt> siblings

Solution

Quick lookup (one-liner)

Glob the wildcard suffix to cover canonical + all worktrees:

ls ~/.claude/projects/ | grep -iE "<project-keyword>" | wc -l  # confirm fan-out

Then search across all of them at once:

find ~/.claude/projects/ -name "*.jsonl" -newermt "<earliest-date>" 2>/dev/null \
  | grep -iE "<project-keyword>" \
  | grep -v subagents \
  | while read f; do
      c=$(grep -ic -E "<your-search-keywords>" "$f" 2>/dev/null)
      [ "$c" -gt 0 ] && echo "$c | $(stat -f "%Sm" -t "%Y-%m-%d %H:%M" "$f") | $f"
    done | sort -rn | head -10

Read the full file on GitHub · 162 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 162 lines · 48 tokens per session scan B 7adacfa031bf

Subscribe to this mod's changes

claude-code-projects-jsonl-worktree-fanout is a skill published in the GitHub repository wan-huiyan/agent-traffic-control (3 stars, last pushed 4d ago), licensed MIT. It adds 48 tokens to every session and 2,007 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

llm-wiki

Build and maintain an LLM-curated personal knowledge base — the "LLM Wiki" pattern from Andrej Karpathy's April 2026 gist. Use this skill whenever the user wants to ingest a source (paper, article, transcript, PDF, notes) into a persistent compounding knowledge base, ask a question against accumulated notes, lint or…

praneybehl/llm-wiki-plugin · 221 tokens

bottle

Bootstrap a new or existing project with a small, file-based documentation system so Claude Code keeps context, lessons, and decisions across session restarts instead of starting cold every time. Sets up a handful of markdown files under .claude/ (standing rules, a free-form note to your next session, a phased…

Simooo45/bottle · 209 tokens

lembas

Use between workflow phases or when context feels bloated. Writes a structured checkpoint capturing task, findings, files, state, and next steps, then continues from that summary instead of the full history. Invoke standalone or automatically between quest phases.

justinjdev/fellowship · 51 tokens

resume

Write down where this stretch of work stopped, so the next session continues instead of restarting. Use at the end of a working session, or when handing the repository to someone else.

ArcticFox2029/chamnan · 36 tokens

capture

Write down a procedure worth keeping — a multi-step process, a trap that cost real time, or something that has now come up three times. Use it the moment you finish such a task, while the details are still exact.

ArcticFox2029/chamnan · 46 tokens

notebook

Project notes system to prevent AI context loss and reasoning loops. Init notes, save mid-flow, recover context, migrate messy notes, resolve lessons. Subcommands: /notebook, /notebook save, /notebook recover, /notebook migrate.

catcatcatstudio/cat-skills · 54 tokens