session-debrief
Analyze Claude Code sessions in three expert modes — Handoff Document (exhaustive context extraction for the next developer or session), Error.
What this skill does
> **Self-Evolving Skill**: This skill improves through use. If instructions are wrong, parameters drifted, or a workaround was needed — fix this file immediately, don't defer. Only update for real, reproducible issues.
## Execution Model — MANDATORY
**You MUST use AskUserQuestion TWICE before spawning an Agent.** Ask for the goal first, then the time range. Then spawn the Agent with resolved parameters.
---
## Step 1 — Ask Which Goal
Use `AskUserQuestion` to present exactly these three choices:
> **Which analysis mode?**
>
> 1. **Handoff Document** — Exhaustive context for the next developer or Claude session continuing this work. Extracts every decision, file, command, gotcha, incomplete item, and next step. Multiple MiniMax chunks if needed for full coverage.
> 2. **Error Forensics** — Complete inventory of every warning, error, deprecation, failed command, and anomaly that occurred — especially ones Claude acknowledged but ignored or deferred. Full verbatim detail with file paths and commands.
> 3. **Chronological Summary** — Dense technical timeline of everything that happened: every decision, change, problem, discovery, and outcome in turn order. As concise as possible while capturing maximum events.
---
## Step 2 — Ask Time Range
Use `AskUserQuestion` to ask:
> **How far back should sessions be included?**
>
> - **48 hours** (default — last 2 days)
> - **1 week** (168 hours)
> - **1 month** (720 hours)
> - **Custom** — enter any natural language like "3 days", "2 weeks", "5 hours", "since Monday"
Convert their answer to hours for `--since <N>`:
- "3 days" → `72`
- "2 weeks" → `336`
- "5 hours" → `5`
- "since Monday" → calculate hours from now to last Monday
---
## Step 3 — Spawn Agent
```
Agent(
description: "Session analysis - Goal <N>: <name>",
prompt: "Run session analysis for the current project. Execute:
bun run $HOME/eon/cc-skills/plugins/devops-tools/scripts/session-debrief.ts \\
--goal <1|2|3> \\
--since <hours> \\
--verbose
Print all output exactly as-is. Do not filter or summarize.
If the command fails, show the full error and suggest troubleshooting.",
run_in_background: true
)
```
**Do NOT add `--shots` — it only applies to legacy 50-perspectives mode.**
When the Agent returns, present the output directly to the user with no additional summarization — the MiniMax output IS the result.
---
# Session Blind Spots — Reference
> **Self-Evolving Skill**: This skill improves through use. If instructions are wrong, parameters drifted, or a workaround was needed — fix this file immediately, don't defer. Only update for real, reproducible issues.
## The Three Goals
### Goal 1: Handoff Document
The most comprehensive output mode. Extracts everything the next developer or AI session needs to continue work without asking questions.
Output structure:
- **WHAT WAS ACCOMPLISHED** — every completed task, file, command (exhaustive)
- **CURRENT STATE** — what works right now, what was modified
- **INCOMPLETE / BROKEN** — unfinished items, unresolved errors, deferred work
- **KEY DECISIONS & RATIONALE** — why things were done this way
- **CRITICAL GOTCHAS & CONTEXT** — non-obvious facts, workarounds, landmines
- **NEXT STEPS (PRIORITY ORDER)** — concrete actions to start next session with
If the session history spans more than MiniMax's context window (~260K tokens), the script automatically chunks by session and produces multiple parts.
### Goal 2: Error Forensics
Every warning, error, and anomaly — especially the ones Claude moved past.
Each finding includes:
- Exact turn number
- Trigger (command/tool that caused it)
- File/path involved
- Complete verbatim error text (not paraphrased)
- Resolution status: UNRESOLVED / PARTIAL / RESOLVED
- What Claude did (acknowledged? ignored? deferred?)
### Goal 3: Chronological Summary
Dense technical timeline: one bullet per significant event, in turn order.
- Groups into phases when clear phases emerge
- Marks unresolved errors with ⚠
- Captures decisions + rationale
- Ends with **Key Outcomes** (3-7 most important results)
---
## How Sessions Are Discovered
The script automatically finds all sessions for the **current project** (derived from the working directory) modified within the time window:
1. Scans `~/.claude/projects/<project-key>/` for `.jsonl` files
2. Includes files modified within the `--since` window
3. For each session, follows parent chains (continuation sessions) for full context
4. Sorts chronologically (oldest first) for coherent narrative
The project key is the absolute path with `/` replaced by `-`. For example:
`/Users/terryli/eon/cc-skills` → `-Users-terryli-eon-cc-skills`
---
## Script Invocation Reference
```bash
# Focused goal mode — recommended
bun run $HOME/eon/cc-skills/plugins/devops-tools/scripts/session-debrief.ts \
--goal 1 --since 48 # Handoff: last 48 hours
--goal 2 --since 168 # Error forensics: last week
--goal 3 --since 720 # Summary: last month
# Debug: show extracted payload without calling MiniMax
bun run $HOME/eon/cc-skills/plugins/devops-tools/scripts/session-debrief.ts \
--goal 1 --since 48 --dry --verbose
# Override project dir (if auto-detection fails)
bun run $HOME/eon/cc-skills/plugins/devops-tools/scripts/session-debrief.ts \
--goal 2 --since 48 --project-dir ~/.claude/projects/-Users-foo-myrepo
# Skip parent chain tracing (faster, current window only)
bun run $HOME/eon/cc-skills/plugins/devops-tools/scripts/session-debrief.ts \
--goal 3 --since 48 --no-chain
# Legacy 50-perspectives mode (single session UUID)
bun run $HOME/eon/cc-skills/plugins/devops-tools/scripts/session-debrief.ts \
<session-uuid>
```
---
## Configuration
| Setting | Source | Default |
| ------------------- | ---------------------------------------------------------------- | ------------------------- |
| MiniMax API key | `~/.claude/.secrets/ccterrybot-telegram` (`MINIMAX_API_KEY=...`) | Required |
| Model | `MINIMAX_MODEL` env var (global mise config) | `MiniMax-M2.7-highspeed` |
| Max output tokens | Hardcoded | 16384 per call |
| Context budget | Hardcoded | 890K chars (~243K tokens) |
| Default time window | `--since` | 48 hours |
| Session chaining | `--no-chain` to disable | Enabled |
---
## Find Recent Sessions (Manual)
```bash
# Sessions for current project (key = cwd with / replaced by -)
ls -lt ~/.claude/projects/$(pwd | tr '/' '-')/*.jsonl 2>/dev/null | head -10
# All projects, most recent first
ls -lt ~/.claude/projects/*/*.jsonl 2>/dev/null | head -20
```
---
## Troubleshooting
| Issue | Cause | Fix |
| ------------------------------ | ------------------------------- | ------------------------------------------------------ |
| `Cannot determine project dir` | CWD not a known project | Use `--project-dir ~/.claude/projects/<key>` |
| `No sessions found` | No sessions in time window | Increase `--since` (e.g., `--since 336` for 2 weeks) |
| `MINIMAX_API_KEY not found` | Missing secrets file | Check `~/.claude/.secrets/ccterrybot-telegram` |
| `context window exceeds` | Single session too large | Use `--dry --verbose` to check size; try `--no-chain` |
| Goal 1 produces multiple parts | Sessions exceeded single budget | Expected behavior — multiple chunks = maximum coverage |
## Post-Execution Reflection
After this skill completes, reflect before closing the task:
0. **Locate yourself.Related in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.