Skip to main content
skill CX Codex

sentry · mitsuhiko — Claude Code skill: what it does, how to install

Connects your coding agent to the Sentry API to inspect production crashes, examine stack traces, check breadcrumbs, and query system logs.

Apache-2.0 136 installs ★ 3,224 updated 2026-09-27

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add mitsuhiko/agent-stuff --skill sentry -a claude-code
Open on GitHub

What sentry does

This skill equips your coding agent with dedicated Node.js scripts to inspect Sentry data directly. Using list-issues.js and search-events.js, the agent inspects unresolved errors across specified timeframes, filtering by tags, transaction names, or user impact. When investigating a particular bug, fetch-issue.js and fetch-event.js pull the exact exception, runtime environment, span tree, and breadcrumbs.

It also queries Sentry's Logs Explorer through search-logs.js, handling trace IDs and wildcard message filters.

All scripts depend on a valid authentication token stored in ~/.sentryclirc, without which API requests fail.

What it helps with

  • inspect high-frequency unresolved issues across projects
  • pull complete stack traces and breadcrumbs for an issue ID
  • locate errors linked to specific user emails or custom tags
  • search Sentry logs by trace ID or message wildcard

Example prompts for the agent

  • Find all unresolved errors in the backend project from the last 24 hours.
  • Fetch the latest stack trace and breadcrumbs for issue 5765604106.
  • Search Sentry logs for errors matching trace abc123def456.

How to install sentry

1Skills CLI (Vercel)

npx skills add mitsuhiko/agent-stuff --skill sentry -a claude-code

2Manually: put the files in place

~/.claude/skills/sentry/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/sentry/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about sentry

How to install sentry in Claude Code?

Run npx skills add mitsuhiko/agent-stuff --skill sentry -a claude-code. The skill configuration saves to ~/.claude/skills/sentry/SKILL.md.

What does the sentry skill do?

It lets AI agents query the Sentry API to debug errors, explore events, inspect breadcrumbs, and search application logs.

How does authentication work for the sentry skill?

The underlying scripts read your Sentry authentication token directly from ~/.sentryclirc.

Source text

SKILL.md · Apache-2.0
---
name: sentry
description: "Fetch and analyze Sentry issues, events, transactions, and logs. Helps agents debug errors, find root causes, and understand what happened at specific times."
---

# Sentry Skill

Access Sentry data via the API for debugging and investigation. Uses auth token from `~/.sentryclirc`.

## Quick Reference

| Task | Command |
|------|---------|
| Find errors on a date | `search-events.js --org X --start 2025-12-23T15:00:00 --level error` |
| List open issues | `list-issues.js --org X --status unresolved` |
| Get issue details | `fetch-issue.js <issue-id-or-url> --latest` |
| Get event details | `fetch-event.js <event-id> --org X --project Y` |
| Search logs | `search-logs.js --org X --project Y "level:error"` |

## Common Debugging Workflows

### "What went wrong at this time?"

Find events around a specific timestamp:

```bash
# Find all events in a 2-hour window
./scripts/search-events.js --org myorg --project backend \
  --start 2025-12-23T15:00:00 --end 2025-12-23T17:00:00

# Filter to just errors
./scripts/search-events.js --org myorg --start 2025-12-23T15:00:00 \
  --level error

# Find a specific transaction type
./scripts/search-events.js --org myorg --start 2025-12-23T15:00:00 \
  --transaction process-incoming-email
```

### "What errors have occurred recently?"

```bash
# List unresolved errors from last 24 hours
./scripts/list-issues.js --org myorg --status unresolved --level error --period 24h

# Find high-frequency issues
./scripts/list-issues.js --org myorg --query "times_seen:>50" --sort freq

# Issues affecting users
./scripts/list-issues.js --org myorg --query "is:unresolved has:user" --sort user
```

### "Get details about a specific issue/event"

```bash
# Get issue with latest stack trace
./scripts/fetch-issue.js 5765604106 --latest
./scripts/fetch-issue.js https://sentry.io/organizations/myorg/issues/123/ --latest
./scripts/fetch-issue.js MYPROJ-123 --org myorg --latest

# Get specific event with all breadcrumbs
./scripts/fetch-event.js abc123def456 --org myorg --project backend --breadcrumbs
```

### "Find events with a specific tag"

```bash
# Find by custom tag (e.g., thread_id, user_id)
./scripts/search-events.js --org myorg --tag thread_id:th_abc123

# Find by user email
./scripts/search-events.js --org myorg --query "user.email:*@example.com"
```

---

## Fetch Issue

```bash
./scripts/fetch-issue.js <issue-id-or-url> [options]
```

Get details about a specific issue (grouped error).

**Accepts:**
- Issue ID: `5765604106`
- Issue URL: `https://sentry.io/organizations/sentry/issues/5765604106/`
- New URL format: `https://myorg.sentry.io/issues/5765604106/`
- Short ID: `JAVASCRIPT-ABC` (requires `--org` flag)

**Options:**
- `--latest` - Include the latest event with full stack trace
- `--org <org>` - Organization slug (for short IDs)
- `--json` - Output raw JSON

**Output includes:**
- Title, culprit, status, level
- First/last seen timestamps
- Event count and user impact
- Tags and environment info
- With `--latest`: stack trace, request details, breadcrumbs, runtime context

---

## Fetch Event

```bash
./scripts/fetch-event.js <event-id> --org <org> --project <project> [options]
```

Get full details of a specific event by its ID.

