Skip to main content
skill-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.
Jump to install Skills Marketplace Discover and explore AI skills built by the community.
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Copy promptShow prompt details A direct command skips the review prompt. Inspect the source before running it.
npx skills add https://github.com/team-attention/hoyeon --skill skill-session-analyzerThe command stays on one line. Scroll horizontally to inspect it before copying.
Prefer a local copy? Download the files currently available to SkillsMP.
Download Zip Downloading... Related occupations SOC
Based on SOC occupation classification
More from this repository Run a full implementation verification pass after code or data changes. Use
when the user asks to verify, QA, smoke test, run checks, validate a feature,
inspect a local app in the browser, capture screenshots, or turn discovered
QA issues into regression tests/checklists with user approval.
Hoyeon execution workflow for Codex. Use when the user invokes
"$hoyeon-execute" or wants to execute a Hoyeon plan.json through the
Bash-first Codex adapter. This adapter loads the canonical execute skill and
follows its Codex runtime surface.
Plan-driven orchestrator. Reads plan.json (from /blueprint) or requirements.md,
then dispatches workers to build the system.
Use when: "/execute", "execute", "plan 실행", "blueprint 실행"
name skill-session-analyzer description 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.
allowed-tools ["Read","Grep","Glob","Bash","Task","Write"]
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 sessionIdYES UUID of the session to analyze targetSkillYES Path to SKILL.md to validate against additionalRequirementsNO Extra validation criteria
Phase 1: Locate Session Files
Step 1.1: Find Session Files
Session files are located in :
~/.claude/
~/.claude/projects/-{encoded-cwd}/{sessionId}.jsonl
~/.claude/debug/{sessionId}.txt
~/.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:
hooks.PreToolUse - Expected PreToolUse hooks and matchers
hooks.PostToolUse - Expected PostToolUse hooks
hooks.Stop - Expected Stop hooks
hooks.SubagentStop - Expected SubagentStop hooks
allowed-tools - Tools the skill is allowed to use
SubAgents mentioned (Task(subagent_type="..."))
Skills called (Skill("..."))
Artifacts created (.hoyeon/drafts/, .hoyeon/specs/, 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
- [ ] plan-reviewer called after plan creation
### Hooks
- [ ] PreToolUse[Edit|Write] triggers plan-guard.sh
- [ ] Stop hook validates plan-reviewer approval
### Artifacts
- [ ] Draft file created at .hoyeon/drafts/{name}.md
- [ ] Plan file created at .hoyeon/specs/{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 SubagentStart with query: {agent-name}
SubagentStop with query: {agent-id}
${baseDir} /scripts/extract-subagent-calls.sh {debug-log-path}
Step 3.2: Extract Hook Events 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
${baseDir} /scripts/extract-hook-events.sh {debug-log-path}
Step 3.3: Extract Tool Calls 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 rm commands 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 | ✅ |
| plan-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
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.shLocate all files for a session ID extract-subagent-calls.shParse subagent invocations from debug log extract-hook-events.shParse hook events from debug log
Usage Example User: "Analyze session 3cc71c9f-d27a-4233-9dbc-c4f07ea6ec5b against .claude/skills/spec/SKILL.md"
1. Find session files
2. Parse SKILL.md → Expected: Explore, gap-analyzer, plan-reviewer, hooks
3. Analyze debug log → Extract actual calls
4. Verify artifacts → Check .hoyeon/
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 analysis
references/common-issues.md - Known issues and troubleshooting
Scripts
scripts/find-session-files.sh - Session file locator
scripts/extract-subagent-calls.sh - SubAgent call extractor
scripts/extract-hook-events.sh - Hook event extractor