sentry

sentry is a cursor rule for Cursor from sanjeed5/awesome-cursor-rules-mdc. It costs 2,599 tokens per session, scanned A, original, CC0-1.0.

A set of coding rules for Sentry, a service that records application errors and measures performance. It explains how to initialize its SDK early and keep environment-specific settings such as the DSN in environment variables.

In plain words
What is it for?
Use it when adding Sentry to web applications, server processes, or AWS Lambda functions for error tracking and performance monitoring.
Why use it?
It helps capture errors consistently and avoids missed events caused by late or scattered setup, while keeping configuration out of source code.

Cursor rule for Cursor

Written for Cursor: a Cursor rule (.mdc).

Good fit Use it when adding Sentry to web applications, server processes, or AWS Lambda functions for error tracking and performance monitoring.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/sanjeed5/awesome-cursor-rules-mdc/sentry
About the project

awesome-cursor-rules-mdc is a generator that creates Cursor MDC rule files from structured library information, using semantic search and language models to gather and organize guidance. Developers use it to produce reusable rules for libraries in Cursor, and the catalogue includes 200 of those rules.

sanjeed5/awesome-cursor-rules-mdc · 3,571 stars · on GitHub

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/sanjeed5/awesome-cursor-rules-mdc

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for sentry

README.md
[![agentmods](https://agentmods.dev/badge/rules/sanjeed5/awesome-cursor-rules-mdc/sentry.svg)](https://agentmods.dev/rules/sanjeed5/awesome-cursor-rules-mdc/sentry)
Your own site
<a href="https://agentmods.dev/rules/sanjeed5/awesome-cursor-rules-mdc/sentry"><img src="https://agentmods.dev/badge/rules/sanjeed5/awesome-cursor-rules-mdc/sentry.svg" alt="Measured on agentmods" height="20"></a>
Per session 2,599 This file is loaded in full into every session.
When invoked 2,599 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.02599 $0.02599
Opus 5 $0.01300 $0.01300
Sonnet 5 $0.00520 $0.00520
Haiku 4.5 $0.00260 $0.00260

Measured 3d ago against content hash 5df02b777c5a, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

sentry scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

rules-mdc/sentry.mdc · 334 lines

How it starts

The opening of the file, as written. The whole thing — 334 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Sentry Best Practices

Sentry is our definitive platform for error tracking and performance monitoring. Proper integration ensures we debug faster, ship more reliably, and maintain high application health. This guide outlines the mandatory best practices for all projects.

1. Code Organization and Initialization

Always initialize the Sentry SDK early in your application's bootstrap process. This ensures maximum coverage for errors and performance tracing.

1.1. Early and Centralized Initialization

Initialize Sentry once, as close to your application's entry point as possible. Use environment variables for sensitive data like DSN and for configuration that varies by environment.

BAD: Late or Scattered Initialization

# app/views.py (Django) or a random module
import sentry_sdk

def my_function():
    if not sentry_sdk.is_initialized(): # Don't do this, it's too late and prone to race conditions
        sentry_sdk.init(dsn="YOUR_DSN")
    # ...

GOOD: Application Bootstrap (Python Example)

# app.py or wsgi.py/asgi.py for web apps
import os
import sentry_sdk
from sentry_sdk.integrations.aws_lambda import AwsLambdaIntegration # Example for Lambda

SENTRY_DSN = os.getenv("SENTRY_DSN")
SENTRY_ENVIRONMENT = os.getenv("SENTRY_ENVIRONMENT", "development")
SENTRY_RELEASE = os.getenv("SENTRY_RELEASE", "unknown")
SENTRY_TRACES_SAMPLE_RATE = float(os.getenv("SENTRY_TRACES_SAMPLE_RATE", "0.0")) # Default to 0.0 in prod

if SENTRY_DSN:
    sentry_sdk.init(
        dsn=SENTRY_DSN,
        environment=SENTRY_ENVIRONMENT,
        release=SENTRY_RELEASE,
        enable_tracing=True, # Always enable tracing, sampling controls overhead
        traces_sample_rate=SENTRY_TRACES_SAMPLE_RATE,
        # Add integrations as needed, e.g., for specific frameworks or platforms
        # integrations=[AwsLambdaIntegration()] if SENTRY_ENVIRONMENT == "aws-lambda" else [],
    )

GOOD: Application Bootstrap (JavaScript/TypeScript Example)

// src/index.ts or app.ts
import * as Sentry from "@sentry/node"; // or @sentry/browser, @sentry/react, etc.

const SENTRY_DSN = process.env.SENTRY_DSN;
const SENTRY_ENVIRONMENT = process.env.SENTRY_ENVIRONMENT || "development";
const SENTRY_RELEASE = process.env.SENTRY_RELEASE || "unknown";
const SENTRY_TRACES_SAMPLE_RATE = parseFloat(process.env.SENTRY_TRACES_SAMPLE_RATE || "0.0");

if (SENTRY_DSN) {
    Sentry.init({
        dsn: SENTRY_DSN,
        environment: SENTRY_ENVIRONMENT,
        release: SENTRY_RELEASE,
        integrations: [
            // Add framework-specific integrations here, e.g., new Sentry.Integrations.Http({ tracing: true })
            // new Sentry.Integrations.Express(),
        ],
        tracesSampleRate: SENTRY_TRACES_SAMPLE_RATE,
        enableTracing: true, // Redundant with tracesSampleRate > 0, but good for clarity
    });
}

Read the full file on GitHub · 334 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 334 lines · 2,599 tokens per session scan A 5df02b777c5a

Subscribe to this mod's changes

sentry is a cursor rule published in the GitHub repository sanjeed5/awesome-cursor-rules-mdc (3,571 stars, last pushed 3mo ago), licensed CC0-1.0. It adds 2,599 tokens to every session, about $0.0130 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.