~/.claude/bin/reflect reads Claude Code's own transcripts, so nothing has to be switched on
first. This skill never edits instruction files: approved fixes become GitHub issues.
Arguments: $ARGUMENTS
Metrics and status
metrics: run~/.claude/bin/reflect metrics --exclude ${CLAUDE_SESSION_ID}.status: run~/.claude/bin/reflect status.
Print the output verbatim and stop.
Review a session
-
Scan. Run
~/.claude/bin/reflect scan <sid>, where<sid>is the argument if one was given, else${CLAUDE_SESSION_ID}. On a non-zero exit, relay the message and stop; live agents mean the user waits and reruns. The scan already leaves out this/reflectturn and earlier ones. -
Fan out. In one message, spawn with
subagent_type: reflect-reviewer:- one
Agentperclusterline of the index, with the promptSession: <sid>,Cluster: <mechanism>and one<agent> L<n>instance per line after it; - one
Agentper index row whose verdict isreview, with three lines:Session: <sid>,Agent: <agent>andDigest: <digest path>. Clustered events are already excluded from the verdicts, so agents left with no flags areskip.
Do not read the digests yourself first.
- one
-
Synthesise the reviewers' findings:
- Drop any finding whose claim or rejected alternative carries no
evidence. - Merge findings that share a cause and a target file into one item, keeping every
fp. Per-agent findings that share a cause across two or more agents become a new cluster item. - Drop a finding no instruction, skill, agent definition, hook or check could have prevented.
- Route each item per references/routing.md. A deterministic fix (hook, lint rule, CI job) beats a sentence of prose.
- Repo-level checks run only when an item points at them: a mistake a linter would catch means
checking for a pre-commit hook or CI job running lint, typecheck and tests; an ignored
instruction means checking whether
AGENTS.md/CLAUDE.mdis oversized or the line is a no-op. - Verify every cluster fix: apply it to a copy of the mechanism's source in the scratchpad,
then run
~/.claude/bin/reflect replayon each instance against it. A fix that still blocks an instance goes back to its reviewer once for rework, else the item is Rejected. - Sort into Accepted (worth an issue now), Backlog (real but one-off or cheap; listed, not filed) and Rejected (with the reason).
- Drop any finding whose claim or rejected alternative carries no
-
Report. Write
<YYYY-MM-DD>-<first 8 of sid>.mdin the directory printed by~/.claude/bin/reflect reports: the scan index, then the three lists with evidence, then theoverflowagents as not reviewed. -
Triage in chat. Number the Accepted items, one line each with target file and owning repo. One line per Backlog and Rejected item, and a count of
skipandoverflowagents. Ask which Accepted items to file, then wait. -
File the approved items per references/issue-format.md. Reply with one line per item: the issue URL, and whether it is new or a comment on an existing one.