introspect
Analyze Claude Code session logs - extract thinking blocks, tool usage stats, error patterns, debug trajectories. Triggers on: introspect, session logs, trajectory, analyze sessions, what went wrong, tool usage, thinking blocks, session history, my reasoning, past sessions, what did I do.
npx skills add majiayu000/claude-skill-registry --skill introspect --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Introspect Extract actionable intelligence from Claude Code session logs. Analyze tool usage, reasoning patterns, errors, and conversation flow to improve workflows and debug issues. ## Log File Structure ``` ~/.claude/ ├── history.jsonl # Global: all user inputs across projects ├── projects/ │ └── {project-path}/ # e.g., X--Dev-claude-mods/ │ ├── sessions-index.json # Session metadata index │ ├── {session-uuid}.jsonl # Full session transcript │ └── agent-{short-id}.jsonl # Subagent transcripts ``` ### Project Path Encoding Project paths use double-dash encoding: `X:\Dev\claude-mods` → `X--Dev-claude-mods` ```bash # Find project directory for current path project_dir=$(pwd | sed 's/[:\\\/]/-/g' | sed 's/--*/-/g') ls ~/.claude/projects/ | grep -i "${project_dir##*-}" ``` ## Entry Types in Session Files | Type | Contains | Key Fields | |------|----------|------------| | `user` | User messages | `message.content`, `uuid`, `timestamp` | | `assistant` | Claude responses | `message.content[]`, `cwd`, `gitBranch` | | `thinking` | Reasoning blocks | `thinking`, `signature` (in content array) | | `tool_use` | Tool invocations | `name`, `input`, `id` (in content array) | | `tool_result` |
- Log File Structure
- Project Path Encoding
- Entry Types in Session Files
- Core Analysis Patterns
- List Sessions for Current Project
- Session Overview
- Tool Usage Statistics
- Extract Thinking Blocks
- Error Analysis
- Search Across Sessions
- Conversation Flow Reconstruction
- Subagent Analysis
- Advanced Analysis
- Token/Cost Estimation
Find project directory for current path
ls ~/.claude/projects/ | grep -i "${project_dir##*-}"
Get sessions index
cat ~/.claude/projects/X--Dev-claude-mods/sessions-index.json | jq '.'
List session files with sizes and dates
ls -lah ~/.claude/projects/X--Dev-claude-mods/*.jsonl | grep -v agent
Entry type distribution
jq -r '.type' ~/.claude/projects/$PROJECT/$SESSION.jsonl | sort | uniq -c
Session duration (first to last timestamp)
jq -s '[.[].timestamp // .[].message.timestamp | select(.)] | [min, max] | map(. / 1000 | strftime("%Y-%m-%d %H:%M"))' \What does the introspect skill do?
Analyze Claude Code session logs - extract thinking blocks, tool usage stats, error patterns, debug trajectories. Triggers on: introspect, session logs, trajectory, analyze sessions, what went wrong, tool usage, thinking blocks, session history, my reasoning, past sessions, what did I do.
How do I install it?
Run `npx skills add majiayu000/claude-skill-registry --skill introspect --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From majiayu000/claude-skill-registry, a repository with 534 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
