# Error Scan

> >

- **Type:** Skill
- **Install:** `agentstack add skill-hoangsonww-claude-code-agent-monitor-error-scan`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [hoangsonww](https://agentstack.voostack.com/s/hoangsonww)
- **Installs:** 0
- **Category:** [Databases](https://agentstack.voostack.com/c/databases)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [hoangsonww](https://github.com/hoangsonww)
- **Source:** https://github.com/hoangsonww/Claude-Code-Agent-Monitor/tree/master/plugins/ccam-quality/skills/error-scan
- **Website:** https://hoangsonww.github.io/Claude-Code-Agent-Monitor/

## Install

```sh
agentstack add skill-hoangsonww-claude-code-agent-monitor-error-scan
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# Error Scan

Sweep recent events across sessions for error and failure signals, then rank them
by how often they occur and which tool or model produced them.

## Input

The user provides: **$ARGUMENTS**

This may be:
- empty or "all" — scan every failure signal (default)
- "api" — APIError events only
- "tools" — tool-failure gaps only
- a number N — limit the scan to the most recent N sessions
- a session ID — scan a single session

## Data Sources

| Endpoint | Returns |
|----------|---------|
| `GET /api/analytics` | `event_types` (counts per type incl. PreToolUse, PostToolUse, APIError), `tool_usage` (top 20), `daily_events` (365d) — fleet-wide failure baseline |
| `GET /api/events?session_id=X` | Per-session event stream: `event_type`, `tool_name`, `summary`, `data`, `timestamp` — locate `APIError` and unmatched `PreToolUse` |
| `GET /api/sessions?limit=N` | Sessions with `id`, `status`, `model`, `started_at` — pick the recent window and attribute failures to a model |

## Report Sections

### 1. Scope
Resolve `$ARGUMENTS` to a session set: pull `GET /api/sessions?limit=N` (default 50, ordered by `started_at`). Report how many sessions and what time span are covered.

### 2. Fleet Failure Counts
From `GET /api/analytics` `event_types`, report total `APIError` count and the PreToolUse→PostToolUse gap: `gap = PreToolUse − PostToolUse` (unmatched tool starts = likely failures). State both as raw counts and as a share of `total_events`.

### 3. Group by Tool
For each session in scope, pull `GET /api/events?session_id=X`. Match each `PreToolUse` to its following `PostToolUse` by `tool_name`; unmatched starts are failures. Aggregate failures and `APIError` events per `tool_name`. Rank tools by failure frequency (descending).

### 4. Group by Model
Join failures to the owning session's `model` (from `GET /api/sessions`). Rank models by APIError count and tool-failure count.

### 5. Top Offenders
List the single most failure-prone tool, the most error-prone model, and the session with the most failures, each with its exact count and one-line `summary` excerpt from a representative event.

## Output

- A ranked Markdown table: tool/model | APIError count | tool-failure (gap) count | total failures | share of events.
- Rates as percentages to 2 decimals.
- Cite exact `event_type`, `tool_name`, and `session_id` values — never fabricate counts.
- End with the one failure pattern most worth investigating and a concrete next step.
- Read-only: only report what the API returns. If `curl` cannot reach `http://localhost:4820`, tell the user to start the dashboard with `npm start` from the repo root.

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [hoangsonww](https://github.com/hoangsonww)
- **Source:** [hoangsonww/Claude-Code-Agent-Monitor](https://github.com/hoangsonww/Claude-Code-Agent-Monitor)
- **License:** MIT
- **Homepage:** https://hoangsonww.github.io/Claude-Code-Agent-Monitor/

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** yes
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-hoangsonww-claude-code-agent-monitor-error-scan
- Seller: https://agentstack.voostack.com/s/hoangsonww
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
