Agent skill

Sentry Error Capture

by jeremylongshore in jeremylongshore/tons-of-skills-marketplace

Implement advanced error capture and context enrichment with Sentry.

MITAuto-check passedDevelopment

Install Sentry Error Capture

skills CLI
$ npx skills add jeremylongshore/tons-of-skills-marketplace --skill sentry-error-capture -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install jeremylongshore/tons-of-skills-marketplace sentry-error-capture --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/jeremylongshore/tons-of-skills-marketplace.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/.curated/sentry-error-capture .claude/skills/sentry-error-capture && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
sentry-error-capture
GitHub stars
2.8k
Token cost
~3k tokens
SKILL.md length
487 words
Files
5 (incl. references)
Skills in repo
3,342
Repo updated
First seen
Licence
MIT

At a glance

Implement advanced error capture and context enrichment with Sentry.

  • Works in 3 steps: Capture Exceptions with Full Stack Traces → Capture Messages for Non-Exception Events → Enrich Events with Scoped Context
  • Adding captureException/captureMessage calls
  • SKILL.md covers Overview, Prerequisites, Instructions and Breadcrumbs, plus 7 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Sentry Error Capture is an agent skill from jeremylongshore/tons-of-skills-marketplace. Implement advanced error capture and context enrichment with Sentry. Use when adding captureException/captureMessage calls, enriching errors with user context, tags, breadcrumbs, or custom fingerprinting. Trigger with "sentry error capture", "sentry context", "enrich sentry errors", "sentry exception handling", "sentry breadcrumbs", "sentry fingerprint".

Its SKILL.md is about 3k tokens, which your agent loads only when the skill is triggered. The skill folder holds 5 other files, including reference files (for example `references/advanced-techniques.md`, `references/errors.md` and `references/examples.md`). Compatibility notes: Designed for Claude Code

It sits in Development, covering Error handling and Debugging. It works with Sentry, Python and TypeScript. The repository describes itself as: Model-agnostic agent-skills platform with a harness-free canonical layer, verified adapters, and the ccpi package manager. Explore at tonsofskills.com. The licence is MIT.

When your agent uses it

  • Adding captureException/captureMessage calls
  • Enriching errors with user context
  • Custom fingerprinting
  • With sentry error capture

Example prompts

  • “sentry error capture”
  • “sentry context”
  • “enrich sentry errors”
  • “/sentry-error-capture”

Requirements

  • Python 3
  • Compatibility (from SKILL.md): Designed for Claude Code
  • Pre-approved tools (allowed-tools): Read, Write, Edit, Grep, Glob, Bash(npm:*), Bash(npx:*), Bash(pip:*), Bash(python:*)

Workflow steps

3 steps, taken from the step headings in SKILL.md.

  1. Capture Exceptions with Full Stack Traces
  2. Capture Messages for Non-Exception Events
  3. Enrich Events with Scoped Context

What it can do on your machine

Read from SKILL.md and the folder at commit cfae287. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Read
    • Write
    • Edit
    • Grep
    • Glob
    • Bash(npm:*)
    • Bash(npx:*)
    • Bash(pip:*)
    • Bash(python:*)

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are typescript and python).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • docs.sentry.io
    • sentry.io

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

  • Compatibility

    Designed for Claude Code

    From compatibility in the SKILL.md frontmatter.

Context cost

Sentry Error Capture loads about 3k tokens when it runs, and up to ~4.1k if it reads all its reference files. Until then it costs about 94 tokens; SKILL.md has 487 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~94
When it runs · the whole SKILL.md, loaded when a task matches
~3k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~4.1k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from jeremylongshore/tons-of-skills-marketplace at commit cfae287, republished under its MIT licence (© jeremylongshore). 487 words, ~3,012 tokens.

