Skip to main content
skill CX Codex

session-compare — Claude Code skill: compare sessions

Compare two Agent Monitor sessions across cost, tokens, events, and agent activity. Use it to see what changed between runs with different outcomes.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add hoangsonww/Claude-Code-Agent-Monitor --skill session-compare -a claude-code
Open on GitHub

What session-compare does

The skill builds a side-by-side report from two Agent Monitor sessions. It compares status, model, duration, cost, event and error counts, and tools used. Token details include input, output, cache reads, and cache writes; cost figures come from the pricing engine.

The report also covers event timelines, tool usage differences, and agent activity. It examines decisions that may have contributed to different outcomes and lists takeaways for future runs. The skill queries the Agent Monitor API at http://localhost:4820, so that service must be available for the comparison.

Provide two session IDs, ask for “best vs worst” or “latest 2,” or compare one session with the average of the last 50 sessions. The average comparison uses that specific group of sessions.

What it helps with

  • compare token use and cost across two sessions
  • spot tools used in only one run
  • contrast error counts and subagent success rates
  • locate where two event timelines diverged
  • measure one session against the latest 50-session average

Example prompts for the agent

  • Compare sessions abc123 and def456 by cost, tokens, and outcome.
  • Find the most and least productive sessions and explain the differences.
  • Compare the two latest sessions and show where their timelines diverged.

How to install session-compare

1Skills CLI (Vercel)

npx skills add hoangsonww/Claude-Code-Agent-Monitor --skill session-compare -a claude-code

2Manually: put the files in place

~/.claude/skills/session-compare/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/session-compare/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about session-compare

How do I install session-compare in Claude Code?

Run npx skills add hoangsonww/Claude-Code-Agent-Monitor --skill session-compare -a claude-code. The skill file is placed at ~/.claude/skills/session-compare/SKILL.md.

What does session-compare do?

It creates a side-by-side report for two Agent Monitor sessions, covering cost, tokens, tools, errors, events, and agent activity. The report also identifies differences that may explain the outcomes and gives takeaways for later runs.

Which sessions can I compare?

Give it two IDs, ask for “best vs worst” or “latest 2,” or compare one ID with “vs average.” The average is calculated from the last 50 sessions.

Source text

SKILL.md · MIT
---
name: session-compare
description: >
  Compare two sessions side-by-side using Agent Monitor data — per-model
  token usage (input/output/cache_read/cache_write + compaction baselines),
  pricing engine cost breakdowns, workflow intelligence (complexity scores,
  tool flow transitions, subagent effectiveness), session metadata
  (thinking_blocks, turn_count, turn_duration_ms, usage_extras), and
  full event timelines with all 10+ event types.
---

# Session Compare

Compare two Claude Code sessions side-by-side using Agent Monitor data.

## Input

The user provides: **$ARGUMENTS**

This may be:
- Two session IDs: "abc123 def456"
- "best vs worst" — compare highest and lowest productivity sessions
- "latest 2" — compare the two most recent sessions
- A session ID + "vs average" — compare one session against the baseline

## Procedure

1. **Identify sessions to compare**:
   - If two IDs given: fetch both from `http://localhost:4820/api/sessions/{id}`
   - If "best vs worst": fetch sessions, score by completion + cost efficiency, pick extremes
   - If "latest 2": `GET /api/sessions?limit=2` (default sort: most recently updated first)
   - If "vs average": fetch session + compute averages from last 50 sessions

2. **Gather detailed data** for each session:
   - Session metadata: `GET /api/sessions/{id}`
   - Events: `GET /api/events?session_id={id}`
   - Agents: `GET /api/agents?session_id={id}`
   - Cost: `GET /api/pricing/cost/{id}`

3. **Build comparison**:

   ### Overview Comparison
   | Metric | Session A | Session B | Difference |
   |--------|-----------|-----------|-----------|
   | Status | completed | error | — |
   | Model | sonnet-4 | sonnet-4 | same |
   | Duration | 12m 34s | 45m 12s | +32m 38s |
   | Total Cost | $0.0234 | $0.1456 | +522% |
   | Events | 45 | 187 | +315% |
   | Tools Used | 8 | 12 | +4 |
   | Error Count | 0 | 7 | +7 |
   | Agents | 2 | 5 | +3 |

   ### Token Comparison
   | Token Type | Session A | Session B | Difference |
   |-----------|-----------|-----------|-----------|
   | Input | N | N | ±N% |
   | Output | N | N | ±N% |
   | Cache Read | N | N | ±N% |
   | Cache Write | N | N | ±N% |
   | Efficiency | N% | N% | ±N% |

   ### Tool Usage Comparison
   - Tools unique to Session A
   - Tools unique to Session B
   - Shared tools with usage count comparison
   - Error rate per tool in each session

   ### Timeline Comparison
   - Side-by-side event timeline
   - Where sessions diverged in approach
   - Key decision points that led to different outcomes

   ### Agent Activity Comparison
   - Agent counts and types
   - Subagent strategy differences
   - Agent success rates

4. **Analysis**:
   - Why one session was more efficient/successful than the other
   - Key decisions that made the difference
   - Lessons to apply to future sessions

## Output Format

Present as a side-by-side comparison report with:
- Executive comparison summary (which session was "better" and why)
- Structured comparison tables with color-coded differences (green = better, red = worse)
- A "Lessons Learned" section with actionable takeaways
- Overall winner declaration with justification

© hoangsonww · MIT · hoangsonww/Claude-Code-Agent-Monitor

Similar skills

All skills for Agent setup: memory, context, orchestration →

From the same set60

config-explorer Inspects and edits Claude Code and Codex settings through CCAM with timestamped backups. Useful for auditing hooks, memory, rules, and MCP servers. CX Codex +1 ★ 1,121repo stars webhook-management Configure CCAM webhook targets, connect them to alert rules, and inspect delivery records. Use the skill when managing notification endpoints from the CLI. CX Codex +1 ★ 1,121repo stars remote-collection A skill that walks the agent through CCAM remote data sources: connect machines over SSH and pull Claude and Codex history. Useful when sessions live beyond your laptop. CX Codex +1 ★ 1,121repo stars alert-management Inspects fired CCAM alerts and manages monitoring rules for token thresholds, inactivity, and status duration. CX Codex +1 ★ 1,121repo stars regression-watch Compares an older baseline window of session history with a recent one and reports which metrics got worse: errors, cache, compactions, cost per session. CX Codex +1 ★ 1,121repo stars pattern-detect Analyzes agent sessions via Agent Monitor to find recurring tool sequences, error cascades, and delegation habits. Generates a ranked report with recommendations. CX Codex +1 ★ 1,121repo stars optimization-suggest This skill reviews Claude Code session history and ranks ways to cut costs, improve speed, and prevent errors. Use it to plan changes based on recorded activity. CX Codex +1 ★ 1,121repo stars benchmark The benchmark skill takes one session or a few recent ones and compares them with the rolling average from Agent Monitor data: cost, tokens, tool count and workflow complexity. Each metric comes back as a percentile of the population. CX Codex +1 ★ 1,121repo stars

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor