From agent-tree
Use when the user asks to "map a session", "show me the tree", "agent-tree", "/agent-tree", "resume from a node", "fork from this session", or wants to navigate / restart from a specific point in a previous Claude Code session. Renders the session as a numbered file-tree in chat and emits a continue/fork resume block on selection. Available as both an MCP tool (agent_tree_list / agent_tree_snapshot / agent_tree_picks / agent_tree_diff / agent_tree_unstar) and a CLI fallback.
How this skill is triggered — by the user, by Claude, or both
Slash command
/agent-tree:agent-treeThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
In-session mindmap for a previous Claude Code session. The skill renders a
In-session mindmap for a previous Claude Code session. The skill renders a
numbered text tree directly in chat, the user picks a number, and you paste
the resume context so they can drop it into a fresh claude session.
This is a terminal-only tool — everything happens inside the current Claude Code conversation (no browser, no HTML).
Use this skill when the user says any of:
Do not use this skill for:
.jsonl;
the current session is still being written)Two interfaces available — prefer MCP tools when this plugin's MCP server is registered (faster, no subprocess), fall back to the CLI otherwise.
When the agent-tree MCP server is connected (via plugin install):
agent_tree_list({ cwd, sessionId?, phasesOnly?, filter? }) → returns the numbered tree as textagent_tree_snapshot({ cwd, nodeId, mode, sessionId? }) → returns the resume markdown for one node and records the pickagent_tree_picks({}) → lists every recorded pick across every sessionagent_tree_diff({ cwd, from, to, sessionId? }) → summarises what happened between two nodesagent_tree_unstar({ cwd, nodeId, sessionId? }) → removes the ⭐ from a nodeAlways pass the caller's cwd (use the cwd value from the system context)
so the smart-default session-pickup hits the right project. sessionId is
optional; omit to use the current project's most recently modified session.
If the MCP server isn't available, fall through to spawning the CLI:
agent-tree [<session-id>] --no-llm --list
agent-tree [<session-id>] --no-llm --snapshot <N> --mode continue|fork
agent-tree --picks
agent-tree [<session-id>] --no-llm --diff <a> <b>
agent-tree [<session-id>] --no-llm --unstar <N>
The CLI is agent-tree (alias atree), installed globally via npm. If the
binary is missing, prompt the user to run npm i -g @seungwoolee/agent-tree first.
Default to the most recently modified session via --latest. If the user
named a specific session (UUID prefix like 69c2f35e), pass it as the first
positional arg.
agent-tree --latest --no-llm --list
# or
agent-tree <session-id-or-prefix> --no-llm --list
--no-llm keeps it instant and offline (heuristic labels). Drop --no-llm
when the user has ANTHROPIC_API_KEY set and wants LLM-curated labels — but
warn that it'll cost ~$0.10–0.20 for a typical session.
--list is the skill-friendly mode: it prints a numbered ASCII tree to
stdout. Show this output verbatim to the user in a fenced code block:
```
agent-tree — session 69c2f35e · 777 events · 230 turns · 26 nodes · 3720 min
1. 🎯 (root label = first user message, truncated)
2. ├─ 🧩 seg_001 · oss-ideation.md · Write events 0–48
3. ├─ 🧩 seg_002 · SPEC.md · Edit events 49–98
...
26. └─ 🧩 seg_025 · README.md · Edit events 720–776
```
Then ask the user:
Pick a number to copy that node's resume context. • Just the number → continue mode (preserve decisions, change direction) • "N fork" → fork mode (discard subsequent turns)
Once the user replies (e.g. 7, 12 fork, n_005), parse it:
n_NNN → node id, mode=continue<id> fork → mode=fork<id> continue → mode=continue (explicit)Run:
agent-tree <session-id> --no-llm --snapshot <id-or-number> --mode <continue|fork>
The CLI prints the resume markdown to stdout. Show it to the user inside a fenced code block so the user can select-and-copy without you adding any commentary inside the fence:
```markdown
# Continuing from: seg_007
...
```
After the fence, tell the user:
claude session and paste it as the first message.agent-tree --pick or ask
for a longer UUID prefix.agent-tree: command not found → tell the user to run
npm i -g @seungwoolee/agent-tree. (Avoid suggesting bare npx —
the package ships two bins so npx auto-resolution is unreliable; see
README "Why not bare npx?" for the trap.)The snapshot you show in chat contains the (redacted) session context. By
default, 16 secret patterns plus Luhn-validated credit cards are stripped
(Anthropic / OpenAI / GitHub / Slack / AWS / GCP / HuggingFace / Stripe / npm
tokens, JWTs, Bearer tokens, PEM private keys, card numbers). To additionally
strip PII (emails / phones / SSN / Korean RRN), append --redact-strict:
agent-tree <session> --no-llm --redact-strict --snapshot <id> --mode continue
Always show the user the share warning if the snapshot is going to be copy-pasted somewhere external.
--llm) without warning the user about
cost and waiting for confirmation.agent-tree against the current session UUID — its JSONL is
still being written, so the parse will be incomplete or fail.npx claudepluginhub lifrary/agent-tree --plugin agent-treeCreates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.