home / skills / thebushidocollective / han / investigate-errors

This skill helps you investigate recent Sentry errors and identify patterns, root causes, and actionable insights for quicker triage.

npx playbooks add skill thebushidocollective/han --skill investigate-errors

Review the files below or copy the command above to add this skill to your agents.

Files (1)
SKILL.md
3.3 KB
---
name: investigate-errors
description: Investigate recent errors and exceptions in your Sentry projects
---

# Investigate Recent Errors

## Name

sentry:investigate-errors - Investigate recent errors and exceptions in your Sentry projects

## Synopsis

```
/investigate-errors [arguments]
```

## Description

Investigate recent errors and exceptions in your Sentry projects to identify issues, patterns, and root causes.

## Implementation

This command helps you quickly triage and investigate errors captured by Sentry across your projects.

## Usage

```
/investigate-errors [project-name] [timeframe]
```

## What This Command Does

1. Asks for the Sentry project name (or lists available projects)
2. Requests timeframe (e.g., last 24h, last 7d, custom)
3. Fetches recent error issues using Sentry MCP tools
4. Analyzes error patterns and trends
5. Provides insights on:
   - Most frequent errors
   - Recent error spikes
   - Affected users/sessions
   - Error distribution by release/environment
   - Stack traces and context
6. Suggests next steps for investigation

## Prerequisites

- Sentry MCP server must be installed and configured
- OAuth authentication with Sentry must be completed
- Access to the target Sentry project(s)

## Example Interaction

```
User: /investigate-errors my-web-app 24h

Claude: Investigating errors in my-web-app for the last 24 hours...

## Error Investigation Report

### Overview
- **Total Issues**: 12 error issues
- **Total Events**: 347 error events
- **Affected Users**: 89 unique users
- **Time Range**: Last 24 hours

### Top Issues

1. **TypeError: Cannot read property 'id' of undefined**
   - Events: 156
   - Users: 45
   - First Seen: 23h ago
   - Last Seen: 12m ago
   - Environment: production
   - Release: v2.3.1
   - Trend: Increasing (spike in last 6 hours)

2. **NetworkError: Failed to fetch user data**
   - Events: 89
   - Users: 23
   - First Seen: 18h ago
   - Last Seen: 1h ago
   - Environment: production
   - Release: v2.3.1

3. **ReferenceError: localStorage is not defined**
   - Events: 67
   - Users: 34
   - First Seen: 22h ago
   - Last Seen: 3h ago
   - Environment: production, staging

### Key Patterns

- 45% of errors correlate with v2.3.1 deployment 23h ago
- TypeError spike began 6 hours after deployment
- NetworkError appears to be intermittent (API flakiness?)
- localStorage errors isolated to server-side rendering context

### Recommendations

1. **Immediate**: Investigate TypeError in v2.3.1 - likely regression in user data handling
2. **High Priority**: Check API stability for fetch failures
3. **Medium Priority**: Add server-side rendering guards for localStorage access

Would you like me to dive deeper into any specific error?
```

## Arguments

- `project-name` (optional): Sentry project slug
- `timeframe` (optional): Time range (1h, 24h, 7d, 30d, or custom)

## Tips

- Start with shorter timeframes for faster investigation
- Look for error spikes that correlate with deployments
- Use error grouping to identify patterns
- Check release and environment tags for correlation
- Review stack traces for common code paths
- Use Seer AI for automated root cause analysis

## Related Commands

- `/analyze-performance`: Investigate performance issues
- `/check-releases`: Review recent release health
- `/query-events`: Run custom Sentry queries

Overview

This skill helps you investigate recent errors and exceptions captured in your Sentry projects. It quickly summarizes issues, highlights spikes and patterns, and recommends concrete next steps for triage and remediation. Use it to speed up root-cause discovery across releases and environments.

How this skill works

You provide a project name and timeframe (or pick from listed projects and presets). The skill fetches recent issues and events from Sentry, aggregates frequency, affected users, releases, and environments, and inspects stack traces and tags. It then identifies top issues, trends, correlated deployments, and suggests prioritized actions.

When to use it

  • After a deployment to check for regressions and error spikes
  • When alerted by monitoring to quickly triage a surge of errors
  • During on-call rotations to prioritize which issues need immediate attention
  • When investigating user impact across releases and environments
  • As a first-pass analysis before assigning tickets or launching rollbacks

Best practices

  • Start with short timeframes (1h or 24h) to surface recent regressions quickly
  • Cross-check spikes with recent releases and deployment timestamps
  • Use release and environment tags to narrow down affected deployments
  • Review grouped stack traces to identify common code paths and likely root causes
  • Combine this investigation with performance and release-health checks for full context

Example use cases

  • Run for a web app 24h after a release to detect new TypeError regressions and their affected users
  • Triage a production error surge to find the most frequent issue and its stack trace for a hotfix
  • Identify intermittent network errors and determine whether they correlate with specific releases
  • Detect server-side rendering issues by finding errors like localStorage access in non-browser contexts
  • Prioritize remediation by listing immediate, high, and medium priority recommendations

FAQ

What inputs does the command accept?

You can pass an optional project slug and a timeframe (1h, 24h, 7d, 30d, or custom). If omitted, it lists projects and prompts for a timeframe.

What permissions are required?

OAuth authentication with your Sentry instance and access to the target project(s) are required.

How does it surface root causes?

It highlights correlated releases, deployment timing, top stack traces, and error distribution to suggest likely regressions or context for investigation.