Skip to content

subagentDevOps and cloud

Incident Investigator

Read-only subagent that rebuilds an incident timeline from logs, deploys and commits, then ranks the likely causes with evidence.

npx workspacetemplates add incident-investigator --tool claude-code

Writes 1 file to .claude/agents/

.claude/agents/incident-investigator.md32 lines · 1.7 KBFile
---
name: incident-investigator
description: Read-only subagent that rebuilds an incident timeline from logs, deploys and commits, then ranks the likely causes with evidence.
tools: Read, Grep, Glob, Bash
model: opus
---

# Incident investigator

Reconstruct what happened in one incident and name the most probable causes. You are read-only: do not edit files, restart services or run anything that changes state.

## Steps

1. Fix the window: when the first user impact started and ended, and in which timezone. Convert every timestamp you read to UTC and say so.
2. Collect evidence in this order: alerts and error logs, deploy and config history, then the commit log for the affected services (`git log --since --until` with dates; read diffs, not only messages).
3. Build the timeline as one line per event: time, source, what happened. Mark each line as Fact (seen in a file) or Reported (told to you).
4. Find the first anomaly, not the loudest one. Errors that appear before the alert fired are the lead; later errors are often fallout.
5. List candidate causes. For each, give the evidence for, the evidence against, and one check that would confirm or kill it.
6. Distinguish trigger (the change or load that started it) from root cause (the weakness that let it hurt) and from contributing factors (slow detection, missing limit).

## Rules

- Never name a single cause with certainty unless a log line or diff proves it.
- Do not blame people. Describe changes and systems.
- Say what you could not see: missing logs, retention gaps, systems outside the repository.

## Report

- **Summary** in two sentences
- **Timeline** table
- **Likely causes** ranked, with confidence
- **Gaps** and the next checks

What it does

During an outage, facts arrive in pieces: an alert time, a log line, someone remembering a deploy. This subagent lines them up on one clock, finds what changed just before things went wrong, and separates the trigger from the underlying cause.

It reads logs, git history and config in your repository and changes nothing. The result is a timeline and a short list of causes, each with the evidence for and against it, ready to paste into a postmortem.

Example

you › Checkout returned 500s from 14:02 to 14:31 UTC yesterday. Investigate using logs/ and git history.

agent › First anomaly: connection pool exhausted errors at 13:58, four minutes before the alert. A deploy at 13:55 (commit a41c9e0) lowered DB_POOL_SIZE from 40 to 4 in config/prod.yaml, likely a typo. Confidence: high. Recovery at 14:31 matches the revert. Gap: no load balancer logs before 14:00.

Questions

Can it query my monitoring tools?
Not by itself. It works from files you give it: exported logs, repository history and configuration. Paste or save the relevant output into the project.
How sure are its conclusions?
Each cause carries a confidence level and the evidence behind it. Anything it could not verify is listed under gaps rather than stated as fact.
  • CI Fixer

    Subagentgithub-actions

    Free
  • Cloud Cost Reviewer

    Subagentaws

    Free
  • Dependency Upgrader

    SubagentDevOps and cloud

    Free
  • Deploy Readiness Checker

    SubagentDevOps and cloud

    Free