session-debug

session-debug is a skill for Claude Code, Codex from hoangsonww/Claude-Code-Agent-Monitor. It costs 92 tokens per session (682 once invoked), scanned A, original, MIT.

A session investigation tool for Claude Code that examines a session’s events, agents, timing, token use, costs, and workflow data. A session is one run of the coding agent.

In plain words
What is it for?
Use it to inspect a specific, latest, or errored session and identify its lifecycle, event chain, agent hierarchy, and cost.
Why use it?
It brings the full record of a run together so you can understand failures, delays, token use, and how subagents contributed.

Skill for Claude CodeCodex

Written for Claude Code and Codex: $ARGUMENTS substitution, but also agents/openai.yaml present. Also seen: mentions subagents; mentions Claude Code.

Part of the ccam-devtools plugin — 6 skills, 3 commands, 2 agents shipped together

Good fit Use it to inspect a specific, latest, or errored session and identify its lifecycle, event chain, agent hierarchy, and cost.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/hoangsonww/claude-code-agent-monitor/session-debug
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add hoangsonww/Claude-Code-Agent-Monitor --skill session-debug
Clone the repo
git clone --depth 1 https://github.com/hoangsonww/Claude-Code-Agent-Monitor

Made for: Claude Code, Codex.

Or install ccam-devtools, the plugin that ships this one along with the rest of its 6 skills, 3 commands, 2 agents.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for session-debug

README.md
[![agentmods](https://agentmods.dev/badge/skills/hoangsonww/claude-code-agent-monitor/session-debug/github.svg)](https://agentmods.dev/skills/hoangsonww/claude-code-agent-monitor/session-debug)
Your own site
<a href="https://agentmods.dev/skills/hoangsonww/claude-code-agent-monitor/session-debug"><img src="https://agentmods.dev/badge/skills/hoangsonww/claude-code-agent-monitor/session-debug/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for session-debug

Your own site · 80×15
<a href="https://agentmods.dev/skills/hoangsonww/claude-code-agent-monitor/session-debug"><img src="https://agentmods.dev/badge/skills/hoangsonww/claude-code-agent-monitor/session-debug.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 92 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 682 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00092 $0.00682
Opus 5 $0.00046 $0.00341
Sonnet 5 $0.00018 $0.00136
Haiku 4.5 $0.00009 $0.00068

Measured 6d ago against content hash 0589cebc893c, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

session-debug scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/ccam-devtools/skills/session-debug/SKILL.md · 80 lines

How it starts

The opening of the file, as written. The whole thing — 80 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Session Debug

Debug and inspect a Claude Code session from Agent Monitor data.

Input

The user provides: $ARGUMENTS

This may be:

  • A session ID to debug
  • "latest" or "last" for the most recent session
  • "errors" to find and debug the most recent errored session

Procedure

  1. Identify the target session:

    • If session ID given: GET /api/sessions/{id} from http://localhost:4820
    • If "latest": GET /api/sessions?limit=1 (default sort: most recently updated first)
    • If "errors": GET /api/sessions?limit=10&status=error
  2. Collect full session data:

    • Session metadata: status, model, cwd, timestamps, duration
    • Events: GET /api/events?session_id={session_id} — full event timeline
    • Agents: GET /api/agents?session_id={session_id} — all agents in session
    • Cost: GET /api/pricing/cost/{session_id}
  3. Analyze the session:

    Session Lifecycle

    • Start time → first event → last event → end time
    • Status transitions (active → working → completed/error)
    • Total duration and active-vs-idle time

    Event Chain Analysis

    • Chronological event list with timestamps and durations
    • Identify the critical path (longest chain of dependent events)
    • Flag events that took unusually long
    • Highlight error events with full error context

    Agent Inspection

    • List all agents: type, task, status, duration
    • Subagent tree visualization (parent → children)
    • Agents that failed and their last known state
    • Agent switching patterns (when and why new agents spawned)

    Tool Execution Trace

    • Every tool invocation in order with: tool name, duration, success/failure
    • Failed tool calls with error messages
    • Tool retry patterns (same tool called multiple times)

    Anomaly Detection

    • Events out of expected order
    • Gaps in event timeline (>30s with no events)
    • Duplicate events or agent states
    • Token usage spikes (compaction indicators)
  4. Diagnosis:

    • Root cause hypothesis (if errors present)
    • Contributing factors
    • Remediation suggestions

Read the full file on GitHub · 80 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 6d ago First seen · 80 lines · 92 tokens per session scan A 0589cebc893c

Subscribe to this mod's changes

session-debug is a skill published in the GitHub repository hoangsonww/Claude-Code-Agent-Monitor (987 stars, last pushed yesterday), licensed MIT. It adds 92 tokens to every session and 682 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.