Download SKILL.mdSave it as .claude/skills/sentry-error-capture/SKILL.md (or your agent's skills folder). This skill also uses 4 other files; get the full folder from GitHub.
name
sentry-error-capture
description
Implement advanced error capture and context enrichment with Sentry. Use when adding captureException/captureMessage calls, enriching errors with user context, tags, breadcrumbs, or custom fingerprinting. Trigger with "sentry error capture", "sentry context", "enrich sentry errors", "sentry exception handling", "sentry breadcrumbs", "sentry fingerprint".
allowed-tools
Read, Write, Edit, Grep, Glob, Bash(npm:*), Bash(npx:*), Bash(pip:*), Bash(python:*)
compatibility
Designed for Claude Code
version
1.51.0
license
MIT
author
Jeremy Longshore <jeremy@intentsolutions.io>
tags
saas, sentry, error-tracking, context, breadcrumbs, observability

Sentry Error Capture

Overview

Capture errors and enrich them with structured context so your team can diagnose production issues in seconds instead of hours. Covers captureException, captureMessage, scoped context (withScope / push_scope), breadcrumbs, custom fingerprinting, and beforeSend filtering using @sentry/node v8 and sentry-sdk v2 APIs.

Prerequisites

  • Sentry SDK installed and initialized (@sentry/node v8+ or sentry-sdk v2+)
  • A valid DSN configured via environment variable (SENTRY_DSN)
  • Understanding of try/catch (JS) or try/except (Python) error handling
  • A Sentry project created at sentry.io

Instructions

Step 1 -- Capture Exceptions with Full Stack Traces

Always pass real Error objects (or Python exception instances), never plain strings. Plain strings lose the stack trace, making debugging far harder.

TypeScript (@sentry/node)

typescript
import * as Sentry from '@sentry/node';

// CORRECT -- full stack trace preserved
try {
  await riskyOperation();
} catch (error) {
  Sentry.captureException(error);
}

// WRONG -- no stack trace, hard to debug
Sentry.captureException('something went wrong');

// Wrapping non-Error values into proper Error objects
Sentry.captureException(new Error(`API returned ${statusCode}: ${body}`));

// Capture with inline context (no scope needed for simple cases)
Sentry.captureException(error, {
  tags: { transaction: 'purchase' },
  extra: { orderId, amount },
});

Python (sentry-sdk)

python
import sentry_sdk

# CORRECT -- full traceback preserved
try:
    risky_operation()
except Exception as e:
    sentry_sdk.capture_exception(e)

# Capture current exception implicitly (inside except block)
try:
    risky_operation()
except Exception:
    sentry_sdk.capture_exception()  # captures sys.exc_info() automatically
Step 2 -- Capture Messages for Non-Exception Events

Use captureMessage for events that are not exceptions but still worth tracking: deprecation warnings, capacity thresholds, business logic anomalies.

TypeScript

typescript
// Severity levels: 'fatal' | 'error' | 'warning' | 'info' | 'debug' | 'log'
Sentry.captureMessage('Payment processed successfully', 'info');
Sentry.captureMessage('Deprecated API endpoint accessed', 'warning');
Sentry.captureMessage('Database connection pool exhausted', 'fatal');

Python

python
sentry_sdk.capture_message("Payment gateway timeout", level="warning")
sentry_sdk.capture_message("Daily report generated", level="info")
sentry_sdk.capture_message("Connection pool exhausted", level="fatal")
Step 3 -- Enrich Events with Scoped Context

Use withScope (TypeScript) or push_scope (Python) to attach context to a single event without polluting the global scope. Context is automatically cleaned up when the scope exits.

TypeScript -- withScope

typescript
Sentry.withScope((scope) => {
  // User identity for issue assignment and impact analysis
  scope.setUser({
    id: user.id,
    email: user.email,
    subscription: user.plan,
  });

  // Tags: indexed, searchable in Sentry UI filters
  scope.setTag('payment_provider', 'stripe');
  scope.setTag('feature', 'checkout');

  // Structured context: visible in event detail sidebar
  scope.setContext('payment', {
    amount: 9999,
    currency: 'USD',
    customer_id: 'cus_abc123',
    idempotency_key: 'idem_xyz789',
  });

  // Extra data: arbitrary key-value pairs for debugging
  scope.setExtra('cart', cartItems);

  // Override severity level
  scope.setLevel('fatal');

  // Custom fingerprint to control issue grouping
  scope.setFingerprint(['checkout-failure', paymentProvider]);

  Sentry.captureException(error);
});
// Scope is automatically cleaned up -- global scope unchanged

Python -- push_scope

python
with sentry_sdk.push_scope() as scope:
    scope.user = {"id": user_id, "email": user_email}
    scope.set_tag("feature", "checkout")
    scope.set_extra("cart", cart_items)
    scope.level = "fatal"
    scope.fingerprint = ["checkout-failure", str(error_code)]
    sentry_sdk.capture_exception(error)
# Scope is automatically cleaned up

Breadcrumbs

Breadcrumbs create a trail of events leading up to an error. Sentry auto-captures some (console logs, HTTP requests, DOM events), but manual breadcrumbs add domain-specific context.

TypeScript

typescript
Sentry.addBreadcrumb({
  category: 'auth',
  message: `User ${userId} logged in via ${provider}`,
  level: 'info',
  data: { provider, method: 'oauth2' },
});

Sentry.addBreadcrumb({
  category: 'transaction',
  message: 'Payment initiated',
  level: 'info',
  data: { amount: 49.99, items: 3 },
});
// The next captured error includes all breadcrumbs above

Python

python
sentry_sdk.add_breadcrumb(
    category="auth",
    message=f"User {user_id} logged in via {provider}",
    level="info",
    data={"provider": provider, "method": "oauth2"},
)

sentry_sdk.add_breadcrumb(
    category="transaction",
    message="Payment initiated",
    level="info",
    data={"amount": 49.99, "items": 3},
)

Custom Fingerprinting

Override Sentry's default grouping to control how errors are merged into issues. Without custom fingerprints, Sentry groups by stack trace, which can split logically identical errors or merge unrelated ones.

typescript
// Group all timeout errors for /api/search into one issue
Sentry.withScope((scope) => {
  scope.setFingerprint(['api-timeout', 'search-endpoint']);
  Sentry.captureException(new Error('Search API timeout'));
});

// Group by error type + HTTP status + endpoint
Sentry.withScope((scope) => {
  scope.setFingerprint(['http-error', String(response.status), endpoint]);
  Sentry.captureException(error);
});

// Use {{ default }} to extend rather than replace default grouping
Sentry.withScope((scope) => {
  scope.setFingerprint(['{{ default }}', tenantId]);
  Sentry.captureException(error);
});

Global Filtering with beforeSend

Configure beforeSend during initialization to filter noise, scrub sensitive data, or enrich all events globally.

typescript
Sentry.init({
  dsn: process.env.SENTRY_DSN,
  beforeSend(event, hint) {
    const error = hint?.originalException;

    // Drop specific error types
    if (error instanceof AbortError) return null;
    if (error?.message?.match(/ResizeObserver loop/)) return null;

    // Scrub sensitive headers
    if (event.request?.headers) {
      delete event.request.headers['Authorization'];
      delete event.request.headers['Cookie'];
    }

    // Enrich database errors with subsystem tag
    if (error instanceof DatabaseError) {
      event.tags = { ...event.tags, subsystem: 'database' };
      event.level = 'fatal';
    }

    return event; // Must return event or null
  },

  // Pattern-based noise filtering
  ignoreErrors: [
    'ResizeObserver loop',
    'Non-Error promise rejection',
    /Loading chunk \d+ failed/,
    'Network request failed',
  ],
});

Output

  • Errors with full stack traces and context in the Sentry Issues dashboard
  • Scoped tags and structured context for filtering and search
  • Breadcrumb trails showing the user journey before errors
  • Custom fingerprints grouping related errors into single issues
  • Clean event stream via beforeSend filtering and ignoreErrors
Show full SKILL.md (182 more words)Show less

Error Handling

ErrorCauseSolution
Missing stack traceString passed instead of Error objectAlways use new Error() or extend the Error class
Events not grouped properlyDefault fingerprinting insufficientUse scope.setFingerprint() with domain-specific keys
beforeSend dropping all eventsFunction returns undefinedAlways return event or explicitly null
Scope leaking between requestsGlobal scope modified in async contextUse withScope() / push_scope() for per-request context
Too many events hitting quotaNo filtering or sampling configuredAdd ignoreErrors, beforeSend filters, or sampleRate
Context not showing in Sentry UIUsed setExtra for structured dataUse setContext('name', {...}) for sidebar visibility

Examples

TypeScript -- Express Route with Context
typescript
import express from 'express';
import * as Sentry from '@sentry/node';

const app = express();
Sentry.setupExpressErrorHandler(app);

app.get('/api/users/:id', async (req, res) => {
  Sentry.setUser({ id: req.params.id });
  try {
    const user = await getUser(req.params.id);
    res.json(user);
  } catch (error) {
    Sentry.withScope((scope) => {
      scope.setContext('request', {
        params: req.params,
        query: req.query,
        method: req.method,
      });
      Sentry.captureException(error);
    });
    res.status(500).json({ error: 'Internal server error' });
  }
});
TypeScript -- Batch Processing with Promise.allSettled
typescript
async function processQueue(items: QueueItem[]) {
  const results = await Promise.allSettled(
    items.map(item => processItem(item))
  );
  results.forEach((result, index) => {
    if (result.status === 'rejected') {
      Sentry.withScope((scope) => {
        scope.setTag('queue_item_index', String(index));
        scope.setContext('item', items[index]);
        Sentry.captureException(result.reason);
      });
    }
  });
}
Python -- Background Job Error
python
import sentry_sdk

def process_report(report_id: str, user_id: str):
    sentry_sdk.add_breadcrumb(
        category="jobs",
        message=f"Report generation started: {report_id}",
        level="info",
    )
    try:
        data = fetch_report_data(report_id)
        return generate_pdf(data)
    except Exception as error:
        with sentry_sdk.push_scope() as scope:
            scope.user = {"id": user_id}
            scope.set_tag("job_type", "report_generation")
            scope.set_context("report", {
                "report_id": report_id,
                "stage": "pdf_generation",
            })
            scope.fingerprint = ["report-failure", report_id]
            sentry_sdk.capture_exception(error)
        raise

Resources

Next Steps

  • Performance tracing: Add Sentry.startSpan() to measure operation timing (see sentry-performance-tracing)
  • Release management: Tag errors with release versions for regression detection (see sentry-release-management)
  • Cost tuning: Configure sampleRate and tracesSampleRate to control event volume (see sentry-cost-tuning)

© jeremylongshore, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 4 other files (references) in skills/.curated/sentry-error-capture of jeremylongshore/tons-of-skills-marketplace.

  • SKILL.md
  • references/advanced-techniques.md
  • references/errors.md
  • references/examples.md
  • references/implementation.md

Open the folder on GitHubat commit cfae287

Compare with similar skills

Sentry Error Capture next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Sentry Error Capture compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Sentry Error Capture this skilljeremylongshore/tons-of-skills-marketplace2.8k—~3kAutomated safety check: PassMIT
Cross-Language Coding Standardszereight/gitlab-mcp2k1 repos~1.4kAutomated safety check: PassMIT
Dbgtheodo-group/debug-that158—~2.5kAutomated safety check: PassMIT
Zizkadb Dev SetupZIZKA-AI-SL/ZizkaDB130—~535Automated safety check: NotesCustom licence
Python Script Runnercongchuanling-dot/Cohort182—~577Automated safety check: NotesMIT
Strict Programming Practicescode-yeongyu/oh-my-openagent70k—~9.5kAutomated safety check: PassCustom licence

Similar skills

  • Shared reference for naming, function size, complexity and error handling rules that reviewer agents apply across TypeScript, Python, Go, Rust, Java, C# and Swift.

    2k GitHub starsUsed in 1 repo~1.4k tokens
    DevelopmentAuto-check passed
  • Dbg

    theodo-group/debug-that

    Debug applications using the dbg CLI debugger. An agent skill from theodo-group/debug-that.

    158 GitHub stars~2.5k tokensUpdated today
    DevelopmentAuto-check passed
  • Zizkadb Dev Setup

    ZIZKA-AI-SL/ZizkaDB

    Set up and start the local ZizkaDB development stack. An agent skill from ZIZKA-AI-SL/ZizkaDB.

    130 GitHub stars~535 tokensUpdated 3 days ago
    DevelopmentAuto-check: notes
  • Python Script Runner

    congchuanling-dot/Cohort

    Runs a Python script with checks first: confirms the interpreter version, compiles it for syntax errors, verifies imports, then explains any traceback in plain language.

    182 GitHub stars~577 tokensUpdated 1 mo ago
    DevelopmentAuto-check: notes
  • Strict Programming Practices

    code-yeongyu/oh-my-openagent

    Applies strict, type-first coding rules for Python, Rust, TypeScript and Go, loading the matching language reference before the agent writes or edits any code.

    70k GitHub stars~9.5k tokensUpdated today
    DevelopmentAuto-check passed
  • Shows when to answer a code question through a real language server instead of grep, covering definitions, references, hover, outlines, and errors.

    5.6k GitHub stars~794 tokensUpdated today
    DevelopmentAuto-check passed

More from jeremylongshore/tons-of-skills-marketplace

All 3,342 skills in this repo
  • Performing Security Code Review

    jeremylongshore/tons-of-skills-marketplace

    Execute this skill enables AI assistant to conduct a security-focused code review using the security-agent plugin.

    2.8k GitHub starsUsed in 2 repos~1.3k tokens
    Auto-check: notes
  • Adapting Transfer Learning Models

    jeremylongshore/tons-of-skills-marketplace

    Build this skill automates the adaptation of pre-trained machine learning models using transfer learning techniques.

    2.8k GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Agent Context Loader

    jeremylongshore/tons-of-skills-marketplace

    Execute proactive auto-loading: automatically detects and loads agents.md files.

    2.8k GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Aggregating Performance Metrics

    jeremylongshore/tons-of-skills-marketplace

    Aggregate and centralize performance metrics from applications, systems, databases, caches, and services.

    2.8k GitHub stars~1.2k tokensUpdated today
    Auto-check passed
  • Analyzing Capacity Planning

    jeremylongshore/tons-of-skills-marketplace

    Execute this skill enables AI assistant to analyze capacity requirements and plan for future growth.

    2.8k GitHub stars~947 tokensUpdated today
    Auto-check passed
  • Analyzing Database Indexes

    jeremylongshore/tons-of-skills-marketplace

    Process use when you need to work with database indexing. An agent skill from jeremylongshore/tons-of-skills-marketplace.

    2.8k GitHub stars~2k tokensUpdated today
    Auto-check passed

Categories

Questions about Sentry Error Capture

What does Sentry Error Capture do?

Implement advanced error capture and context enrichment with Sentry. Sentry Error Capture is an agent skill from jeremylongshore/tons-of-skills-marketplace. Implement advanced error capture and context enrichment with Sentry.

When should I use Sentry Error Capture?

Sentry Error Capture fits situations like: adding captureException/captureMessage calls; enriching errors with user context; custom fingerprinting; with sentry error capture.

How do I install Sentry Error Capture in Claude Code?

Run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill sentry-error-capture -a claude-code`. Or copy the skill folder (skills/.curated/sentry-error-capture in jeremylongshore/tons-of-skills-marketplace) into .claude/skills/sentry-error-capture in your project. Claude Code loads it when a task matches its description.

How do I install Sentry Error Capture in Codex?

Run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill sentry-error-capture -a codex`. Or copy the skill folder (skills/.curated/sentry-error-capture in jeremylongshore/tons-of-skills-marketplace) into .agents/skills/sentry-error-capture in your project. Codex loads it when a task matches its description.

Can I use Sentry Error Capture in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill sentry-error-capture -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/sentry-error-capture, .gemini/skills/sentry-error-capture, .github/skills/sentry-error-capture and .opencode/skills/sentry-error-capture in your project.

What does Sentry Error Capture need to run?

SKILL.md names no scripts, command-line tools or credentials: Sentry Error Capture is instructions for the agent only. Our summary lists: Python 3. Its frontmatter pre-approves these tools: Read, Write, Edit, Grep, Glob, Bash(npm:*), Bash(npx:*), Bash(pip:*), Bash(python:*). Compatibility (from SKILL.md): Designed for Claude Code.

Does Sentry Error Capture access the network?

SKILL.md names 2 domains. As links in the text: docs.sentry.io and sentry.io. This is read from the text; nothing was executed.

Is Sentry Error Capture safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Sentry Error Capture use?

Sentry Error Capture is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Sentry Error Capture use?

About 3k tokens (SKILL.md is roughly 12k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 1.1k tokens, read only when the agent opens those files.

What are the alternatives to Sentry Error Capture?

Skills that share tags, products or a category with Sentry Error Capture: Cross-Language Coding Standards (zereight/gitlab-mcp, 2k stars), Dbg (theodo-group/debug-that, 158 stars), Zizkadb Dev Setup (ZIZKA-AI-SL/ZizkaDB, 130 stars) and Python Script Runner (congchuanling-dot/Cohort, 182 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Sentry Error Capture?

jeremylongshore (a GitHub user) maintains it in jeremylongshore/tons-of-skills-marketplace, which has 2,827 GitHub stars. The repository holds 3,342 skills in this directory. The repository was last updated on October 10, 2026.

Source: jeremylongshore/tons-of-skills-marketplace on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.