Flight computer for Claude Code — log rotation, watchdog, crash bundles, and MCP self-awareness
claude-guardian has 8 well-intentioned tools with mostly clear naming and reasonable descriptions. However, schema documentation is incomplete, input parameters use zod validators (visible in code) but the output schemas are never formally documented. Descriptions are adequate (100 - 250 chars range) but lack specific guidance on when to use each tool relative to others. Parameters are typed via zod but descriptions don't always state ranges, enums, or constraints explicitly. Error handling delegates to GuardianError wrapper but doesn't provide recovery guidance in tool descriptions. Overall: solid domain model, but missing schema documentation and output contracts that production tools require.
Request N concurrency slots with a TTL (in seconds). Returns lease ID if granted, or reason if denied. Leases auto-expire; use release to free early.
Returns the current concurrency budget: cap, slots in use, available slots, and active leases. Use this before starting heavy work to check if capacity is available.
Release a concurrency lease by ID. Returns success or not-found.
Generates a full diagnostics bundle (zip) containing system info, log tails, file size reports, and the guardian action journal. Returns the bundle path and a summary report. Use this when something has gone wrong and you need evidence.
Deterministic "do the safe things" action. If logs/disk thresholds breached, runs preflight fix. If warn/critical with no bundle yet, captures diagnostics. Returns what changed and what to do next. Never kills processes or restarts.
Scans Claude project logs and automatically rotates/trims oversized files. Safe and reversible — old logs are gzipped, large files are trimmed to last N lines. Use this when guardian_status shows warnings or before starting intensive work.
Output schemas not documented. Tool descriptions do not specify what fields are returned, their types, or structure. LLMs cannot plan downstream tool calls without knowing what data to expect.
Parameter constraints not stated in descriptions. 'slots' and 'ttlSeconds' in guardian_budget_acquire accept numbers but don't specify min/max in description text. LLMs cannot validate input ranges.
No recovery guidance in error handling. GuardianError wrapper converts errors to text but tool descriptions don't hint at fallback tools or next steps when operations fail.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-22 | C | 66 | 2026-07-28+ | v2 |
| 2026-03-09 | F | 44 | - | v1 |
Generates a step-by-step recovery plan based on current state: what to do first, second, third, and which guardian tools to call at each step. If state is ok, returns 'all clear'.
Returns current health status: disk free space, Claude log sizes, and a one-line health banner. Use this to check environment health before or during long tasks.
Missing context on tool composition. No description indicates which tools should be called in sequence (e.g., 'Call guardian_status first, then guardian_nudge if warnings appear'). LLMs must guess the workflow.
Dry-run or confirmation pattern missing. guardian_preflight_fix and guardian_nudge are WRITE tools that modify logs and files but offer no confirmation or dry-run mode to prevent accidental damage.