slo — Claude Code command: what it does, how to install
slo is a Claude Code command that fetches agent reliability metrics from a local monitor and checks completion, tool success, and error rates against default targets.
MIT ★ 1,198 updated 2026-10-23
/plugin marketplace add hoangsonww/Claude-Code-Agent-Monitor
/plugin install ccam-quality@claude-code-agent-monitor-pluginsWhat slo does
The command queries the Agent Monitor dashboard running at http://localhost:4820 via /api/analytics and /api/stats. Without a running dashboard it fails immediately, reminding you to execute npm start in the repository root.
From raw counts, it computes three indicators. Completion rate evaluates finished runs against non-active sessions. Tool success compares PostToolUse against PreToolUse with a 100% cap, while error rate measures APIError events against total events. The script compares observed rates to fixed defaults: completion at or above 95%, tool success at or above 99%, and errors at or below 1%.
The output stays strictly factual: numbers rounded to two decimal places, an individual MET or BREACHED label per target, and a final verdict line.
What it helps with
- calculate agent session completion rates
- measure tool execution success percentages
- track API error ratios across all events
- compare agent performance against target service level objectives
Example prompts for the agent
- /slo
- Show the SLO snapshot from Agent Monitor
- Check agent SLO status
How to install slo
1Plugin marketplace
/plugin marketplace add hoangsonww/Claude-Code-Agent-Monitor/plugin install ccam-quality@claude-code-agent-monitor-plugins2Manually: put the files in place
.claude/commands/slo.mdCall it with /slo. For all projects use ~/.claude/commands/
Manually: put the files in place
~/.codex/prompts/slo.mdCall it with /prompts:slo. Codex marks this format deprecated in favour of skills
Manually: put the files in place
.github/prompts/slo.prompt.mdManually: put the files in place
.gemini/commands/slo.tomlGemini stores commands as TOML: the prompt text goes into the prompt field
Questions about slo
How to install slo in Claude Code?
Run /plugin marketplace add hoangsonww/Claude-Code-Agent-Monitor, then /plugin install ccam-quality@claude-code-agent-monitor-plugins. Alternatively, save the file to .claude/commands/slo.md.
What does the slo command do?
It queries the local Agent Monitor, computes three reliability indicators, and prints a compact line for each metric indicating whether the target was met.
What is required to run slo?
It requires the Agent Monitor dashboard accessible at http://localhost:4820, launched with npm start from its repository root.
Source text
slo.md · MIT
---
description: Print a quick SLO snapshot — completion rate, tool success rate, and error rate
---
Print a compact SLO snapshot for Claude Code usage from the Agent Monitor
dashboard at `http://localhost:4820`. No arguments.
1. Fetch the raw counts:
```bash
curl -s http://localhost:4820/api/analytics
curl -s http://localhost:4820/api/stats
```
From `analytics`: `event_types` (PreToolUse, PostToolUse, APIError) and
`sessions_by_status`. From `stats`: `total_events`, `total_sessions`.
2. Compute three SLIs:
- **Completion rate** = completed sessions / total sessions (from
`sessions_by_status`; exclude still-`active`/`running` sessions from the
denominator).
- **Tool success rate** = `PostToolUse / PreToolUse` (cap at 100%).
- **Error rate** = `APIError / total_events`.
3. Compare each to its default target (completion ≥ 95%, tool success ≥ 99%,
error ≤ 1%) and print one line per SLI:
`SLI .......... observed% (target X%) ✅ MET | ❌ BREACHED`
Output rules: rates as percentages to 2 decimals; cite only fields the API
returned — never fabricate. End with one verdict line (e.g.,
`SLOs: 3/3 met` or `SLOs: error rate BREACHED`). Keep it to the snapshot only; no
extra prose. If `curl` cannot reach `http://localhost:4820`, tell the user to
start the dashboard with `npm start` from the repo root.
© Son Nguyen · MIT · hoangsonww/Claude-Code-Agent-Monitor