**Options:**
- `--org, -o <org>` - Organization slug (required)
- `--project, -p <project>` - Project slug (required)
- `--breadcrumbs, -b` - Show all breadcrumbs (default: last 30)
- `--spans` - Show span tree for transactions
- `--json` - Output raw JSON

**Output includes:**
- Timestamp, project, title, message
- All tags
- Context (runtime, browser, OS, trace info)
- Request details
- Exception with stack trace
- Breadcrumbs
- Spans (with `--spans`)

---

## Search Events

```bash
./scripts/search-events.js [options]
```

Search for events (transactions, errors) using Sentry Discover.

**Time Range Options:**
- `--period, -t <period>` - Relative time (24h, 7d, 14d)
- `--start <datetime>` - Start time (ISO 8601: 2025-12-23T15:00:00)
- `--end <datetime>` - End time (ISO 8601)

**Filter Options:**
- `--org, -o <org>` - Organization slug (required)
- `--project, -p <project>` - Project slug or ID
- `--query, -q <query>` - Discover search query
- `--transaction <name>` - Transaction name filter
- `--tag <key:value>` - Tag filter (repeatable)
- `--level <level>` - Level filter (error, warning, info)
- `--limit, -n <n>` - Max results (default: 25, max: 100)
- `--fields <fields>` - Comma-separated fields to include

**Query Syntax:**
```
transaction:process-*     Wildcard transaction match
level:error               Filter by level
user.email:[email protected]    Filter by user
environment:production    Filter by environment
has:stack.filename        Has stack trace
```

---

## List Issues

```bash
./scripts/list-issues.js [options]
```

List and search issues (grouped errors) in a project.

**Options:**
- `--org, -o <org>` - Organization slug (required)
- `--project, -p <project>` - Project slug (repeatable)
- `--query, -q <query>` - Issue search query
- `--status <status>` - unresolved, resolved, ignored
- `--level <level>` - error, warning, info, fatal
- `--period, -t <period>` - Time period (default: 14d)
- `--limit, -n <n>` - Max results (default: 25)
- `--sort <sort>` - date, new, priority, freq, user
- `--json` - Output raw JSON

**Query Syntax:**
```
is:unresolved             Status filter
is:assigned               Has assignee
assigned:me               Assigned to current user
level:error               Level filter
firstSeen:+7d             First seen > 7 days ago
lastSeen:-24h             Last seen within 24h
times_seen:>100           Event count filter
has:user                  Has user context
error.handled:0           Unhandled errors only
```

---

## Search Logs

```bash
./scripts/search-logs.js [query|url] [options]
```

Search for logs in Sentry's Logs Explorer.

**Options:**
- `--org, -o <org>` - Organization slug (required unless URL provided)
- `--project, -p <project>` - Filter by project slug or ID
- `--period, -t <period>` - Time period (default: 24h)
- `--limit, -n <n>` - Max results (default: 100, max: 1000)
- `--json` - Output raw JSON

**Query Syntax:**
```
level:error              Filter by level (trace, debug, info, warn, error, fatal)
message:*timeout*        Search message text with wildcards
trace:abc123             Filter by trace ID
project:my-project       Filter by project slug
```

**Accepts Sentry URLs:**
```bash
./scripts/search-logs.js "https://myorg.sentry.io/explore/logs/?project=123&statsPeriod=7d"
```

---

## Tips for Debugging

1. **Start broad, then narrow down**: Use `search-events.js` with a time range first, then drill into specific events

2. **Use breadcrumbs**: The `--breadcrumbs` flag on `fetch-event.js` shows the full history of what happened before an error

3. **Look for patterns**: Use `list-issues.js --sort freq` to find frequently occurring problems

4. **Check related events**: If you find one event, look for others with the same transaction name or trace ID

5. **Tags are your friend**: Custom tags like `thread_id`, `user_id`, `request_id` help correlate events

© mitsuhiko · Apache-2.0 · mitsuhiko/agent-stuff

Similar skills

All skills for Backend and APIs →

sentry by other authors comes first.

From the same set16

The whole set →
tmux Runs interactive CLI sessions inside tmux using an isolated socket. Helpful when an agent must feed keystrokes into Python or lldb and scrape pane output. CX Codex +1 425installs apple-mail Query Apple Mail locally on macOS, extract attachments, and read full messages from your AI agent. Read-only access to your email store. CX Codex +1 260installs uv Replaces pip, python, and venv with uv, a fast package manager and Python runtime. Run scripts via uv run, add dependencies with uv add, embed requirements directly in scripts. CX Codex +1 251installs librarian librarian caches remote Git repositories locally and refreshes them when referenced again. Useful when an agent needs to inspect external source code. CX Codex +1 170installs native-web-search native-web-search — a skill that runs a fast model with built-in web search and returns a concise summary with full source URLs. Useful when you need current information while coding. CX Codex +1 134installs update-changelog update-changelog is a Claude Code skill that builds formatted CHANGELOG entries from commits between the latest release tag and the current version. CX Codex +1 130installs pi-share pi-share loads shared pi sessions and parses their conversation history. Use it to inspect messages, tool calls, or the human’s actions. CX Codex +1 125installs google-workspace Gives your agent access to Google Workspace services (Gmail, Drive, Docs, Calendar, Sheets and more) through local helper scripts. Use it to automate Google services directly from your IDE. CX Codex +1 108installs

More in the catalog

Project sponsors

Companies that keep this analytics open