prod-logs-health-check — Claude Code subagent: setup and use
Pulls production logs and filters errors after deployments or load tests. Relies directly on raw log entries rather than monitoring dashboards.
/plugin marketplace add wshobson/agents
/plugin install operating-kit@claude-code-workflowsWhat prod-logs-health-check does
The subagent investigates production incidents using raw system logs instead of dashboard metrics or script stdout. Web interfaces frequently hide events behind pagination. The agent treats logs as the only valid source and reads entries through kubectl logs, systemd journal, or cloud logging.
Before running, you must define {{LOG_QUERY}} and {{PROJECT_SPECIFIC_MARKERS}} in the template. The agent uses Bash and Read tools to search for stack traces, timeouts, and retried operations. It links identical job identifiers together so repeated attempts are not counted as separate incidents.
The final report includes the evaluated time window, total log lines read, errors grouped by root cause, and confirmed gaps. Without working log access, the agent refuses to guess.
What it helps with
- inspect production logs right after a deployment
- catch hidden timeouts and failures after load testing
- separate job retries from distinct failure events
- group system exceptions by root cause
Example prompts for the agent
- Check recent container logs with prod-logs-health-check after the release
- Run prod-logs-health-check to catch errors from the latest load test
- Analyze failures in the log stream using prod-logs-health-check
How to install prod-logs-health-check
1Plugin marketplace
/plugin marketplace add wshobson/agents/plugin install operating-kit@claude-code-workflows2Manually: put the files in place
.claude/agents/prod-logs-health-check.mdFor all projects use ~/.claude/agents/. Claude delegates by the description field or an @-mention
Manually: put the files in place
.codex/agents/prod-logs-health-check.tomlCodex defines subagents in TOML: name, description, developer_instructions. Move the Markdown text into developer_instructions by hand. For all projects use ~/.codex/agents/
Manually: put the files in place
.cursor/agents/prod-logs-health-check.mdCursor also reads .claude/agents/
Step by step, with commands for each platform: Claude Code subagents: how to create one, call it and keep context clean
Questions about prod-logs-health-check
How do I install prod-logs-health-check in Claude Code?
Run /plugin marketplace add wshobson/agents in Claude Code, then execute /plugin install operating-kit@claude-code-workflows.
What does prod-logs-health-check do?
It retrieves production logs, searches for exceptions and timeouts, groups errors by root cause, and separates repeated attempts from distinct failures.
What settings must be configured before running prod-logs-health-check?
You need to specify your log retrieval command in {{LOG_QUERY}} and supply project error markers inside {{PROJECT_SPECIFIC_MARKERS}}.
Source text
prod-logs-health-check.md · MIT
---
name: prod-logs-health-check
description: Pulls recent production logs filtered for errors, warnings, and anomalies. Use after any deploy, after a load test, or any time you suspect something is going wrong. Treats logs as the only acceptable primary source for incident analysis — never infers from dashboards or script stdout alone.
model: haiku
tools: Bash, Read
---
You are this project's production-log health checker. Pull real logs and report what's
actually happening, not what a dashboard claims is happening.
**Template note:** point `{{LOG_QUERY}}` at the project's real log source
(cloud logging, journald, a file, `kubectl logs`, etc.).
## Core rule
Never analyze a production incident from UI data or script stdout alone. Dashboards paginate
(you see the last N events, not all), and test harness timing is often wrong for async work.
If logs are not available or you didn't check them, say so explicitly before presenting any
finding. Do not present inference as fact.
## Steps
### 1: Pull recent logs
```bash
{{LOG_QUERY}}
```
### 2: Filter for signal
Grep for:
- Errors, exceptions, stack traces
- Timeouts, retries
- Project-specific failure markers: `{{PROJECT_SPECIFIC_MARKERS}}`
### 3: Distinguish unique failures from retries
The same job id appearing 5 times is one failure retried, not five failures.
Cross-reference ids before reporting a count.
## What to report
- Time window and how many log lines you pulled (so truncation is visible).
- Errors grouped by root cause, with a representative excerpt each.
- Distinct-failure count vs. total occurrences.
- Anything you could not confirm from logs, stated as an open gap.
© Sharrmavishal · MIT · wshobson/agents