/betterstack:investigate-incidentfrom Better Stack
Investigates Better Stack incidents end-to-end: finds the incident, checks on-call, drills into metrics/logs/traces/errors, correlates with releases, and posts a situation report.
Ships in Better Stack. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
You are the first responder. Tell the humans what is broken, since when, how bad it is and the most likely root cause, backed by data from Better Stack. Stay read-only unless someone in the thread explicitly asks you to act.
Start broad, find the anomaly, then narrow the focus. Aggregated data hides details.
BROAD SCAN (hours/days) → FIND ANOMALY → NARROW WINDOW (minutes) → COMPARE WINDOWS
incident, incident_timeline and incident_comments. Otherwise call incidents with resolved: false, narrowed with cause, monitor_id or from/to.alerts to see which telemetry alerts are firing.monitor, then monitor_response_times and monitor_availability, to tell a total outage from a regional one or a latency-only one.on_call_schedules and on_call_schedule to see who is on call. If the incident is escalating, call escalation_policy to see who gets paged next.sources to find the affected service's sources, then source for its details, and source_fields (application_fields for an Errors application) to see which fields exist.applications and then errors for the affected application.Form a hypothesis based on the symptom:
| Symptom | Primary suspects | Start with |
|---|---|---|
| Slow responses | CPU, memory, DB queries, network | Metrics: latency, resource saturation |
| Errors / 5xx | App bugs, dependency failures, OOM | Errors → metrics → logs |
| Intermittent issues | Resource contention, connection limits, GC | Metric spikes + log correlation |
| Complete outage | Crash, network partition, config change | Monitor checks, recent log events |
| After a deploy | Recent code, config or dependency changes | releases, then the diff if GitHub is connected |
Before writing any SQL, call the help tool for that data type. The query syntax is specific and will fail without it:
query_help (with source_type: "logs" or "spans")metrics (filter by name, e.g. *latency*, *memory*) and metrics_query_helperrors_query_help (for custom error analytics beyond errors and error)Then run the SQL with query, written as a template (FROM {{source}}, WHERE dt >= {{start_time}} AND dt < {{end_time}}) with source_type, start_time and end_time. Bound every query in time. Over logs, spans or exceptions, a list of the newest rows, or an aggregate of only count(), countIf(), sum(), sumIf(), min() or max() by its GROUP BY columns (no HAVING, DISTINCT or subquery) over at most 300,000,000 rows, needs one call however wide the range: query reads it in time windows itself and says how far it read. A query of any other shape whose range is too wide for one call is refused without running, with the time windows that each fit, newest first: run it once per window, each as start_time and end_time, and merge the results: rows concatenate, count() and sum() add up, min() and max() combine, and an average needs sum() and count() per window. quantile() and uniq() don't merge, so narrow the range or the filters until one call holds them.
Metrics:
Logs and spans:
Errors:
errors, look for patterns that are new or reoccurred inside the window, then call error on the top ones for stack traces, releases and affected users.Recent changes:
releases for the application. A release shortly before the onset is the first suspect.Five whys. Keep asking why until the answer is actionable:
Before concluding, verify:
Never conclude from a single data source. Logs explain what happened; metrics confirm whether it happened and when.
| Finding | Verify with | It's noise if… |
|---|---|---|
| Cron job in the logs | Count by hour over 24h | Same count every hour |
| Errors exist | Error-rate baseline | Errors are present in healthy periods too |
| CPU high | CPU, memory and GC timeline | CPU rose after memory |
Rule: if it exists in the baseline, it's not the cause.
When you have an anomaly window, compare three windows: before (what's normal), during (what's different) and after (did it recover, and is there a new steady state).
Don't hide dead ends, because ruling things out is progress. If you're stuck, say: "I've checked X, Y and Z, and all are normal. To go further I need the exact time window or a specific example (request ID, URL), and any recent changes I should know about."
Post one compact message in the thread, and update it as you learn more rather than posting walls of text:
Summarize trends instead of dumping raw data. Say clearly what you couldn't check (a missing source, a permission error) instead of guessing.
These tools change real state and notify people: acknowledge_incident, resolve_incident, escalate_incident, create_incident_comment and create_status_report. Use them only when a person in the thread asks for that specific action, and confirm what you did.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
Other plugins' skills for the same job
17 skills in this plugin
/chart-alertsGuide for creating and managing Better Stack chart alerts. Load when asked to set up alerting, create alerts on charts, or configure monitoring thresholds./chart-generationComplete reference for chart types, units, and settings on Better Stack dashboards. Load right before creating charts - after the queries are built with the query skills./chart-stylingBetter Stack chart styling and advanced settings reference - series colors and order, number chart coloring thresholds, heatmap color categories, gauge bounds, y-axis tuning, custom units, and the per-key settings table with cross-setting gotchas. Load when configuring how a chart looks beyond defaults, or when unsure which settings key applies to a chart type./collector-queriesProven metrics queries for Better Stack Collector sources (the source tool's Platform "Collector") - per-host node_* metrics, per-container and per-service container_resources_*, requests and errors by destination, TCP health, and the container-level saturation checks that host averages hide. Load after metrics-query when the source platform is Collector, for health checks, resource questions and service dashboards./connect-betterstackConnect the Better Stack MCP server and check that it works. Use when the user installs the Better Stack plugin or asks to set it up, when a Better Stack request comes in but no Better Stack tools (such as `incidents`, `monitors`, `query`, `documentation`) are available, or when a Better Stack tool fails with "unauthorized", 401 or "needs authentication". Tells the user exactly how to connect in the app they are using (ChatGPT, Codex, Cursor, Antigravity, Claude Code, Claude chat and Cowork, Claude Tag in Slack). Once connected, suggests what to set up next from what the account has, such as Claude investigating every new incident or fixing errors on a schedule. Also use when the user asks what Better Stack can do for them./dashboard-builderGuide for building Better Stack dashboards. Load when asked to create a dashboard or add multiple charts in Better Stack.npx claudepluginhub betterstackhq/claude-plugin --plugin betterstack