/claude-mods:sentry-opsfrom claude-mods
Configures Sentry error reporting with privacy-first defaults, covering SDK choice, DSN vs auth token, source map upload, beforeSend scrubbing, and testing with a fake DSN. Verified against Sentry JS SDK v11.
Ships in claude-mods. 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.
Read when SKILL.md points to them; scripts run unread.
Sentry's onboarding is built to get data flowing fast, and its defaults reflect that. This skill covers the decisions those defaults make for you, then shows how to check the result by reading the bytes the SDK would send.
Verified against Sentry JavaScript SDK v11 (2026). Exact versions, dates and measurements are in
assets/sentry-facts.jsonand the references.
Evidence labels used here. Keep them when you repeat a claim: [measured] we, or a real setup we name as such, ran it and saw the result. [code] read from published package code, not run. [docs] Sentry's docs say so. [inferred] reasoned from the above. [open] nobody has checked yet.
sendDefaultPii was removed in v11 [code: zero occurrences in @sentry/core,
@sentry/cloudflare and @sentry/astro 11.10.0]. Older guides still say
sendDefaultPii: false. On v11 that line does nothing and raises no error. Unset
dataCollection now collects everything [docs: v10-to-v11 migration].
The same request through withSentry, by configuration [measured, SDK 11.10.0 on Node]:
| Config | What reached the listener |
|---|---|
| No privacy options | Client IP in user, custom headers, full body, query string, cookie names and non-sensitive values, console.log text in breadcrumbs, the error message |
dataCollection off + maxBreadcrumbs: 0 | Error type, stack, message, URL path. The email in the error message still went out |
The above + beforeSend scrub | Error type, stack, URL path. Nothing we planted |
| No DSN | Nothing |
So set both layers. dataCollection decides what gets collected, and beforeSend handles
what your own code put in messages. The built-in denylist matches key names only, so it is
best effort [docs]. cf-connecting-ip and our custom header got past it [measured].
Sentry's snippets are a demo. Treat each default as a question:
| Default in the snippets | Why it is a decision | Sensible start |
|---|---|---|
tracesSampleRate: 1.0 (client and server) | Cost: every trace counts against quota. Docs say to lower it in production. | Leave it out. 0 still counts as tracing enabled, because the check is != null [code] |
browserTracingIntegration() | Browser bytes and quota | Leave out until you use traces |
replayIntegration() at 10% of sessions, 100% on error | Records what users do. Text masking and media blocking are on by default [docs], but that is yours to check. Largest byte cost below | Leave out. If you add it, keep the masks and update your privacy page |
feedbackIntegration() | UI and bytes. Sends what the user types | Only if you will read it |
| Client SDK at all | Server-only setups don't need it. The wizard's Verify step uses a client-side button, so its page may keep waiting [inferred] | Add it only if browser errors matter |
| Source map upload | Sends your source to Sentry and adds a credential to the build | Its own decision, see references/credentials-and-source-maps.md |
Bytes, as minified / gzipped from a minimal entry with esbuild [measured, 11.10.0]. A real
Astro Worker gained about 411 KB raw and 100 KB gzipped, summed per file under dist/server
[measured]. Measure your own build before and after:
| Bundle | Minified | Gzipped |
|---|---|---|
Worker with withSentry | 171 KB | 57 KB |
Browser init only | 91 KB | 32 KB |
| Browser + Replay | 232 KB | 77 KB |
| Browser + Tracing + Replay + Feedback | 340 KB | 115 KB |
Also before installing: Sentry becomes a new data processor, so check your privacy page and any data processing agreement. An organization's US or EU storage region is chosen when it is created and can't be changed afterwards [docs]. Sentry has a project setting to prevent storing IP addresses.
| Runtime | Package | Notes |
|---|---|---|
| Plain Cloudflare Worker | @sentry/cloudflare | withSentry, or its Vite plugin plus instrument.server.ts [docs] |
| Astro on Workers | @sentry/astro + @sentry/cloudflare | Official guide exists. Worked case: references/astro-on-workers.md |
| Cloudflare Pages | @sentry/cloudflare sentryPagesPlugin | Sentry recommends moving to Workers [docs] |
| Hono on Workers | @sentry/hono [docs] | App patterns: hono-ops |
| Astro on Node | @sentry/astro | Its main guide is Node-only [docs] |
| Plain browser | @sentry/browser | |
| Node | @sentry/node |
For anything else, start at docs.sentry.io/platforms. Every doc page has a .md variant,
and docs.sentry.io/llms.txt lists them, which is far easier to read than the rendered
site. For stack-level detail see astro-ops and cloudflare-ops; for metrics, logs and
alerting beyond errors see monitoring-ops.
Worker requirements [docs]: nodejs_compat and compatibility_date of 2024-09-23 or
later. withSentry covers fetch, scheduled, email, queue and tail, and
WorkerEntrypoint classes [code]. It skips SDK setup for OPTIONS and HEAD, so test
with GET or POST [code].
assets/scrub-event.mjs ships a strict STRICT_DATA_COLLECTION and a tested beforeSend:
import { STRICT_DATA_COLLECTION, makeBeforeSend } from "./scrub-event.mjs";
const sentryOptions = (env) => ({
dsn: env.SENTRY_DSN, // unset means nothing is sent
dataCollection: STRICT_DATA_COLLECTION,
maxBreadcrumbs: 0, // console.log text arrives as breadcrumbs otherwise
beforeSend: makeBeforeSend({
isSensitivePath: (path) => path.startsWith("/contact") || path.startsWith("/admin"),
}),
// tracesSampleRate omitted on purpose: no tracing at all
});
Then set "Prevent storing IP addresses" in the project's Security & Privacy settings, and
keep server-side scrubbing on, which is the default [docs]. Full reasoning, what each layer
misses, and what is left in an event: references/privacy-baseline.md.
| DSN | Auth token | |
|---|---|---|
| Can do | Send events to one project. No read access [docs] | Whatever its scopes allow, including reading data |
| Secret? | Semi-public. It ships in browser JS. Abuse means junk events | Yes, a real credential |
| Needed by | The running app | The build, only for source map upload |
| Lives in | Worker env or secret, client config | CI secret or local gitignored file. Never in the Worker's env or a PUBLIC_ variable |
| If leaked | Rotate in Client Keys | Revoke now, check what it could reach |
The wizard shows these side by side, which makes them look like equals. They aren't. Prefer
an organization token over a personal one for CI [docs]. Details and secret-scanning
patterns: references/credentials-and-source-maps.md.
astro dev and unit tests don't prove the real build. The method below has worked on a
production Worker build under local workerd [measured]. "<skill-dir>/scripts/envelope-sink.py"
records what the SDK would send, on loopback:
python "<skill-dir>/scripts/envelope-sink.py" listen --out ./envelopes --count 1 --timeout 120
# wait for its "listening" line, set SENTRY_DSN=http://[email protected]:8191/1,
# then trigger a real error in the real build with planted canary values
python "<skill-dir>/scripts/envelope-sink.py" inspect ./envelopes --forbid [email protected] --strict
Order: scrub tests seen failing first, canary run, no-DSN run with --expect-none, and one
live event to real Sentry last, matched by event id. Steps and the runtime caveats:
references/prove-without-traffic.md. Any listener follows the machine's dev-server rule:
throwaway range, killed before finishing.
sendDefaultPii: false is a silent no-op on v11. See above. Search for it when
upgrading from v10 or copying an older guide.withSentry [measured], and a page throw reached middleware twice. See
the worked case.500.astro answered 404 in production and 500 in dev [measured].dataCollection category defaults to on. mcp arrived in 11.9.0 [docs]. An
explicit list can go stale, and --live on the verifier below trips when one appears.beforeSend. They have their own hooks [docs]. If you
turn those products on, scrub them too./users/1234 goes
out. Change it in beforeSend if your paths carry identifiers.setUser() is always sent, whatever dataCollection.userInfo says [docs].--count 1 plus reading the "received" line catches it.@sentry/* packages must match. @sentry/astro pins its siblings exactly [code].@sentry/agent-plugin doesn't instrument anything. See
references/vetting.md, and supply-chain-defense for the general gate.wrangler secret put and wrangler deploy change a
live environment, so they need the owner's explicit go-ahead.| File | Use |
|---|---|
references/privacy-baseline.md | Both layers, what each misses, sensitive routes, the replay decision |
references/credentials-and-source-maps.md | Token types, where each lives, scanning, the source map decision |
references/prove-without-traffic.md | The method step by step, with what was measured and what wasn't |
references/astro-on-workers.md | Worked case: routes by version, capture points, open questions |
references/vetting.md | Choosing a version, reading packages without installing, the agent plugin and wizard |
assets/scrub-event.mjs | Copy into the app: STRICT_DATA_COLLECTION, scrubEvent, makeBeforeSend |
assets/sentry-facts.json | Catalog of version-bound facts |
scripts/envelope-sink.py | Loopback listener and envelope leak checker |
scripts/check-sentry-facts.py | Staleness check |
Staleness: python "<skill-dir>/scripts/check-sentry-facts.py" --offline checks the
facts against this prose. --live checks npm majors, doc pages, and whether the SDK has
gained a dataCollection category this baseline doesn't turn off.
assets/scrub-event.mjs (opens in a new tab)assets/sentry-facts.json (opens in a new tab)references/astro-on-workers.md (opens in a new tab)references/credentials-and-source-maps.md (opens in a new tab)references/privacy-baseline.md (opens in a new tab)references/prove-without-traffic.md (opens in a new tab)references/vetting.md (opens in a new tab)scripts/check-sentry-facts.py (opens in a new tab)scripts/envelope-sink.py (opens in a new tab)tests/fixtures/clean.envelope (opens in a new tab)tests/fixtures/leaky.envelope (opens in a new tab)tests/run.sh (opens in a new tab)tests/scrub-event.test.mjs (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub 0xdarkmatter/claude-mods --plugin claude-mods116 skills in this plugin
/a11y-opsWeb accessibility end to end: WCAG 2.2 AA, EAA and ADA Title II obligations, audits (axe, pa11y, keyboard, screen reader), the common failures, accessibility statements, and server-rendered Craft CMS/Twig sites (Formie, CKEditor, multi-site lang). Use when asked about a11y, WCAG, EAA, EN 301 549, Section 508, VPAT, NVDA/VoiceOver, focus, skip links, ARIA, landmarks, alt text, form labels or errors, contrast, target size, or 'is my site accessible'./adr-opsAuthor, index, and lint Architecture Decision Records — append-only memory that recovers the WHY behind a system's shape. Triggers on: adr, architecture decision record, decision log, record this decision, supersede an adr, why was this decided, adr template, next adr number./api-design-opsOther plugins' skills for the same job