Claude Skills Guide

When you’re on-call and an alert fires at 3 AM, every second counts. Site Reliability Engineering (SRE) teams need rapid, reliable incident response workflows that minimize mean time to resolution (MTTR) while reducing cognitive load on engineers. Claude Code offers a powerful toolkit for automating incident response, from initial triage to post-mortem documentation. This guide explores how to build effective on-call incident response workflows using Claude Code skills and features.

Why Claude Code for Incident Response?

Traditional incident response relies heavily on human memory, wiki documentation, and manual execution of remediation steps. This approach leads to inconsistent responses, longer resolution times, and increased stress for on-call engineers. Claude Code transforms incident response by providing an intelligent assistant that understands your infrastructure, can execute diagnostic commands, and guides you through proven remediation steps.

Claude Code excels at incident response for several reasons. First, it maintains context across complex troubleshooting sessions, remembering previous investigation steps and connecting disparate data points. Second, it can execute bash commands directly, automating repetitive diagnostic tasks. Third, it integrates with your existing tools through MCP servers, pulling metrics, logs, and configuration data on demand. Finally, it documents your actions automatically, creating audit trails and facilitating post-incident reviews.

Setting Up Your Incident Response Skills

The foundation of effective incident response with Claude Code begins with properly configured skills. Create a dedicated SRE skill that encapsulates your incident response procedures, escalation paths, and common remediation playbooks.

Start by creating a skill file at CLAUDE.md in your project or a dedicated skills directory. Include your on-call rotation, escalation contacts, and links to runbooks. Define the skill with clear instructions for handling different incident severities:

name: sre-incident-response
description: SRE on-call incident response and troubleshooting assistant

For more complex setups, create a dedicated skill file that loads automatically when working in your infrastructure repositories. This skill should include your standard operating procedures, communication templates, and common debugging patterns specific to your systems.

Automated Triage and Initial Assessment

When an incident occurs, rapid triage is essential. Claude Code can automate initial assessment by gathering context from multiple sources simultaneously. Configure MCP server integrations for your monitoring tools (Datadog, Prometheus, CloudWatch), log aggregation systems (Splunk, ELK, Loki), and incident management platforms (PagerDuty, Opsgenie).

Create a triage workflow that Claude Code executes automatically when you invoke it during an incident. The workflow should gather key information: current system health, recent deployments, error rates, latency percentiles, and any active maintenance windows. Here’s an example prompt structure for initial triage:

When I invoke incident triage, perform these steps:
1. Check current CPU, memory, and disk usage across production servers
2. Query error rates for the affected service over the last hour
3. List any deployments or configuration changes in the past 24 hours
4. Check if there are any active incidents in PagerDuty
5. Summarize findings in a structured format with severity assessment

This automated triage reduces the time from alert to initial understanding from minutes to seconds, allowing you to focus on remediation rather than information gathering.

Diagnostic Command Execution

One of Claude Code’s most powerful features for incident response is its ability to execute diagnostic commands. Rather than manually SSHing into servers, running scripts, and parsing output, you can instruct Claude Code to run complex diagnostic sequences and synthesize the results.

For database incidents, you can execute queries to check connection pools, slow queries, and replication lag:

Check the PostgreSQL database health:
1. Run `psql -c "SELECT * FROM pg_stat_activity WHERE state != 'idle'"` to see active connections
2. Execute `psql -c "SELECT query, calls, mean_time FROM pg_stat_statements ORDER BY mean_time DESC LIMIT 10"` for slow queries
3. Check replication status with `psql -c "SELECT * FROM pg_stat_replication"`

For Kubernetes issues, diagnose pod health, resource constraints, and events:

Diagnose the production Kubernetes namespace:
1. Get all pods with `kubectl get pods -n production -o wide`
2. Describe failing pods with `kubectl describe pod -n production`
3. Check events with `kubectl get events -n production --sort-by='.lastTimestamp'`
4. View resource metrics with `kubectl top pods -n production`

