session-analyzer
This skill should be used when the user asks to "analyze session", "세션 분석", "evaluate skill execution", "스킬 실행 검증", "check session logs", "로그 분석", provides a session ID with a skill path, or wants to verify that a skill executed correctly in a past session. Post-hoc analysis of Claude Code sessions to validate skill/agent/hook behavior against SKILL.md specifications.
Install
mkdir -p .claude/skills/session-analyzer && curl -L -o skill.zip "https://mcp.directory/api/skills/download/5001" && unzip -o skill.zip -d .claude/skills/session-analyzer && rm skill.zipInstalls to .claude/skills/session-analyzer
About this skill
Session Analyzer Skill
Post-hoc analysis tool for validating Claude Code session behavior against SKILL.md specifications.
Purpose
Analyze completed sessions to verify:
- Expected vs Actual Behavior - Did the skill follow SKILL.md workflow?
- Component Invocations - Were SubAgents, Hooks, and Tools called correctly?
- Artifacts - Were expected files created/deleted?
- Bug Detection - Any unexpected errors or deviations?
Input Requirements
| Parameter | Required | Description |
|---|---|---|
sessionId | YES | UUID of the session to analyze |
targetSkill | YES | Path to SKILL.md to validate against |
additionalRequirements | NO | Extra validation criteria |
Phase 1: Locate Session Files
Step 1.1: Find Session Files
Session files are located in ~/.claude/:
# Main session log
~/.claude/projects/-{encoded-cwd}/{sessionId}.jsonl
# Debug log (detailed)
~/.claude/debug/{sessionId}.txt
# Agent transcripts (if subagents were used)
~/.claude/projects/-{encoded-cwd}/agent-{agentId}.jsonl
Use script to locate files:
${baseDir}/scripts/find-session-files.sh {sessionId}
Step 1.2: Verify Files Exist
Check all required files exist before proceeding. If debug log is missing, analysis will be limited.
Phase 2: Parse Target SKILL.md
Step 2.1: Extract Expected Components
Read the target SKILL.md and identify:
From YAML Frontmatter:
hooks.PreToolUse- Expected PreToolUse hooks and matchershooks.PostToolUse- Expected PostToolUse hookshooks.Stop- Expected Stop hookshooks.SubagentStop- Expected SubagentStop hooksallowed-tools- Tools the skill is allowed to use
From Markdown Body:
- SubAgents mentioned (
Task(subagent_type="...")) - Skills called (
Skill("...")) - Artifacts created (
.dev-flow/drafts/,.dev-flow/plans/, etc.) - Workflow steps and conditions
Step 2.2: Build Expected Behavior Checklist
Create checklist from SKILL.md analysis:
## Expected Behavior
### SubAgents
- [ ] Explore agent called (parallel, run_in_background)
- [ ] gap-analyzer called before plan generation
- [ ] reviewer called after plan creation
### Hooks
- [ ] PreToolUse[Edit|Write] triggers plan-guard.sh
- [ ] Stop hook validates reviewer approval
### Artifacts
- [ ] Draft file created at .dev-flow/drafts/{name}.md
- [ ] Plan file created at .dev-flow/plans/{name}.md
- [ ] Draft file deleted after OKAY
### Workflow
- [ ] Interview Mode before Plan Generation
- [ ] User explicit request triggers plan generation
- [ ] Reviewer REJECT causes revision loop
Phase 3: Analyze Debug Log
The debug log (~/.claude/debug/{sessionId}.txt) contains detailed execution traces.
Step 3.1: Extract SubAgent Calls
Search patterns:
SubagentStart with query: {agent-name}
SubagentStop with query: {agent-id}
Use script:
${baseDir}/scripts/extract-subagent-calls.sh {debug-log-path}
Step 3.2: Extract Hook Events
Search patterns:
Getting matching hook commands for {HookEvent} with query: {tool-name}
Matched {N} unique hooks for query "{query}"
Hooks: Processing prompt hook with prompt: {prompt}
Hooks: Prompt hook condition was met/not met
permissionDecision: allow/deny
Use script:
${baseDir}/scripts/extract-hook-events.sh {debug-log-path}
Step 3.3: Extract Tool Calls
Search patterns:
executePreToolHooks called for tool: {tool-name}
File {path} written atomically
Step 3.4: Extract Hook Results
For prompt-based hooks, find the model response:
Hooks: Model response: {
"ok": true/false,
"reason": "..."
}
Phase 4: Verify Artifacts
Step 4.1: Check File Creation
For each expected artifact:
- Search debug log for
FileHistory: Tracked file modification for {path} - Search for
File {path} written atomically - Verify current filesystem state
Step 4.2: Check File Deletion
For files that should be deleted:
- Search for
rmcommands in Bash calls - Verify file no longer exists on filesystem
Phase 5: Compare Expected vs Actual
Step 5.1: Build Comparison Table
| Component | Expected | Actual | Status |
|-----------|----------|--------|--------|
| Explore agent | 2 parallel calls | 2 calls at 09:39:26 | ✅ |
| gap-analyzer | Called before plan | Called at 09:43:08 | ✅ |
| reviewer | Called after plan | 2 calls (REJECT→OKAY) | ✅ |
| PreToolUse hook | Edit\|Write matcher | Triggered for Write | ✅ |
| Stop hook | Validates approval | Returned ok:true | ✅ |
| Draft file | Created then deleted | Created→Deleted | ✅ |
| Plan file | Created | Exists (10KB) | ✅ |
Step 5.2: Identify Deviations
Flag any mismatches:
- Missing component calls
- Wrong order of operations
- Hook failures
- Missing artifacts
- Unexpected errors
Phase 6: Generate Report
Report Template
# Session Analysis Report
## Session Info
- **Session ID**: {sessionId}
- **Target Skill**: {skillPath}
- **Analysis Date**: {date}
---
## 1. Expected Behavior (from SKILL.md)
[Summary of expected workflow]
---
## 2. Skill/SubAgent/Hook Verification
### SubAgents
| SubAgent | Expected | Actual | Time | Result |
|----------|----------|--------|------|--------|
| ... | ... | ... | ... | ✅/❌ |
### Hooks
| Hook | Matcher | Triggered | Result |
|------|---------|-----------|--------|
| ... | ... | ... | ✅/❌ |
---
## 3. Artifacts Verification
| Artifact | Path | Expected State | Actual State |
|----------|------|----------------|--------------|
| ... | ... | ... | ✅/❌ |
---
## 4. Issues/Bugs
| Severity | Description | Location |
|----------|-------------|----------|
| ... | ... | ... |
---
## 5. Overall Result
**Verdict**: ✅ PASS / ❌ FAIL
**Summary**: [1-2 sentence summary]
Scripts Reference
| Script | Purpose |
|---|---|
find-session-files.sh | Locate all files for a session ID |
extract-subagent-calls.sh | Parse subagent invocations from debug log |
extract-hook-events.sh | Parse hook events from debug log |
Usage Example
User: "Analyze session 3cc71c9f-d27a-4233-9dbc-c4f07ea6ec5b against .claude/skills/specify/SKILL.md"
1. Find session files
2. Parse SKILL.md → Expected: Explore, gap-analyzer, reviewer, hooks
3. Analyze debug log → Extract actual calls
4. Verify artifacts → Check .dev-flow/
5. Compare → Build verification table
6. Generate report → PASS/FAIL with details
Additional Resources
Reference Files
references/analysis-patterns.md- Detailed grep patterns for log analysisreferences/common-issues.md- Known issues and troubleshooting
Scripts
scripts/find-session-files.sh- Session file locatorscripts/extract-subagent-calls.sh- SubAgent call extractorscripts/extract-hook-events.sh- Hook event extractor
More by team-attention
View all skills by team-attention →You might also like
flutter-development
aj-geddes
Build beautiful cross-platform mobile apps with Flutter and Dart. Covers widgets, state management with Provider/BLoC, navigation, API integration, and material design.
drawio-diagrams-enhanced
jgtolentino
Create professional draw.io (diagrams.net) diagrams in XML format (.drawio files) with integrated PMP/PMBOK methodologies, extensive visual asset libraries, and industry-standard professional templates. Use this skill when users ask to create flowcharts, swimlane diagrams, cross-functional flowcharts, org charts, network diagrams, UML diagrams, BPMN, project management diagrams (WBS, Gantt, PERT, RACI), risk matrices, stakeholder maps, or any other visual diagram in draw.io format. This skill includes access to custom shape libraries for icons, clipart, and professional symbols.
ui-ux-pro-max
nextlevelbuilder
"UI/UX design intelligence. 50 styles, 21 palettes, 50 font pairings, 20 charts, 8 stacks (React, Next.js, Vue, Svelte, SwiftUI, React Native, Flutter, Tailwind). Actions: plan, build, create, design, implement, review, fix, improve, optimize, enhance, refactor, check UI/UX code. Projects: website, landing page, dashboard, admin panel, e-commerce, SaaS, portfolio, blog, mobile app, .html, .tsx, .vue, .svelte. Elements: button, modal, navbar, sidebar, card, table, form, chart. Styles: glassmorphism, claymorphism, minimalism, brutalism, neumorphism, bento grid, dark mode, responsive, skeuomorphism, flat design. Topics: color palette, accessibility, animation, layout, typography, font pairing, spacing, hover, shadow, gradient."
godot
bfollington
This skill should be used when working on Godot Engine projects. It provides specialized knowledge of Godot's file formats (.gd, .tscn, .tres), architecture patterns (component-based, signal-driven, resource-based), common pitfalls, validation tools, code templates, and CLI workflows. The `godot` command is available for running the game, validating scripts, importing resources, and exporting builds. Use this skill for tasks involving Godot game development, debugging scene/resource files, implementing game systems, or creating new Godot components.
nano-banana-pro
garg-aayush
Generate and edit images using Google's Nano Banana Pro (Gemini 3 Pro Image) API. Use when the user asks to generate, create, edit, modify, change, alter, or update images. Also use when user references an existing image file and asks to modify it in any way (e.g., "modify this image", "change the background", "replace X with Y"). Supports both text-to-image generation and image-to-image editing with configurable resolution (1K default, 2K, or 4K for high resolution). DO NOT read the image file first - use this skill directly with the --input-image parameter.
fastapi-templates
wshobson
Create production-ready FastAPI projects with async patterns, dependency injection, and comprehensive error handling. Use when building new FastAPI applications or setting up backend API projects.
Related MCP Servers
Browse all serversUnlock seamless Figma to code: streamline Figma to HTML with Framelink MCP Server for fast, accurate design-to-code work
Official Laravel-focused MCP server for augmenting AI-powered local development. Provides deep context about your Larave
Safely connect cloud Grafana to AI agents with MCP: query, inspect, and manage Grafana resources using simple, focused o
Empower your workflows with Perplexity Ask MCP Server—seamless integration of AI research tools for real-time, accurate
Boost your productivity by managing Azure DevOps projects, pipelines, and repos in VS Code. Streamline dev workflows wit
Boost AI coding agents with Ref Tools—efficient documentation access for faster, smarter code generation than GitHub Cop
Stay ahead of the MCP ecosystem
Get weekly updates on new skills and servers.