Analyze coding agent session transcripts to improve existing skills or create new ones. Use when asked to improve a skill based on a session, or extract a new skill from session history.
Analyze coding agent sessions to improve or create skills. Works with Claude Code and Codex.
Extract the current session and generate an improvement prompt:
# Auto-detect agent and extract current session
./scripts/extract-session.js
The extract-session.js script finds and parses session files:
# Auto-detect (uses most recent session for current working directory)
./scripts/extract-session.js
# Specify agent type
./scripts/extract-session.js --agent claude
./scripts/extract-session.js --agent codex
# Specify a different working directory
./scripts/extract-session.js --cwd /path/to/project
Session file locations:
~/.claude/projects/<encoded-cwd>/*.jsonl~/.codex/sessions/YYYY/MM/DD/*.jsonlWhen asked to improve a skill based on a session:
Extract the session transcript:
./scripts/extract-session.js > /tmp/session-transcript.txt
Find the existing skill in one of these locations:
~/.claude/skills/<skill-name>/SKILL.md~/.codex/skills/<skill-name>/SKILL.mdGenerate an improvement prompt for a new session:
═══════════════════════════════════════════════════════════════════════════════
COPY THE FOLLOWING PROMPT INTO A NEW AGENT SESSION:
═══════════════════════════════════════════════════════════════════════════════
I need to improve the "<skill-name>" skill based on a session where I used it.
First, read the current skill at: <path-to-skill>
Then analyze this session transcript to understand:
- Where I struggled to use the skill correctly
- What information was missing from the skill
- What examples would have helped
- What I had to figure out on my own
<session_transcript>
<paste transcript here>
</session_transcript>
Based on this analysis, improve the skill by:
1. Adding missing instructions or clarifications
2. Adding examples for common use cases discovered
3. Fixing any incorrect guidance
4. Making the skill more concise where possible
Write the improved skill back to the same location.
═══════════════════════════════════════════════════════════════════════════════
When asked to create a new skill from a session:
Extract the session transcript:
./scripts/extract-session.js > /tmp/session-transcript.txt
Generate a creation prompt for a new session:
═══════════════════════════════════════════════════════════════════════════════
COPY THE FOLLOWING PROMPT INTO A NEW AGENT SESSION:
═══════════════════════════════════════════════════════════════════════════════
Analyze this session transcript to extract a reusable skill called "<skill-name>":
<session_transcript>
<paste transcript here>
</session_transcript>
Create a new skill that captures:
1. The core capability or workflow demonstrated
2. Key commands, APIs, or patterns used
3. Common pitfalls and how to avoid them
4. Example usage for typical scenarios
Write the skill to: ~/.claude/skills/<skill-name>/SKILL.md
Use this format:
---