Claude Code executes these commands, interprets the output, and presents findings in a readable format. It can identify patterns in logs, highlight anomalies in metrics, and suggest next steps based on the diagnostic results.

Remediation Playbooks and Automated Fixes

Beyond diagnostics, Claude Code can execute predefined remediation playbooks. These are scripted responses to common incidents that you’ve validated and documented. When an incident matches a known pattern, Claude Code can apply the appropriate fix automatically, subject to appropriate approval workflows.

Create remediation playbooks as bash scripts or Terraform configurations that Claude Code can execute. For example, a playbook for restarting a stuck service might include:

#!/bin/bash
# Restart stuck application pod
kubectl rollout restart deployment/app-api -n production
kubectl rollout status deployment/app-api -n production
# Verify recovery
curl -s https://api.example.com/health | jq '.status'

Configure Claude Code to prompt for confirmation before executing destructive actions, but allow automated execution for safe, reversible operations. Use the auto-execute flag sparingly and always log actions for audit purposes.

Communication and Status Updates

Effective incident response requires timely communication with stakeholders. Claude Code can draft status updates, incident communications, and customer notifications based on templates and current incident status. This ensures consistent messaging and saves valuable time during high-stress situations.

Create communication templates for different incident scenarios:

Claude Code can populate these templates with current incident details, making communication faster and more accurate.

Post-Incident Review and Documentation

After resolving an incident, thorough documentation is crucial for preventing recurrence and improving future responses. Claude Code can generate post-mortem documents by synthesizing incident timeline, root cause analysis, and remediation actions taken.

Prompt Claude Code to create a post-mortem:

Generate a post-mortem document for the incident including:
1. Timeline from alert to resolution
2. Root cause analysis using the "five whys" technique
3. Impact assessment (users affected, duration, business impact)
4. Remediation actions taken
5. Preventive measures to avoid recurrence
6. Lessons learned

This automated documentation ensures consistent post-mortem quality and captures institutional knowledge that would otherwise be lost.

Integrating with On-Call Tools

Enhance your incident response workflow by integrating Claude Code with your on-call tools. Use the PagerDuty MCP server to acknowledge alerts, escalade incidents, and update incident status directly from Claude Code. Connect to Slack for real-time collaboration and status updates.

Configure your .claude/settings.json to enable these integrations:

{
  "mcpServers": {
    "pagerduty": {
      "command": "npx",
      "args": ["-y", "pagerduty-mcp-server"],
      "env": {
        "PAGERDUTY_API_KEY": "${PAGERDUTY_API_KEY}"
      }
    },
    "slack": {
      "command": "npx", 
      "args": ["-y", "slack-mcp-server"],
      "env": {
        "SLACK_BOT_TOKEN": "${SLACK_BOT_TOKEN}"
      }
    }
  }
}

This integration enables a seamless workflow where Claude Code acts as a central hub for incident management, coordinating across your entire tooling ecosystem.

Best Practices for SRE Incident Response with Claude Code

To maximize the effectiveness of Claude Code in your incident response workflows, follow these best practices:

Maintain up-to-date runbooks: Regularly update your diagnostic procedures and remediation playbooks as your systems evolve. Claude Code can only help if it has accurate information about your infrastructure.

Implement proper access controls: Ensure Claude Code has appropriate permissions to execute diagnostic and remediation commands, but follow the principle of least privilege to prevent accidental damage.

Practice incident scenarios: Run tabletop exercises and chaos engineering experiments to validate your Claude Code incident response workflows before real incidents occur.

Measure and iterate: Track MTTR and other incident metrics before and after implementing Claude Code workflows. Use this data to identify improvement opportunities.

Document everything: Use Claude Code to automatically document all actions taken during incidents, creating a valuable knowledge base for future reference.

Claude Code transforms on-call incident response from a stressful, manual process into an efficient, automated workflow. By investing time in setting up proper skills, integrating with your tooling, and building comprehensive playbooks, you can significantly reduce MTTR while making incident response more manageable for your team.

Built by theluckystrike — More at zovo.one