health — Claude Code command: purpose and installation
health is a Claude Code command that checks API errors and tool failures in Agent Monitor data. It returns an OK, DEGRADED, or FAILING verdict.
MIT ★ 1,198 updated 2026-10-23
/plugin marketplace add hoangsonww/Claude-Code-Agent-Monitor
/plugin install ccam-quality@claude-code-agent-monitor-pluginsWhat health does
The command reads statistics and analytics from Agent Monitor at http://localhost:4820, calculates the API error share and tool-failure share, then uses the worse result. Its output is one line with the verdict, both percentages, and the event count.
Agent Monitor must be running. If localhost:4820 cannot be reached, the command reports UNKNOWN and gives npm start as the launch command from the repository root.
What it helps with
- measure API errors against Agent Monitor event totals
- compare tool failures with tool-use events
- print a one-line reliability verdict for Claude Code
Example prompts for the agent
- Run
/healthand report the current Claude Code reliability verdict. - Check the API error and tool-failure rates using Agent Monitor.
How to install health
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/health.mdCall it with /health. For all projects use ~/.claude/commands/
Manually: put the files in place
~/.codex/prompts/health.mdCall it with /prompts:health. Codex marks this format deprecated in favour of skills
Manually: put the files in place
.github/prompts/health.prompt.mdManually: put the files in place
.gemini/commands/health.tomlGemini stores commands as TOML: the prompt text goes into the prompt field
Questions about health
How do I install health in Claude Code?
Run /plugin marketplace add hoangsonww/Claude-Code-Agent-Monitor, followed by /plugin install ccam-quality@claude-code-agent-monitor-plugins. The command file is .claude/commands/health.md.
What does health do?
It calculates API error and tool-failure shares from Agent Monitor data, then prints a single-line status.
What does health need to run?
Agent Monitor must be running at http://localhost:4820. If the dashboard cannot be reached, the command reports UNKNOWN and points to npm start from the repository root.
Source text
health.md · MIT
--- description: One-line reliability verdict (OK / DEGRADED / FAILING) for Claude Code usage --- Print a single reliability verdict for Claude Code usage from the Agent Monitor dashboard at `http://localhost:4820`. No arguments. 1. Fetch state: ```bash curl -s http://localhost:4820/api/stats curl -s http://localhost:4820/api/analytics ``` From `stats`: `total_events`, `events_today`, `sessions_by_status`. From `analytics`: `event_types` (PreToolUse, PostToolUse, APIError). 2. Derive two reliability signals: - **Error rate** = `APIError / total_events` (percentage, 2 decimals). - **Tool-failure rate** = `(PreToolUse − PostToolUse) / PreToolUse` (percentage). 3. Pick the verdict from the worse of the two signals: - **OK** — error rate ≤ 1% and tool-failure rate ≤ 1%. - **DEGRADED** — either is in 1–5%. - **FAILING** — either exceeds 5%. 4. Print exactly one line: `Reliability: <OK|DEGRADED|FAILING> — errors X.XX%, tool failures Y.YY% (N events)` Prefix with ✅ (OK), ⚠️ (DEGRADED), or ❌ (FAILING). Output rules: cite only fields the API returned — never fabricate. One line only; no extra prose. If `curl` cannot reach `http://localhost:4820`, print `Reliability: UNKNOWN — dashboard unreachable; start it with \`npm start\` from the repo root.`
© Son Nguyen · MIT · hoangsonww/Claude-Code-Agent-Monitor