reflect-tree

reflect-tree is a skill for Claude Code, Codex from NikiforovAll/claude-code-rules. It costs 115 tokens per session (2,660 once invoked), scanned A, original, Apache-2.0.

An interactive graph of a Claude Code session, with turns shown as nodes and links showing the path through the work.

In plain words
What is it for?
Use it to review the journey of the current session or a saved session file and identify where the agent changed direction or repeated work.
Why use it?
It makes detours, retries, corrections, dead ends, reversals, and backtracking easier to see than a plain conversation transcript.

Skill for Claude CodeCodex

Part of the reflect plugin — 2 skills shipped together

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.

agentmods
npx agentmods add skills/nikiforovall/claude-code-rules/reflect-tree
Any agent
npx skills add NikiforovAll/claude-code-rules --skill reflect-tree
Clone the repo
git clone --depth 1 https://github.com/NikiforovAll/claude-code-rules

Made for: Claude Code, Codex.

Or install reflect, the plugin that ships this one along with the rest of its 2 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 reflect-tree

README.md
[![agentmods](https://agentmods.dev/badge/skills/nikiforovall/claude-code-rules/reflect-tree.svg)](https://agentmods.dev/skills/nikiforovall/claude-code-rules/reflect-tree)
Your own site
<a href="https://agentmods.dev/skills/nikiforovall/claude-code-rules/reflect-tree"><img src="https://agentmods.dev/badge/skills/nikiforovall/claude-code-rules/reflect-tree.svg" alt="Measured on agentmods" height="20"></a>
Per session 115 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,660 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00115 $0.02660
Opus 5 $0.00057 $0.01330
Sonnet 5 $0.00023 $0.00532
Haiku 4.5 $0.00012 $0.00266

Measured 4d ago against content hash 862fb2e195b1, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

reflect-tree scanned grade A with 0 findings 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 4d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/analyze_session.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/handbook-reflect/skills/reflect-tree/SKILL.md · 150 lines

How it starts

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

/reflect-tree — session quest-tree

Produce a single-file interactive HTML quest-tree of a Claude Code session. The vertical spine is the linear sequence of turns; back-edges and off-spine nodes encode wrong turns (corrections, retries, reversals, dead-ends, backtracks) so the user can see the whole journey at a glance — including detours and where the agent had to redo work.

This is a sibling to /reflect. Same input contract, different output: /reflect is a two-pane incidents/recommendations dashboard; /reflect-tree is a graph.

When to use

  • User invokes /reflect-tree (no args) → analyze the current session from the in-context conversation. Do not re-read the session JSONL — work from the agent's own memory.
  • User invokes /reflect-tree <session-id> or /reflect-tree <path-to-jsonl> → run scripts/analyze_session.py <path> directly (this skill runs in a forked context — context: fork — so the compressed transcript is safe to ingest). The script outputs a compact markdown transcript: system reminders stripped, tool calls/results collapsed to one-liners, compaction blocks expanded with embedded user quotes. Then you classify each turn — the script does NOT classify, it only compresses.

Session JSONLs live under: ~/.claude/projects/<encoded-cwd>/<session-id>.jsonl

Node classifications

Each turn becomes a node. Pick the strongest applicable label:

  • normal — routine forward progress (user request or assistant tool call/result with no problem)
  • correction — user pushed back on an approach ("no", "don't", "stop", "actually")
  • retry — agent ran the same tool/intent 2+ times with variations before it worked
  • reversal — agent edited then unwound (Edit → revert, Write → delete)
  • dead-end — tool failed because of the environment (missing binary, wrong path, OS mismatch)
  • backtrack — agent abandoned a path and resumed from an earlier state
  • self-correction — agent caught its own mistake mid-stream

Read the full file on GitHub · 150 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 4d ago First seen · 150 lines · 0 tokens per session scan A 862fb2e195b1

Subscribe to this mod's changes

reflect-tree is a skill published in the GitHub repository NikiforovAll/claude-code-rules (141 stars, last pushed 5d ago), licensed Apache-2.0. It adds 115 tokens to every session and 2,660 once invoked, about $0.0006 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

review-pr

Review a Pull Request in one of two postures: an expository "tour guide" that walks through changes in logical order, or an adversarial audit that assumes the change is wrong until proven safe and hunts for the failure mode. Triggers: "review PR #123", "adversarial review", "walk me through this PR", "PR tour guide"…

jontsai/claude-plugins · 139 tokens

researcher

Use when asked to create research documents, generate PDFs, make one-pagers, or create cheatsheets. Triggers: "research document", "generate PDF", "one-pager", "cheatsheet", "distinctive design". Provides HTML/Markdown/PDF with Terminal, Editorial, Corporate, Industrial, Fresh aesthetic presets.

jontsai/claude-plugins · 68 tokens

start-thread

Use when opening OR RESUMING a unit of work — a feature, bug, research spike, refactor, an experiment — that should survive context loss in its own scratch workspace with a handoff doc. Idempotent create-or-resume: a fresh topic gets a scaffolded STATE doc; an existing thread gets a resume briefing (STATE + live…

shck-dev/ccx-context-system · 130 tokens

save-state

Use when you need the whole picture of active work in this project — at session start, after a context clear or /compact, when finishing a work item, or when asked "what's in flight", "what am I building", "show the overall picture", or "save state".

shck-dev/ccx-context-system · 61 tokens

infrastructure-planning

Plan and document the required software, infrastructure, and logistics for a Paperclip company — domains, GitHub, Docker Hub, Kubernetes, Slack, Google Workspace, Stripe, shipping providers, and CI/CD pipelines. Use when setting up infrastructure for a new company or auditing what an existing company needs.

lukaskellerstein/claude-my-marketplace · 64 tokens

work-planning

Design the complete work hierarchy for a Paperclip company — Goals, Projects, and Tasks as a unified top-down planning workflow. Produces .planning.json for deterministic generation of goals/, projects/, and tasks/ directories. Use when creating a new company's work plan, reorganizing work structure, or linking goals…

lukaskellerstein/claude-my-marketplace · 70 tokens