slo-check — Claude Code skill for SLO checks
Turns Agent Monitor events into an SLO scorecard for session completion, tool calls, and API errors. Use it to compare results with targets and track remaining error budget.
npx skills add hoangsonww/Claude-Code-Agent-Monitor --skill slo-check -a claude-codeWhat slo-check does
The skill calculates three indicators from Agent Monitor: the share of completed sessions, tool success rate, and API error rate. It compares each result with its target. The defaults are at least 95% completion, at least 99% tool success, and no more than 1% errors. Open sessions are left out of the completion-rate denominator.
It marks each objective as met or breached, then calculates how much error budget remains. For a breach, it can inspect sessions that contributed most, using GET /api/events?session_id=X. It only reads API data. If curl cannot reach http://localhost:4820, start the dashboard with npm start from the repository root.
Pass custom targets such as completion=95 success=99 error=1, or limit the reporting period with last 7d or today. The Agent Monitor API must be reachable for the skill to calculate these metrics.
What it helps with
- compare session metrics against SLO targets
- calculate remaining error budget for each objective
- identify sessions driving an SLO breach
- limit a report to a chosen time window
Example prompts for the agent
- Check whether our session completion, tool success, and error rates meet their SLOs.
- Compare Agent Monitor results with
completion=95 success=99 error=1. - Report SLOs for
last 7dand identify sessions contributing most to any breach.
How to install slo-check
1Skills CLI (Vercel)
npx skills add hoangsonww/Claude-Code-Agent-Monitor --skill slo-check -a claude-code2Manually: put the files in place
~/.claude/skills/slo-check/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/slo-check/
1Skills CLI (Vercel)
npx skills add hoangsonww/Claude-Code-Agent-Monitor --skill slo-check -a codex2Manually: put the files in place
.agents/skills/slo-check/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add hoangsonww/Claude-Code-Agent-Monitor --skill slo-check -a cursor2Manually: put the files in place
.cursor/skills/slo-check/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install hoangsonww/Claude-Code-Agent-Monitor slo-check2Manually: put the files in place
.github/skills/slo-check/SKILL.md1Skills CLI (Vercel)
npx skills add hoangsonww/Claude-Code-Agent-Monitor --skill slo-check -a gemini-cli2Platform CLI
gemini skills install https://github.com/hoangsonww/Claude-Code-Agent-Monitor --path plugins/ccam-quality/skills/slo-checkManually: put the files in place
.devin/skills/slo-check/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add hoangsonww/Claude-Code-Agent-Monitor --skill slo-check -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about slo-check
How do I install slo-check in Claude Code?
Run npx skills add hoangsonww/Claude-Code-Agent-Monitor --skill slo-check -a claude-code. The skill file is located at ~/.claude/skills/slo-check/SKILL.md.
What does slo-check do?
It calculates session completion, tool success, and API error rates from Agent Monitor data, then checks them against SLO targets and reports the remaining error budget. It can also trace breached objectives to contributing sessions.
Can I set custom targets or a reporting window?
Yes. Pass targets such as completion=95 success=99 error=1, or use a period like last 7d or today. Without custom targets, the skill uses 95% completion, 99% tool success, and a 1% error rate.
Source text
SKILL.md · MIT
--- name: slo-check description: > Define and check simple service-level objectives for Claude Code from Agent Monitor data — session completion rate, tool success rate (PostToolUse/PreToolUse), and error rate (APIError/total) — then compare each to its target and report the error budget remaining. Use when reporting reliability or when someone asks "are we meeting our SLOs?". --- # SLO Check Turn raw event counts into a clear SLO scorecard with error-budget accounting. ## Input The user provides: **$ARGUMENTS** This may be: - empty — use the default SLO targets below over all available data - targets like "completion=95 success=99 error=1" — override the defaults (percentages) - a window like "last 7d" or "today" — restrict the measurement period Default SLO targets: completion rate ≥ 95%, tool success rate ≥ 99%, error rate ≤ 1%. ## Data Sources | Endpoint | Returns | |----------|---------| | `GET /api/analytics` | `event_types` (PreToolUse, PostToolUse, APIError counts), `sessions_by_status`, `daily_events` (365d), `daily_sessions` (365d) — the raw numerators/denominators for every SLI | | `GET /api/stats` | `total_sessions`, `total_events`, `events_today`, `sessions_by_status` — fleet totals and recency | | `GET /api/events?session_id=X` | Per-session stream — drill into the sessions that breach an SLO | ## Report Sections ### 1. Service Level Indicators (SLIs) Compute each SLI from `GET /api/analytics` / `GET /api/stats`: - **Completion rate** = completed sessions / total sessions (from `sessions_by_status`; count `active`/`running` as in-flight, exclude them from the denominator if still open). - **Tool success rate** = `PostToolUse / PreToolUse` (capped at 100%). - **Error rate** = `APIError / total_events`. Within a window, derive the numerators/denominators from `daily_events` / `daily_sessions`. ### 2. SLO Scorecard For each SLI, compare to its target and mark MET ✅ or BREACHED ❌. ### 3. Error Budget For each objective, report the **error budget** and how much remains: - Budget = `1 − target` (e.g., 1% for a 99% target). - For "higher-is-better" SLOs (completion, success): remaining = `(observed − target) / (1 − target)`. - For "lower-is-better" SLOs (error rate): remaining = `(target − observed) / target`. - A negative result means the budget is exhausted — report how far over (e.g., "2.7× over budget"). ### 4. Breach Drill-Down For any breached SLO, list the sessions contributing most to the breach (most failed tools or most APIErrors) via `GET /api/events?session_id=X`. ## Output - A Markdown scorecard table: SLI | observed | target | status | error budget remaining. - Rates as percentages to 2 decimals; any currency in USD to 4 decimals. - Cite exact counts and `session_id` values — never fabricate numerators or denominators. - End with the SLO most at risk and the single action that would recover the most budget. - 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.
© hoangsonww · MIT · hoangsonww/Claude-Code-Agent-Monitor