/cc-skills-analysis:recapfrom cc-skills-analysis
Generate a handoff-ready session recap across the full session chain, with an optional evidence-scoped pre-handoff check
Ships in cc-skills-analysis. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Problem solved: "I have 10 sessions compaction-deep in this terminal and I need to know what happened."
/recap aggregates context from ALL sessions in this terminal by walking the full session chain (handoff files + mtime-gap fallback) and parsing each transcript. Session boundaries within each transcript are detected via sessionId changes.
/recap uses session_chain.walk_session_chain() to walk the full session chain via handoff files, then parses each transcript in oldest-to-newest order.
LLM Executor: ALWAYS walk the chain via session_chain.walk_session_chain(). Never skip the transcript walk. Do not assume "I have full conversation context in memory" — post-compaction, in-memory context is a lossy subset of the transcript and feels complete while missing items. The transcript at transcript_path is the only authoritative source. (This clause replaces an earlier "skip if you have context" shortcut that caused recaps to silently omit work dropped by compaction.)
WT_SESSION is shared, ~/.claude/active-session-{terminal_id}.txt and ~/.claude/.artifacts/{terminal_id}/identity.json are last-writer-wins, and mtime/size fallbacks resolve to a sibling session. Wrong session_id → wrong chain walked → silent miss (same failure class as the post-compaction skip trap). Derive it directly:
transcript_path in your most recent hook payload — C:\Users\<user>\.claude\projects\P--\<session_id>.jsonl (or <session_id>-<model>.jsonl). The stem minus the optional -<model> suffix is the session_id./status or inspect ~/.claude/projects/P--/ for the .jsonl whose mtime is newest and whose content includes your current first message. Do NOT guess from memory or from the active-session file.walk_session_chain() in Step 2.session_chain.walk_session_chain(session_id) — Strategy 1 uses handoff files (n_1_transcript_path), Strategy 2 uses mtime-gap + semantic fallbacksessionId changes, extract goals/message counts
session_chainmodule:P:/packages/.claude-marketplace/plugins/search-research/core/session_chain.py— exportswalk_session_chain()(unified entry),walk_handoff_chain()(Strategy 1),walk_sessions_index_chain()(Strategy 2). All synchronous.
Always parse the transcript. Even when compaction context is available, the transcript contains the authoritative full session chain and detailed working state. Compaction summaries are lossy — they capture goals and outcomes but not the exact sequence of working decisions, errors encountered, or file states mid-edit.
⚠️ Fallback behavior: If
session_chainimport fails, fall back to reading only the current terminal's transcript file directly — it cannot reconstruct the full multi-session terminal history. The synthesis step will have less context to work with.
The script extracts structured data via regex and presents it in a format compatible with handoff best practices.
/handoff template)# Terminal Recap: {terminal_id}
## Session Metadata
- **Total Sessions**: {count}
- **Terminal ID**: {terminal_id}
- **Current Session**: {session_id}
- **Project**: {project_path}
## Session History
[Session 1] {session_id}
- **User messages**: {n} / Assistant messages: {n}
- **Duration**: {duration if available}
### Modified Files
- `{file_path}`
- `{file_path}`
### Original Request
- **User Request**: "{extracted request}"
- **Trigger**: {trigger context}
### Session Objectives
- **Objective 1**: {objective} ({status})
- **Objective 2**: {objective} ({status})
### Final Actions Taken
- **Action A** ({priority})
- **Action B** ({priority})
### Outcomes
- **Outcome 1**: ({status})
- **Outcome 2**: ({status})
### Active Work At Handoff
- **Currently Working On**: {work description}
- **Current Status**: {status}
- Files Modified: {file_list}
- Next: {next_step}
### Working Decisions (Critical for Continuity)
- **Decision**: {decision}
- **Rationale**: {reason}
- **Impact**: {high|medium|low}
### Current Tasks
- **#{id}**: {task description} ({status}, {priority})
### Known Issues
- **ISSUE-1**: {description} ({status}, {priority})
### Open Questions / Parking Lot
- **Question**: {question text}? ({priority}, {type})
- *Urgency*: High/Med/Low — what would need to be true to decide this?
### Knowledge Contributions
- **Insight**: {contribution}
### Next Immediate Action
1. {action_1}
2. {action_2}
### Parking Lot (Inversion)
*What would guarantee this session's work fails?* Surface it here.
- **Failure Mode**: {description} — *Mitigation*: {what would prevent it}
- **Assumption**: {core assumption} — *Invalidates*: D# or Action#
- **External Block**: {dependency} — *Blocks*: Action#
### Recommended Next Steps
Use `render_actions()` from `recap/__lib/render_rns.py` (local copy) to render actionable next steps in human-readable RNS format. The original RNS Python backend was removed when `/rns` became a pure-LLM skill; `__lib/render_rns.py` preserves the renderer locally.
```python
import sys
from pathlib import Path
_lib = str(Path(__file__).resolve().parent / "__lib")
if _lib not in sys.path:
sys.path.insert(0, _lib)
from render_rns import render_actions, RenderOptions
actions = [
{"id": "1a", "domain": "recap", "priority": "medium", "description": "...", "file_ref": "file.py:line", "effort": "~5min"},
]
print(render_actions(actions, RenderOptions(show_effort=True, show_file_ref=True)))
Rendered output format (via render_actions):
1 🔄 RECAP (2)
1a 🟡 [E:~5min] Resume pending snapshot unit tests @ test_phase2_scan.py
1b 🔵 Check handoff chain integrity for recent sessions
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
0 — Do ALL Recommended Next Actions (2 items)
When no actionables found (brief mode, no session chain), skip the RNS section entirely — do not emit RNS|Z|0|NONE to the user.
{condensed text for full transcript access}
> **⚠️ Note:** The `### Raw Context` section is condensed by `_condense_transcript()` with a 2000-character budget per session. When `### Modified Files` is present, AID distillation replaces Raw Context with AST-level code structure. Content beyond that limit is silently dropped — the structured fields above are the primary evidence source. Full transcript access requires reading the raw transcript file directly.
### Project Context Backdrop
Before synthesizing session narratives, establish project context.
Call `mcp__aid__distill_directory` on the project root with `recursive=false`, `include_implementation=false`. Present the result as a collapsible `## Project Context` section at the top of synthesis. Skip this step for `/recap brief` mode or if the AID MCP tool is unavailable.
### Response Synthesis (LLM task after script output)
When responding to `/recap`, apply reasoning to the script output plus the raw transcript context. For each session, synthesize:
**What happened**: Numbered list of issues. Each item starts with an origin tag and a confidence tag, then describes the issue.
Origin tags:
- `[user-reported]` — user explicitly raised this
- `[discovered-during-fix]` — surfaced while working on something else
- `[hook-failure]` — a hook caught or blocked something
- `[skill-escalated]` — a skill routed here from another skill
- `[regression]` — something that worked before broke
Confidence tags:
- `[FACT]` — grounded in tool output, file content, or command results visible in the transcript
- `[INFERENCE]` — plausible but not directly proven by transcript evidence; state what evidence would confirm or deny
- `[UNKNOWN]` — important question that cannot be answered from visible evidence
Example: `[user-reported] [FACT] Path refactoring broke imports — sync.py raised ModuleNotFoundError at line 42`
**What was done**: What actually changed (file edits, hooks, skills, configs). Be specific about the actual action.
**In hindsight**: Was the approach right, given what we know now? Only include this section when the fix was a workaround, a detour was taken, or something was missed. Skip it when the fix was straightforward and correct.
**Still pending**: Concrete next steps that were identified but not completed. Each item must be actionable — a command to run, a file to check, or a decision to make. If nothing is pending, omit this section entirely.
**Assumptions to verify**: For each assumption the synthesis relies on, suggest one concrete check — a command to run, a file to inspect, or a question to ask. Each item states the assumption and the check that would confirm or falsify it. If no assumptions are uncertain, omit this section entirely.
Example: "Assumption: sync.py import fix works for all package repos. Check: run `python P://.claude/skills/git/sync.py --health` and verify no ImportError."
Present synthesis as a per-session narrative in the response, not replacing the script output but complementing it.
### Code Structure Enrichment
For sessions with `### Modified Files`, call `mcp__aid__distill_file` on up to 5 files with `include_implementation=false`. The distilled output (function signatures, class hierarchy) serves dual purpose:
1. **Replaces regex-extracted “actions”** with actual function/class changes in synthesis
2. **Replaces `### Raw Context`** with AST-level structure instead of the 2000-char condensed transcript
Regex extraction remains as fallback for sessions without identifiable file changes. Sessions without Modified Files keep the `### Raw Context` fallback.
## Usage
```bash
/recap # Generate handoff document (default mode)
/recap brief # Show brief catch-up summary only
/recap full # Show full detailed session history
/recap check # Run the recap-owned pre-handoff check
/recap check --tier core --size large --kind refactor # Include explicit risk score
When invoked without arguments, /recap produces a handoff document suitable for another LLM, PM, or developer picking up where the session left off. This is the default behavior — no flags needed.
# Session Recap
## Resume Here
- **Status**: {complete | partial | blocked}
- **Outcome**: {one-sentence summary of what landed and what state the system is in now}
- **Immediate next action**: {one concrete command, file edit, or "none — session is closed"}
- **Do not**: {1–3 hard constraints the next agent must respect, e.g. "do not read the 495K-token export into main context"}
- **Handoff confidence**: {high | medium | low — anchored to GATE 1/2 signals below in "Evidence Appendix"}
## Completed
- **Change**:
- **Verification**:
- **Commits**:
## Remaining Work
### Urgent
- {only items requiring action before the next session can proceed}
### Blocked
- {external blockers; internal uncertainty belongs in Risks}
### Optional
- {deferred follow-ups clearly labeled non-urgent}
## Risks and Constraints
- {assumptions, failure modes, unsafe paths, hook false positives, stale tracker rows}
- {if nothing material, write "None material." rather than omit}
## Decisions
- {only decisions that constrain future work, each with its reversal trigger}
## Artifacts
- {files written/edited, exports, transcripts, evidence-store entries}
- {max 10; if exceeded, list the most-recent 10 and link to the rest in the appendix}
## Evidence Appendix
- **Friction**: {observed tool/hook/skill frictions that constrained this session}
- **Hypotheses**: {behave-style hypotheses surfaced but not confirmed}
- **Weakest assumption challenge**: {one assumption you'd be most confident about that you HAVEN'T verified}
- **Inversion prompt**: failure modes and their mitigations
- **Catch-up integrity prompts** (internal self-check): see SKILL.md "Catch-Up Integrity Prompts" — expand here as needed for the worst 2–3
- **Multi-terminal context** (only when chain spans terminals): {terminal-by-terminal summary}
## Next Session Checklist
- [ ] {concrete, deduplicated next action 1}
- [ ] {concrete next action 2}
The handoff format replaces the per-session narrative as the default output. Use /recap full for the detailed session-by-session view with origin tags and confidence labels. Use /recap brief for a quick one-paragraph catch-up — brief mode is exempt from this template and stays one section.
/recap check)/recap check is the recap-owned successor to the retired /dne surface. It
keeps the useful DUF/NSE behavior at the handoff boundary:
/debrief
when a recurring failure or durable lesson needs transcript forensics.The check is advisory and does not infer commit/push state or implement fixes. The objective tier × size × kind score is calculated only when all three inputs are explicitly supplied; otherwise the output says that risk is uncalculated. This keeps the score from becoming a false precision proxy for session safety.
When session data spans multiple terminals (discovered via session registry or handoff chain), include a ## Multi-Terminal Context section:
## Multi-Terminal Context
- **Terminal A** ({id}): {summary of work}
- **Terminal B** ({id}): {summary of work}
- **Cross-terminal dependencies**: {what depends on what}
This section is omitted when all sessions belong to the same terminal.
/recap uses intent detection to suggest follow-up commands. Map session patterns to the most relevant skill (max 3 suggestions per recap):
| Intent Detected | Follow-Up Command | When to Suggest |
|---|---|---|
| Navigation / lost context | /debrief gaps | Current gaps or stale assumptions are unclear |
| Architecture decisions | /design | Unresolved state or contract decisions in prior sessions |
| Complexity hotspots | /tldr-deep then /refactor | Sessions with many modified files or complex changes |
| Debugging / root cause | /diagnose or /rca | Sessions with unresolved bugs or error patterns |
| Impact verification | /verify | Work discussed or implemented but not actually proven |
| Data flow tracing | /trace | Sessions touching data pipelines or state management |
/pre-mortem remains the escalation path for sessions with unresolved risk or emergent behavior.
/recap should not implement fixes itself.
These prompts are the source-of-truth rubric the Evidence Appendix in the Handoff Template draws from. /recap runs them as an internal self-check before authoring the handoff; the worst 2–3 failures land in the Evidence Appendix Catch-up integrity prompts (internal self-check) subsection. Do NOT fan them out into the user-facing handoff at full length — that is exactly the audit-buried-in-prose failure the new template fixes.
Before synthesizing a catch-up summary, /recap should run a short internal catch-up integrity check:
/design, /planning, or /verify rather than being presented as a local recap observation?These are internal self-check prompts. They are not default user-facing questions and should only surface to the user when /recap is genuinely blocked and cannot proceed safely without clarification.
GATE 1 (STOP after session_chain.walk_session_chain): Before moving to synthesis, verify:
walk_session_chain() — NOT inferred from in-memory conversation context. This is the anti-compaction invariant: synthesis grounded in in-memory context alone silently omits items the summarizer dropped. If you cannot point to a session ID from the walk, you skipped the walk; go back and run it.If gate fails: note chain walk issue and proceed with available data.
GATE 2 (STOP before Response Synthesis): Before LLM synthesis, verify:
If gate fails: note missing sections and proceed with available data.
STOP between generation (Steps 1-4) and validation (Steps 5+):
session_chain.walk_session_chain() which first tries handoff-file chain (Strategy 1: n_1_transcript_path → prior handoff → ...), then mtime-gap + semantic fallback (Strategy 2)sessionId field changes within each transcriptsessionId is the stem of the transcript filename (e.g., 8a7b83ff-7d98-47e9-b3b5-3ffabc978c40.jsonl)Before claiming code is absent, unchanged, or non-existent — search the codebase and verify with tools first. Claims of absence are only valid after confirmed Read/Grep/git failures.
Do NOT answer without reading relevant source files first. Do not ask the user for information you can obtain yourself via Read, Grep, Bash, git, or available MCP tools.
Prohibited:
__init__.py (opens in a new tab)__lib/render_rns.py (opens in a new tab)_write_qf.py (opens in a new tab)acquire.py (opens in a new tab)models.py (opens in a new tab)quality_findings.json (opens in a new tab)recap_v2.py (opens in a new tab)risk_calculator.py (opens in a new tab)scripts/recap_cli.py (opens in a new tab)tests/conftest.py (opens in a new tab)tests/test_recap.py (opens in a new tab)tests/test_recap_v2_adversarial.py (opens in a new tab)tests/test_risk_calculator.py (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
Generated from the plugin's indexed repository (enduser123/cc-skills-analysis) — no native marketplace selected
npx claudepluginhub p/enduser123-cc-skills-analysis14 skills in this plugin
/behaveStructured behavioral analysis for LLM performance debugging — hypothesis testing for session patterns (loops, context degradation, decision inefficiency, cognitive overload, attention drift)/claude-auditAudit and optimize Claude Code configuration (CLAUDE.md, .claude/rules/, skills, hooks, agents, MCP, plugins, MEMORY.md) for over-engineering, token waste, and rule-shape — whether each rule lives in the right mechanism. Consolidates claudit + config-audit. Self-contained; no external subagent fleet./debriefUnified analysis hub — mines transcripts for unfinished work + origin-anchored tasks. Modes: default (transcript → root-cause tasks), chain (multi-session retrospective: /recap→gaps→/friction→/red-team→/rns + SCORES), gaps (deterministic gap detectors + mandatory haiku gap reviewer + RNS + artifact contract), top (6-source problem scan → ranked tasks). Trigger phrases: 'debrief this transcript', 'mine the chat history', 'victim log', 'why is this broken', 'run a retro', 'top problems', 'what gaps remain'. Absorbs /retro and /top-problems; gap detection is debrief-owned.