analyze-agent-sessions

Analyzes Codex and Claude Code session logs to reconstruct prior work and identify patterns.

Updated Mar 29, 2024
One-click install
npx skills add https://github.com/petobens/ai-harness --skill analyze-agent-sessions-petobens
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: analyze-agent-sessions
Source: https://github.com/petobens/ai-harness/tree/main/skills/analyze-agent-sessions
Command: npx skills add https://github.com/petobens/ai-harness --skill analyze-agent-sessions-petobens

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve? AI coding agents leave behind scattered JSONL session logs that are hard to search and interpret. This Skill normalizes those logs so you can reconstruct what happened in past sessions, compare approaches, and learn from recurring patterns or failures. ## Core Features & Use Cases - Session Reconstruction: Rebuild the goals, decisions, and outcomes of named Codex or Claude Code sessions from their JSONL transcripts. - Cross-Session Pattern Analysis: Explore recurring topics, preferences, workflows, and changes over time across many sessions, with deduplication of forked transcripts. - Failure and Workaround Analysis: Trace attempted actions, failures, diagnoses, and successful workarounds to derive durable improvements for agent guidance. - Use Case: Ask what your agent did last week on a specific project, filter sessions by working directory and topic, and receive an evidence-backed summary with coverage caveats. ## Quick Start Analyze my Codex and Claude Code sessions from the past week and summarize the recurring themes and decisions.

Frequently Asked Questions about analyze-agent-sessions

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I analyze past Claude Code or Codex sessions?

Run the bundled extract_sessions.py script with a session ID, or use --since with a date to scan recent sessions. It normalizes JSONL logs from ~/.codex/sessions and ~/.claude/projects into user/assistant messages, tool calls, and tool results for analysis.

How to filter agent session logs by project or topic?

Use the --cwd flag to filter sessions by working directory and --grep with a case-insensitive pattern to match event text. Combine with --paths-only to list matching session files first, then rerun the extractor on those paths.

Where are Codex and Claude Code session logs stored?

Codex stores JSONL session files under ~/.codex/sessions, while Claude Code stores them under ~/.claude/projects. The extractor searches both roots by default and detects the agent format automatically.

Does session analysis include subagent sessions?

Broad scans exclude subagent sessions by default so user-facing sessions remain the unit of analysis. Pass --include-subagents to include delegated sessions, and explicitly named subagent sessions are always read.

Why might session analysis miss older sessions?

Local pruning can delete older session files, making absence of a match inconclusive. Run the extractor with --coverage to report retained session counts and date ranges before claiming a time window is comprehensive.