Loading...
Loading...
Analyze Claude Code session transcripts to improve existing skills or create new ones. Use when you want to review a past session to identify what worked, what didn't, and how to enhance skill documentation. Extracts session data and provides structured analysis prompts. Triggers on "improve skill", "analyze session", "review session", "skill improvement", "create skill from session", "skill not working", "skill missed", "skill didn't trigger", "enhance skill", "refine skill", "skill feedback", "session transcript", "what went wrong", "skill optimization", "better triggers".
npx skill4agent add mauromedda/agent-toolkit improve-skill1. Run web-automation to debug/automate
(this is the "doing" phase)
2. Save session transcript
3. Use improve-skill to analyze what happened
(this is the "learning" phase)
4. Update skill documentation based on findings
5. Next time, your updated skill helps you work faster┌─────────────────────────────────────────────────────────────┐
│ SESSION RESUMED - IMPROVE-SKILL VERIFICATION │
│ │
│ Before continuing skill improvement work: │
│ │
│ 1. Was I in the middle of session analysis? │
│ → Check /tmp/ for extracted transcripts │
│ → Check summary for "analyzing", "extracting" │
│ │
│ 2. Was I updating a skill? │
│ → Check which skill was being modified │
│ → Run: uv run validate_skill.py on the skill │
│ │
│ 3. Did the previous work complete? │
│ → Check todo list for pending analysis tasks │
│ → Verify skill validation passed │
│ │
│ If analysis was in progress: │
│ → Re-run the extraction/analysis scripts │
│ → Do NOT assume previous analysis is still valid │
└─────────────────────────────────────────────────────────────┘| Script | Purpose |
|---|---|
| Extract session transcript to markdown |
| Analyze session for skill improvements |
--helpuv run ~/.claude/skills/improve-skill/scripts/extract_session.py --help# Step 1: Extract the session transcript
uv run ~/.claude/skills/improve-skill/scripts/extract_session.py \
--session-id <session-id> \
--output /tmp/session.md
# Step 2: Analyze for improvements
uv run ~/.claude/skills/improve-skill/scripts/analyze_session.py \
--transcript /tmp/session.md \
--skill ~/.claude/skills/<skill-name>/SKILL.md \
--output /tmp/analysis.mdReview the analysis in /tmp/analysis.md and update the skill accordingly.# Step 1: Extract the session
uv run ~/.claude/skills/improve-skill/scripts/extract_session.py \
--session-id <session-id> \
--output /tmp/session.md
# Step 2: Generate skill creation prompt
uv run ~/.claude/skills/improve-skill/scripts/analyze_session.py \
--transcript /tmp/session.md \
--create-skill \
--output /tmp/new_skill_prompt.md# List recent sessions
uv run ~/.claude/skills/improve-skill/scripts/extract_session.py --list
# Extract most recent session for current directory
uv run ~/.claude/skills/improve-skill/scripts/extract_session.py --latest
# Extract most recent session for a specific project
uv run ~/.claude/skills/improve-skill/scripts/extract_session.py \
--latest \
--cwd /path/to/project/tasksuv run ~/.claude/skills/improve-skill/scripts/extract_session.py --list| Pattern | What to Look For |
|---|---|
| Confusion | Where did the agent struggle or misunderstand? |
| Missing Info | What information was needed but not in the skill? |
| Workarounds | What manual steps were needed that could be automated? |
| Errors | What errors occurred and how were they resolved? |
| Success | What approaches worked well and should be documented? |
| Wrong Skill | Was a different skill more appropriate? |
## Session Analysis
### What Worked Well
- [List of successful approaches]
### Issues Identified
- [List of problems encountered]
### Recommended Improvements
- [Specific changes to make to the skill]
### Missing Documentation
- [Information that should be added]usage: extract_session.py [-h] [--list] [--latest] [--session-id SESSION_ID]
[--cwd CWD] [--output OUTPUT]
Extract Claude Code session transcripts to markdown
options:
-h, --help show this help message and exit
--list List all available sessions
--latest Extract most recent session
--session-id SESSION_ID, -s SESSION_ID
Extract specific session by ID
--cwd CWD Filter sessions by working directory
--output OUTPUT, -o OUTPUT
Save transcript to file (default: stdout)
Examples:
uv run extract_session.py --list
uv run extract_session.py --latest --output /tmp/session.md
uv run extract_session.py --session-id abc123 --output /tmp/session.mdusage: analyze_session.py [-h] --transcript TRANSCRIPT [--skill SKILL]
[--create-skill] [--quick] [--output OUTPUT]
Analyze Claude Code session transcripts for skill improvement
options:
-h, --help show this help message and exit
--transcript TRANSCRIPT, -t TRANSCRIPT
Path to the session transcript markdown file (required)
--skill SKILL, -s SKILL
Path to existing skill SKILL.md to improve
--create-skill Generate prompt for creating a new skill
--quick Quick analysis summary only (no full prompt)
--output OUTPUT, -o OUTPUT
Output file path (default: stdout)
Examples:
# Quick analysis
uv run analyze_session.py --transcript /tmp/session.md
# Improve existing skill
uv run analyze_session.py --transcript /tmp/session.md \
--skill ~/.claude/skills/web-automation/SKILL.md
# Create new skill
uv run analyze_session.py --transcript /tmp/session.md --create-skill
# Save analysis to file
uv run analyze_session.py --transcript /tmp/session.md --output /tmp/analysis.md