OPERATIONS AND RELIABILITY / wshobson
Prod Logs Health Check
Pulls recent production logs after a deploy or load test and reports errors grouped by root cause, counting distinct failures separately from retries — treating raw logs, not dashboards, as the only acceptable primary source.
“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.”
01 / THE REASONING
Why this made the selection.
- Makes raw logs the mandatory primary source and refuses to present inference as fact — if logs were not checked, the finding must say so before anything is presented.
- Cross-references job ids before counting, so one failure retried five times is reported as one distinct failure, not five.
02 / THE REVIEW RECORD
What we actually inspected.
Source review has boundaries.
A clear record is more useful than a “safe” badge.
Material inspected
- plugins/operating-kit/agents/prod-logs-health-check.md (complete frontmatter and body at revision 4236bb9)
- LICENSE (MIT redistribution terms at revision 4236bb9)
- YAML frontmatter parsed; sha256 of the exact raw bytes recorded and cross-checked against the git blob at the pinned revision
Our findings
- The core rule forbids analysing an incident from UI data or script stdout alone, on the stated grounds that dashboards paginate and test-harness timing misleads for async work.
- The report contract requires the time window, the number of lines pulled (so truncation is visible), grouped root causes with representative excerpts, and explicit open gaps.
Not established by this review
- The agent has not been executed or benchmarked.
- Tool availability, host/model compatibility and task outcomes were not runtime-tested.
The review applies to the material and revision named here. A newer upstream release can change its behavior.
03 / PUT IT TO WORK
Use the role in your project.
- Download the original prod-logs-health-check.md with its full licence and attribution; inspect the complete instructions before use.
- Replace the {{LOG_QUERY}} template with the project’s real log source (cloud logging, journald, a file, kubectl logs) and fill in project-specific failure markers.
- Place the working copy at .claude/agents/prod-logs-health-check.md and invoke it after deploys or when an incident is suspected.
- Scope the Bash grant to the log-query command the template needs; the agent reads and reports only.
Before you start
- Claude Code with repository read access and a Bash grant scoped to the project’s log source.
- Access to real production logs; the agent reports their absence rather than substituting dashboards.
THE COMPLETE REVIEWED DEFINITION
Read it before you reuse it.
Original source bytes, with attribution.
Review the host-specific setup notes above.
---
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.
The download contains prod-logs-health-check.md. Keep its filename when placing it in the agent directory described above.
By wshobson. Exact upstream source ↗ · Licence · Attribution
SHA-256 3ecb76b643dadd8e0a84efc598c3ce7bf55694ea4864e4400920eb2b98af547f
Read the applicable licence
MIT License Copyright (c) 2024 Seth Hobson Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
04 / FOLLOW THE EVIDENCE
The source trail.
Our notes are separate from the original resource.
Check upstream before adopting a new version.
https://github.com/wshobson/agents/blob/4236bb91f8395b0435f1d8b8baf9e8e4c69a8620/plugins/operating-kit/agents/prod-logs-health-check.md
Supports: summary, upstreamDescription, whySelected, bestFor, limitations, review, access
https://github.com/wshobson/agents/blob/4236bb91f8395b0435f1d8b8baf9e8e4c69a8620/LICENSE
Supports: license, artifact
https://code.claude.com/docs/en/sub-agents.md
Supports: compatibility, install, access, limitations, review