my-session-wrap/skills/session-analyzer/SKILL.md
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.
npx skillsauth add ahnbu/my-claude-plugins session-analyzerInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Post-hoc analysis tool for validating Claude Code session behavior against SKILL.md specifications.
Analyze completed sessions to verify:
| 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 |
DB에서 세션 메타 조회:
node ~/.claude/my-claude-plugins/shared/query-sessions.js get <sessionId>
# → file_path 필드로 소스 파일 위치 확인
이후 분석에 필요한 파일:
# Debug log (detailed)
~/.claude/debug/{sessionId}.txt
# Agent transcripts (if subagents were used)
# → file_path 기반으로 같은 디렉토리의 agent-{agentId}.jsonl 탐색
Check all required files exist before proceeding. If debug log is missing, analysis will be limited.
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 useFrom Markdown Body:
Task(subagent_type="..."))Skill("...")).dev-flow/drafts/, .dev-flow/plans/, etc.)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
The debug log (~/.claude/debug/{sessionId}.txt) contains detailed execution traces.
Search patterns:
SubagentStart with query: {agent-name}
SubagentStop with query: {agent-id}
Use script:
node scripts/extract-subagent-calls.mjs {debug-log-path}
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:
node scripts/extract-hook-events.mjs {debug-log-path}
Search patterns:
executePreToolHooks called for tool: {tool-name}
File {path} written atomically
For prompt-based hooks, find the model response:
Hooks: Model response: {
"ok": true/false,
"reason": "..."
}
For each expected artifact:
FileHistory: Tracked file modification for {path}File {path} written atomicallyFor files that should be deleted:
rm commands in Bash calls| 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) | ✅ |
Flag any mismatches:
# 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]
| Script | Purpose |
|--------|---------|
| extract-subagent-calls.mjs | Parse subagent invocations from debug log |
| extract-hook-events.mjs | Parse hook events from debug log |
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
references/analysis-patterns.md - Detailed grep patterns for log analysisreferences/common-issues.md - Known issues and troubleshootingscripts/extract-subagent-calls.mjs - SubAgent call extractorscripts/extract-hook-events.mjs - Hook event extractortools
스킬별 컨텍스트 소모량 리포트. 각 스킬 호출이 cp%를 얼마나 소모하는지 집계. Triggers: 'skill-context', 'skill context', '스킬 컨텍스트', '스킬 소모', '컨텍스트 비용'
tools
--- name: session-timeline description: Generate a per-session execution timeline from Claude Code JSONL logs. Triggers: "session timeline", "세션 타임라인", "소요시간 정리", "tool wait", "turn_duration". --- # Session Timeline 특정 Claude Code 세션 ID의 시간축을 복원한다. ## Workflow 1. `sessionId`를 받는다. 2. `scripts/session_timeline.js`를 실행해 timeline을 생성한다. 3. 기본은 markdown, 분석 파이프라인 연결 시 `--format json`을 사용한다. 4. 대형 `tool_result`는 원문 대신 persisted output 경로와 요약만 유지한다. ## Command ```bash node skills/session-timelin
tools
세션 마무리: handoff 문서 저장 + git commit. /wrap 슬래시 명령어로만 실행.
development
This skill should be used when user wants to access, capture, or reference Claude Code session history. Trigger when user says "capture session", "save session history", or references past/current conversation as a source - whether for saving, extracting, summarizing, or reviewing. This includes any mention of "what we discussed", "today's work", "session history", or when user treats the conversation itself as source material (e.g., "from our conversation").