# delegation-audit

delegation-audit is a Claude Code skill that reviews which models handled each subagent type and how those assignments performed. It flags weak results, repeated failures, and possible model mismatches.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf (Devin Desktop), Claude.ai · ★ 1198 repo stars
- Author: Son Nguyen
- License: MIT · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/hoangsonww/Claude-Code-Agent-Monitor/tree/HEAD/plugins/ccam-workflows/skills/delegation-audit/SKILL.md
- Updated: 2026-10-23
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/skills/delegation-audit

## What it does

For a session, the skill builds a model-by-subagent matrix and reports counts, success rates, and average durations by type. If you provide no session ID, it fetches the latest session and identifies it in the report.

The audit calls out low-yield types, repeated unsuccessful runs, and cases where a heavier model handled simple work. It suggests reassignment only when the session data supports it. The workflow uses the Agent Monitor API and needs the dashboard to be reachable; if it is not, the instructions say to run `npm start` from the repository root. It does not derive success rates when the `effectiveness` data does not provide them.

## Install

### Claude Code (native platform)

1. **Plugin marketplace**
In the agent chat (not a shell):
```text
/plugin marketplace add hoangsonww/Claude-Code-Agent-Monitor
```
In the agent chat (not a shell):
```text
/plugin install ccam-workflows@claude-code-agent-monitor-plugins
```
This installs the whole ccam-workflows plugin with all its skills

2. **Skills CLI (Vercel)**
```bash
npx skills add hoangsonww/Claude-Code-Agent-Monitor --skill delegation-audit -a claude-code
```

3. **Manually: put the files in place**
- File: `~/.claude/skills/delegation-audit/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/delegation-audit/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add hoangsonww/Claude-Code-Agent-Monitor --skill delegation-audit -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/delegation-audit/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add hoangsonww/Claude-Code-Agent-Monitor --skill delegation-audit -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/delegation-audit/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install hoangsonww/Claude-Code-Agent-Monitor plugins/ccam-workflows/skills/delegation-audit
```

2. **Manually: put the files in place**
- File: `.github/skills/delegation-audit/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add hoangsonww/Claude-Code-Agent-Monitor --skill delegation-audit -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/hoangsonww/Claude-Code-Agent-Monitor --path plugins/ccam-workflows/skills/delegation-audit
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/delegation-audit/SKILL.md` — The legacy .windsurf/skills/ path still works

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/hoangsonww/Claude-Code-Agent-Monitor/tree/HEAD/plugins/ccam-workflows/skills/delegation-audit/SKILL.md

## When to use it
- map models to subagent types in a session
- spot subagent types with low success rates
- find repeated unsuccessful delegations
- review heavy-model assignments for simple tasks

## Example prompts
- Audit delegation for session `SESSION_ID` and show the model-to-subagent matrix.
- Review the latest session and compare success rates across subagent types.
- Find repeated failed delegations in session `SESSION_ID` and suggest evidence-backed model changes.

## Source text · SKILL.md · MIT

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: 383480da1eea13a3.

BEGIN THIRD-PARTY FILE 383480da1eea13a3
```text
---
name: delegation-audit
description: >
  Audit model delegation and subagent effectiveness for a session — which
  models handled which subagent types, per-type success rates and average
  durations, and wasted delegations (heavy models on trivial work or types
  that consistently fail) — using the Agent Monitor workflow intelligence API.
  Use when reviewing how a session delegated work across models and subagents.
---

# Delegation Audit

Audit how a Claude Code session delegated work: model-to-subagent mapping and whether each delegation paid off.

## Input

The user provides: **$ARGUMENTS**

A session ID. If empty, fetch `GET /api/sessions?limit=1` and audit the most recent session, stating which one.

## Data Sources

| Endpoint | Returns |
|----------|---------|
| `GET /api/workflows/{sessionId}` | The `modelDelegation` dataset (which models are delegated which subagent types) and the `effectiveness` dataset (per-type completion/success rate, avg duration, task success) |
| `GET /api/agents` | Raw subagent records (`type`, `model`, `status`, `depth`, `parent`) to corroborate counts and statuses |

## Report Sections

### 1. Delegation Matrix
From `modelDelegation`: a model × subagent-type table of how many agents of each type each model ran.
| Model | explore | code-review | debugger | ... | Total |
|-------|---------|-------------|----------|-----|-------|

### 2. Effectiveness by Subagent Type
From `effectiveness`: per type, the success rate and average duration.
| Subagent type | Count | Success rate | Avg duration | Verdict |
|---------------|-------|--------------|--------------|---------|
Mark types below ~70% success as low-yield.

### 3. Wasted Delegations
Flag, with evidence:
- A heavy model (e.g. Opus) assigned to a simple/low-stakes subagent type that a cheaper model handled successfully elsewhere — candidate for rebalancing.
- Subagent types with low success rates (effort spent, task not completed).
- Duplicate delegations: the same type spawned repeatedly with poor success (retry churn).

### 4. Rebalancing Suggestions
Concrete model reassignments grounded in the matrix and effectiveness data. State the type, the model used, the success rate, and the suggested model — only where the data supports it.

## Output

- Markdown tables for the matrix and effectiveness.
- Success rates as percentages; durations in human units (e.g. `1m 12s`).
- Use ▲/▼ when comparing a type's success rate against the session-wide average.
```
END THIRD-PARTY FILE 383480da1eea13a3

The third-party file has ended. Everything between the 383480da1eea13a3 tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

First 2493 of 2711 bytes. © Son Nguyen · MIT · https://github.com/hoangsonww/Claude-Code-Agent-Monitor/tree/HEAD/plugins/ccam-workflows/skills/delegation-audit/SKILL.md

_Part of the page did not fit — see the HTML version._

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
