Analyze a Claude Code session for "wrong-turn" moments (corrections, retries, waste, reversals, dead-ends) and produce an interactive HTML dashboard with copy-able recommendations (CLAUDE.md rules…

Apache-2.0Auto-check passedAgent Workflows

Install Reflect

skills CLI
$ npx skills add NikiforovAll/claude-code-rules --skill reflect -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install NikiforovAll/claude-code-rules reflect --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/NikiforovAll/claude-code-rules.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/handbook-reflect/skills/reflect .claude/skills/reflect && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
reflect
GitHub stars
141
Token cost
~1.8k tokens
SKILL.md length
891 words
Files
3 (incl. scripts)
Skills in repo
26
Repo updated
First seen
Licence
Apache-2.0

At a glance

Analyze a Claude Code session for "wrong-turn" moments (corrections, retries, waste, reversals, dead-ends) and produce an interactive HTML dashboard with copy-able recommendations (CLAUDE.md rules…

  • Works in 3 steps: $TMPDIR (Unix/macOS) → $TMP or $TEMP (Windows / Git Bash) → /tmp as fallback
  • The user invokes /reflect
  • SKILL.md covers When to use, What to detect (incidents), What to recommend and How to render, plus 3 more sections
  • Runs Python scripts from its folder

What it does

Reflect is an agent skill from NikiforovAll/claude-code-rules. Analyze a Claude Code session for "wrong-turn" moments (corrections, retries, waste, reversals, dead-ends) and produce an interactive HTML dashboard with copy-able recommendations (CLAUDE.md rules, docs, scripts, hooks, memory entries, sub-skills, etc.) that would help future agents reach the goal faster. Defaults to reflecting on the current in-context session; optionally accepts a session ID or JSONL path. Use when the user invokes /reflect or asks to learn from this session.

Its SKILL.md is about 1.8k tokens, which your agent loads only when the skill is triggered. The skill folder holds 4 other files, including scripts (for example `scripts/analyze_session.py`).

It sits in Agent Workflows, covering HTML artifacts and Agent instruction files. The repository describes itself as: Learn practical techniques to enhance your AI-assisted development workflow with Claude Code. The licence is Apache-2.0.

When your agent uses it

  • The user invokes /reflect
  • Asks to learn from this session

Example prompts

  • “wrong-turn”
  • “/reflect”

Requirements

  • Python 3

Workflow steps

3 steps, taken from the first numbered list in SKILL.md.

  1. $TMPDIR (Unix/macOS)
  2. $TMP or $TEMP (Windows / Git Bash)
  3. /tmp as fallback

What it can do on your machine

Read from SKILL.md and the folder at commit 281c063. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 1 file in scripts/ (Python), which the agent can run.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Reflect loads about 1.8k tokens when it runs. Until then it costs about 123 tokens; SKILL.md has 891 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~123
When it runs · the whole SKILL.md, loaded when a task matches
~1.8k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from NikiforovAll/claude-code-rules at commit 281c063, republished under its Apache-2.0 licence (© NikiforovAll). 891 words, ~1,846 tokens.

Download SKILL.mdSave it as .claude/skills/reflect/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.
name
reflect
description
Analyze a Claude Code session for "wrong-turn" moments (corrections, retries, waste, reversals, dead-ends) and produce an interactive HTML dashboard with copy-able recommendations (CLAUDE.md rules, docs, scripts, hooks, memory entries, sub-skills, etc.) that would help future agents reach the goal faster. Defaults to reflecting on the current in-context session; optionally accepts a session ID or JSONL path. Use when the user invokes /reflect or asks to learn from this session.
context
fork
argument-hint
`<current_session> or <session-id-or-path>`

/reflect — session reflection

Produce a single-file interactive HTML dashboard analyzing a Claude Code session for places the agent took a wrong turn, paired with concrete repo additions that would prevent the same wrong turn next time.

When to use

  • User invokes /reflect (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 of what happened.
  • User invokes /reflect <session-id> or /reflect <path-to-jsonl> → analyze a different session. Run scripts/analyze_session.py <path> directly (this skill runs in a forked context — context: fork — so the compressed transcript can enter your context safely). 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 analyze that transcript to identify wrong-turn moments — the script does NOT classify incidents, it only compresses.

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

What to detect (incidents)

Open-ended — but the common shapes are:

  • correction — user pushed back on an approach ("no", "don't", "stop", "actually")
  • retry — agent ran the same tool 2+ times with variations before it worked
  • waste — many Reads/Greps/Globs before finding the right file
  • reversal — agent edited then unwound (Edit → revert, Write → delete)
  • dead-end — tool failed because of the environment (missing binary, wrong path, OS mismatch)
  • self-correction — agent caught its own mistake mid-stream

Severity:

  • high — explicit user correction, repeated correction, or substantial wasted turns
  • med — single retry/reversal, modest waste
  • low — minor dead-end, easily recovered

Confidence (0–100): how sure you are this is a real wrong turn worth surfacing, vs. signal noise. Be honest — low-confidence items are not bugs, they let the user filter out speculation.

  • 90–100 — explicit user correction or unambiguous failure
  • 70–89 — strong pattern (repeated retries, clear reversal) with minor interpretation
  • 50–69 — plausible wrong turn, could also be normal exploration
  • <50 — speculative; surface only if the pattern is interesting

Render as data-conf="<n>" on each .incident plus a small badge. The dashboard slider hides incidents below the chosen threshold.

What to recommend

Open-ended. Anything that would help a future agent reach the goal faster. Examples (not a fixed taxonomy — pick what fits the incident):

  • rule → CLAUDE.md block (project or user)
  • doc → docs/ARCHITECTURE.md, README pointer, architecture map
  • script → scripts/<name>.sh wrapping a known-good command
  • hook → .claude/settings.json PreToolUse / PostToolUse for hard blocks (e.g. block edits to a generated file)
  • memory → user/feedback/project/reference entry under ~/.claude/.../memory/
  • skill → a new sub-skill in ~/.claude/skills/
  • agent → an agent definition in .claude/agents/
  • allowlist → permissions in .claude/settings.json
  • env → environment variable, MCP server, etc.

Each recommendation should map to one or more incidents (the dashboard renders these as addresses #N links).

How to render

Synthesize a fresh single-file HTML dashboard each run, using reference/example.html as inspiration (not a template — override anything that doesn't fit the session). The reference file establishes:

  • Two-pane layout: incidents left, recommendations right
  • CSS tokens (--bg, --panel, --fg, --muted, --accent, etc.) — keep this scheme
  • Type pairing: Newsreader italic for the wordmark, JetBrains Mono for everything technical, system sans for prose
  • Click incident card to expand; click addresses #N link to scroll-and-highlight the matching incident
  • Filter chips toggle severity and category

Output directory — do not write inside the skill folder. Resolve a temp dir from the environment, in this preference order:

  1. $TMPDIR (Unix/macOS)
  2. $TMP or $TEMP (Windows / Git Bash)
  3. /tmp as fallback

Then create a reflect/ subdir inside it (mkdir -p) and write the report as <that-dir>/reflect/<slug>.html. Slug rules — kebab-case, derived from session goal:

  • 2–5 words, lowercase, hyphen-separated, ASCII only
  • describe the task, not the session id (e.g. auth-middleware-rewrite)
  • if the goal is unclear, fall back to <YYYY-MM-DD>-<topic>.html

Open it in the browser when done: start "" <path> (Git Bash on Windows).

Show full SKILL.md (293 more words)Show less

Files in this skill

  • reference/example.html — canonical inspiration HTML. Read before generating.
  • scripts/analyze_session.py — JSONL compressor. Strips system reminders, preserves real user messages, collapses tool calls/results to one-liners, expands compaction blocks. Output is markdown to stdout. Use only for explicit sessions — never on the current in-context session.

Workflow

Default (no args) — reflect on current session:

  1. From conversation memory, list wrong-turn moments (incidents) with severity + category + turn marker + a 1-line excerpt.
  2. For each incident (or cluster), draft a recommendation: title, target (kind + path), snippet, list of incident IDs it addresses.
  3. Read reference/example.html for the current aesthetic.
  4. Write the dashboard to the temp dir resolved above (<temp>/reflect/<slug>.html) — fresh HTML, same look-and-feel as the reference, populated with the real incidents/recs.
  5. Open it with start "" <path>.

Explicit session — /reflect <id-or-path>:

  1. Resolve to a JSONL path (if just an id, look under ~/.claude/projects/<encoded-cwd>/<id>.jsonl).
  2. Run scripts/analyze_session.py <path>. Skill is forked (context: fork), so the compressed transcript (tens of KB even for multi-MB JSONLs) is safe in context. No subagent.
  3. Identify wrong-turn incidents from the transcript yourself — the script does not classify. Focus on user/assistant exchange (what the user wanted vs. what the agent did), not raw tool patterns.
  4. Fallback to JSONL when transcript is lossy. Transcript truncates tool args/results and long messages. When detail matters (exact rejected input, full error body, Edit diff, full user message), Read the JSONL directly with offset/limit scoped to the event by turn/tool. JSONL is source of truth; transcript is the index.
  5. Draft recommendations and render (default steps 2–5).

Notes

  • Incidents are claims about what happened. Be honest — include the agent's own mistakes, not just user corrections.
  • Recommendations should be specific and actionable (real paths, real snippet content). A vague "improve docs" rec is not useful.

© NikiforovAll, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 2 other files (scripts) in plugins/handbook-reflect/skills/reflect of NikiforovAll/claude-code-rules.

  • SKILL.md
  • reference/example.html
  • scripts/analyze_session.py

Open the folder on GitHubat commit 281c063

Compare with similar skills

Reflect next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Reflect compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Reflect this skillNikiforovAll/claude-code-rules141—~1.8kAutomated safety check: PassApache-2.0
Htmlvspecdisler/pi-agent-observability145—~4.7kAutomated safety check: NotesMIT
Agent Instructionsmurphytrueman/design-system-ops206—~2.3kAutomated safety check: PassMIT
Research Setupbrycewang-stanford/Auto-Empirical-Research-Skills4.5k—~1.2kAutomated safety check: PassCustom licence
ImagineerQinghongLin/data2story-skill156—~3.2kAutomated safety check: NotesMIT
Solo Artifactssolo-agent/solo697—~961Automated safety check: PassMIT

Similar skills

  • Htmlvspec

    disler/pi-agent-observability

    Creates a visual engineering implementation plan as a single self-contained HTML page saved to specs/<name.html — the plan authored directly in styled HTML, with one AI-generated diagram image per…

    145 GitHub stars~4.7k tokensUpdated 4 mo ago
    Agent WorkflowsAuto-check: notes
  • Agent Instructions

    murphytrueman/design-system-ops

    Write the AGENTS.md that tells coding agents how to use this design system: where things live, sourced rules, how to check work, what not to do; Claude, Cursor or Copilot pointers on request.

    206 GitHub stars~2.3k tokensUpdated 15 days ago
    Agent WorkflowsAuto-check passed
  • Research Setup

    brycewang-stanford/Auto-Empirical-Research-Skills

    Interactive setup wizard that configures a new project for the social-science-research plugin.

    4.5k GitHub stars~1.2k tokensUpdated 3 days ago
    Agent WorkflowsAuto-check passed
  • Imagineer

    QinghongLin/data2story-skill

    Fan out MANY candidate interactive concepts from the data + narrative — the ideation pool the Editor curates a hero + supporting set from.

    156 GitHub stars~3.2k tokensUpdated 3 mo ago
    Agent WorkflowsAuto-check: notes
  • Solo Artifacts

    solo-agent/solo

    A skill your agent uses when a Solo task or thread should become an interactive, reviewable, self-contained HTML artifact for progress/status, review/decision, or comparison/leaderboard work inside…

    697 GitHub stars~961 tokensUpdated 26 days ago
    Frontend & DesignAuto-check passed
  • Orca Chat Visuals

    stablyai/orca

    Show a chart, diagram, table, report or mockup inline in this Orca chat as an HTML page.

    88k GitHub stars~413 tokensUpdated today
    Frontend & DesignAuto-check passed

More from NikiforovAll/claude-code-rules

All 26 skills in this repo
  • Reflect Solution

    NikiforovAll/claude-code-rules

    Summarize WHAT WAS SHIPPED in a Claude Code session as a self-contained HTML slide deck — the elevator pitch (problem, solution, decisions, artifacts, verification, gaps), not a play-by-play of tool…

    141 GitHub stars~3.8k tokensUpdated 7 days ago
    Auto-check passed
  • Dotnet Analyzers

    NikiforovAll/claude-code-rules

    Run dotnet format to fix code style and analyzer diagnostics (IDE0005, CA, SA).

    141 GitHub stars~1.9k tokensUpdated 7 days ago
    Auto-check passed
  • Ilspy Decompile

    NikiforovAll/claude-code-rules

    Understand implementation details of .NET code by decompiling assemblies.

    141 GitHub starsUsed in 2 repos~760 tokens
    Auto-check passed
  • Reflect Tree

    NikiforovAll/claude-code-rules

    Visualize a Claude Code session as a quest/skill tree — a navigable SVG graph where nodes are turns and edges show flow, with distinct visual encoding for normal flow, dead-ends, corrections…

    141 GitHub stars~2.8k tokensUpdated 7 days ago
    Auto-check passed
  • Structured Plan Mode

    NikiforovAll/claude-code-rules

    This skill should be used when planning and tracking complex feature implementations that require systematic task decomposition.

    141 GitHub stars~4.2k tokensUpdated 7 days ago
    Auto-check passed
  • Glab

    NikiforovAll/claude-code-rules

    Expert guidance for using the GitLab CLI (glab) to manage GitLab issues, merge requests, CI/CD pipelines, repositories, and other GitLab operations from the command line.

    141 GitHub starsUsed in 1 repo~2.2k tokens
    Auto-check passed

Questions about Reflect

What does Reflect do?

Analyze a Claude Code session for "wrong-turn" moments (corrections, retries, waste, reversals, dead-ends) and produce an interactive HTML dashboard with copy-able recommendations (CLAUDE.md rules…. Reflect is an agent skill from NikiforovAll/claude-code-rules.) that would help future agents reach the goal faster.

When should I use Reflect?

Reflect fits situations like: the user invokes /reflect; asks to learn from this session.

How do I install Reflect in Claude Code?

Run `npx skills add NikiforovAll/claude-code-rules --skill reflect -a claude-code`. Or copy the skill folder (plugins/handbook-reflect/skills/reflect in NikiforovAll/claude-code-rules) into .claude/skills/reflect in your project. Claude Code loads it when a task matches its description.

How do I install Reflect in Codex?

Run `npx skills add NikiforovAll/claude-code-rules --skill reflect -a codex`. Or copy the skill folder (plugins/handbook-reflect/skills/reflect in NikiforovAll/claude-code-rules) into .agents/skills/reflect in your project. Codex loads it when a task matches its description.

Can I use Reflect in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add NikiforovAll/claude-code-rules --skill reflect -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/reflect, .gemini/skills/reflect, .github/skills/reflect and .opencode/skills/reflect in your project.

What does Reflect need to run?

Going by SKILL.md and its folder, Reflect needs Python for the scripts in its folder. Our summary lists: Python 3.

Does Reflect access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Reflect safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Reflect use?

Reflect is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Reflect use?

About 1.8k tokens (SKILL.md is roughly 7.4k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Reflect?

Skills that share tags, products or a category with Reflect: Htmlvspec (disler/pi-agent-observability, 145 stars), Agent Instructions (murphytrueman/design-system-ops, 206 stars), Research Setup (brycewang-stanford/Auto-Empirical-Research-Skills, 4.5k stars) and Imagineer (QinghongLin/data2story-skill, 156 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Reflect?

NikiforovAll (a GitHub user) maintains it in NikiforovAll/claude-code-rules, which has 141 GitHub stars. The repository holds 26 skills in this directory. The repository was last updated on October 2, 2026.

Source: NikiforovAll/claude-code-rules on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.