Install the "sentry-cost-tuning" agent skill from https://github.com/jeremylongshore/tons-of-skills-marketplace/tree/main/skills/.curated/sentry-cost-tuning into .claude/skills/sentry-cost-tuning/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "sentry-cost-tuning", then confirm the skill loads.
Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
Type this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
skills CLI
$ npx skills add jeremylongshore/tons-of-skills-marketplace --skill sentry-cost-tuning -a codex
Project install goes to .agents/skills/; add -g for ~/.codex/skills/.
Install the "sentry-cost-tuning" agent skill from https://github.com/jeremylongshore/tons-of-skills-marketplace/tree/main/skills/.curated/sentry-cost-tuning into .agents/skills/sentry-cost-tuning/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "sentry-cost-tuning", then confirm the skill loads.
Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
skills CLI
$ npx skills add jeremylongshore/tons-of-skills-marketplace --skill sentry-cost-tuning -a cursor
Project install goes to .agents/skills/; add -g for ~/.cursor/skills/.
Install the "sentry-cost-tuning" agent skill from https://github.com/jeremylongshore/tons-of-skills-marketplace/tree/main/skills/.curated/sentry-cost-tuning into .cursor/skills/sentry-cost-tuning/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "sentry-cost-tuning", then confirm the skill loads.
Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
skills CLI
$ npx skills add jeremylongshore/tons-of-skills-marketplace --skill sentry-cost-tuning -a gemini-cli
Project install goes to .agents/skills/; add -g for ~/.gemini/skills/.
Install the "sentry-cost-tuning" agent skill from https://github.com/jeremylongshore/tons-of-skills-marketplace/tree/main/skills/.curated/sentry-cost-tuning into .gemini/skills/sentry-cost-tuning/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "sentry-cost-tuning", then confirm the skill loads.
Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
Installs for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
skills CLI
$ npx skills add jeremylongshore/tons-of-skills-marketplace --skill sentry-cost-tuning -a github-copilot
Project install goes to .agents/skills/; add -g for ~/.copilot/skills/.
Install the "sentry-cost-tuning" agent skill from https://github.com/jeremylongshore/tons-of-skills-marketplace/tree/main/skills/.curated/sentry-cost-tuning into .github/skills/sentry-cost-tuning/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "sentry-cost-tuning", then confirm the skill loads.
GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
skills CLI
$ npx skills add jeremylongshore/tons-of-skills-marketplace --skill sentry-cost-tuning -a opencode
OpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
Install the "sentry-cost-tuning" agent skill from https://github.com/jeremylongshore/tons-of-skills-marketplace/tree/main/skills/.curated/sentry-cost-tuning into .opencode/skills/sentry-cost-tuning/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "sentry-cost-tuning", then confirm the skill loads.
OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
Facts
Skill name
sentry-cost-tuning
GitHub stars
2.8k
Token cost
~4.4k tokens
SKILL.md length
998 words
Files
7 (incl. references)
Skills in repo
3,342
Repo updated
First seen
Licence
MIT
At a glance
Optimize Sentry costs, reduce event volume, and manage quota spend.
Works in 9 steps: Audit Current Usage via the Stats API → Configure Error Sampling with sampleRate → Configure Performance Sampling with… → …
Analyzing Sentry billing
SKILL.md covers Overview, Prerequisites, Instructions and Output, plus 4 more sections
Calls curl and python3; reaches sentry.io; needs SENTRY_AUTH_TOKEN
What it does
Sentry Cost Tuning is an agent skill from jeremylongshore/tons-of-skills-marketplace. Optimize Sentry costs, reduce event volume, and manage quota spend. Use when analyzing Sentry billing, reducing error/transaction volume, configuring sampling rates, or preventing overage charges. Trigger: "reduce sentry costs", "sentry billing optimization", "sentry quota management", "optimize sentry spend", "sentry sampling".
Its SKILL.md is about 4.4k tokens, which your agent loads only when the skill is triggered. The skill folder holds 7 other files, including reference files (for example `references/cost-effective-architecture.md`, `references/errors.md` and `references/examples.md`). Compatibility notes: Designed for Claude Code
It sits in Backend & APIs. It works with Sentry. 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
Analyzing Sentry billing
Reducing error/transaction volume
Configuring sampling rates
Preventing overage charges
Example prompts
“reduce sentry costs”
“sentry billing optimization”
“sentry quota management”
“/sentry-cost-tuning”
Requirements
Python 3
A credential in SENTRY_AUTH_TOKEN
Compatibility (from SKILL.md): Designed for Claude Code
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(curl:*)
Bash(node:*)
Bash(npx:*)
From allowed-tools in the SKILL.md frontmatter.
Runs code
Shell commands in SKILL.md call:
curl
python3
From the folder's file list and the shell code blocks in SKILL.md.
Network
Hosts in commands or code, which the agent is likely to contact:
sentry.io
Also links to:
docs.sentry.io
From URLs in SKILL.md, links to its own repository left out.
Credentials
Names these keys or tokens, usually read from environment variables:
SENTRY_AUTH_TOKEN
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 Cost Tuning loads about 4.4k tokens when it runs, and up to ~5.5k if it reads all its reference files. Until then it costs about 87 tokens; SKILL.md has 998 words of instructions outside code blocks.
Always· name and description, kept in context so the agent knows when to use it
~87
When it runs· the whole SKILL.md, loaded when a task matches
~4.4k
With references· SKILL.md plus every file in references/, read only if the agent opens them
~5.5k
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.
Download SKILL.mdSave it as .claude/skills/sentry-cost-tuning/SKILL.md (or your agent's skills folder). This skill also uses 6 other files; get the full folder from GitHub.
name
sentry-cost-tuning
description
Optimize Sentry costs, reduce event volume, and manage quota spend.
Use when analyzing Sentry billing, reducing error/transaction volume,
configuring sampling rates, or preventing overage charges.
Trigger: "reduce sentry costs", "sentry billing optimization",
"sentry quota management", "optimize sentry spend", "sentry sampling".
Reduce Sentry spend by 60-95% through SDK-level sampling, server-side inbound filters, beforeSend event dropping, and quota management — without losing visibility into production errors that matter.
Prerequisites
Active Sentry account with org:read and project:read scopes on an auth token
Access to the project's Sentry.init() configuration (typically sentry.client.config.ts or instrument.ts)
Current plan tier identified: Developer (free, 5K errors/mo), Team ($26/mo, 50K errors + 100K transactions), or Business ($80/mo, 100K errors + 500K transactions)
SENTRY_AUTH_TOKEN and SENTRY_ORG environment variables set for API calls
@sentry/node >= 8.0 or @sentry/browser >= 8.0 installed
Instructions
Step 1 — Audit Current Usage via the Stats API
Query the Sentry Usage Stats API to understand where volume comes from before making changes. This endpoint returns event counts grouped by category over any time period.
bash
# Pull 30-day usage breakdown by category
curl -s -H "Authorization: Bearer $SENTRY_AUTH_TOKEN" \
"https://sentry.io/api/0/organizations/$SENTRY_ORG/stats/usage/?statsPeriod=30d&groupBy=category&field=sum(quantity)&interval=1d" \
| python3 -c "
import json, sys
data = json.load(sys.stdin)
print('=== 30-Day Usage by Category ===')
for group in data.get('groups', []):
cat = group['by']['category']
total = sum(interval[1] for interval in group.get('series', {}).get('sum(quantity)', []))
print(f' {cat}: {total:,} events')
"
bash
# Identify top error-producing projects
curl -s -H "Authorization: Bearer $SENTRY_AUTH_TOKEN" \
"https://sentry.io/api/0/organizations/$SENTRY_ORG/stats/usage/?statsPeriod=30d&groupBy=project&category=error&field=sum(quantity)" \
| python3 -c "
import json, sys
data = json.load(sys.stdin)
projects = []
for group in data.get('groups', []):
proj = group['by']['project']
total = sum(interval[1] for interval in group.get('series', {}).get('sum(quantity)', []))
projects.append((proj, total))
projects.sort(key=lambda x: -x[1])
print('=== Top Error-Producing Projects ===')
for name, count in projects[:10]:
print(f' {name}: {count:,}')
"
Record the baseline numbers. You need these to measure savings after optimization.
Step 2 — Configure Error Sampling with sampleRate
The sampleRate option in Sentry.init() controls the percentage of error events sent to Sentry. Setting it to 0.1 means only 10% of errors are sent, yielding a 90% cost reduction on the error category.
typescript
import * as Sentry from '@sentry/node';
Sentry.init({
dsn: process.env.SENTRY_DSN,
// 10% of errors sent = 90% cost reduction
// Sentry extrapolates counts in the Issues dashboard
sampleRate: 0.1,
});
Trade-off: Low-frequency errors (< 10 occurrences/day) may be missed entirely. Mitigate this by using beforeSend to always send errors with specific severity or tags rather than relying on blanket sampling.
Step 3 — Configure Performance Sampling with tracesSampleRate and tracesSampler
Performance monitoring (transactions/spans) is typically the largest cost driver. A tracesSampleRate of 0.05 sends only 5% of traces, cutting performance costs by 95%.
typescript
import * as Sentry from '@sentry/node';
Sentry.init({
dsn: process.env.SENTRY_DSN,
// Static: 5% of all traces (95% cost reduction)
tracesSampleRate: 0.05,
// Dynamic: per-endpoint sampling for fine-grained control
// When tracesSampler is defined, it overrides tracesSampleRate
tracesSampler: (samplingContext) => {
const { name, attributes } = samplingContext;
// Never trace health checks, readiness probes, static assets
if (name?.match(/\/(health|healthz|ready|livez|ping|robots\.txt|favicon)/)) {
return 0;
}
if (name?.match(/\.(js|css|png|jpg|svg|woff2?|ico)$/)) {
return 0;
}
// High-value: payment and auth flows get 50% sampling
if (name?.includes('/checkout') || name?.includes('/payment')) {
return 0.5;
}
if (name?.includes('/auth') || name?.includes('/login')) {
return 0.25;
}
// API routes: 5%
if (name?.includes('/api/')) {
return 0.05;
}
// Everything else: 1%
return 0.01;
},
});
The tracesSampler function receives a samplingContext with the transaction name (usually the route) and attributes. Return a number between 0 (drop) and 1 (always send), or true/false.
Step 4 — Drop Noisy Events with beforeSend
The beforeSend hook fires for every error event before it is sent to Sentry. Returning null drops the event entirely — it never counts against quota.
typescript
import * as Sentry from '@sentry/node';
Sentry.init({
dsn: process.env.SENTRY_DSN,
beforeSend(event, hint) {
const error = hint?.originalException;
const message = typeof error === 'string' ? error : error?.message || '';
// Drop ResizeObserver noise (Chrome fires this constantly, never actionable)
if (message.includes('ResizeObserver loop')) return null;
// Drop network errors from flaky client connections
if (/^(Failed to fetch|NetworkError|Load failed|AbortError)$/i.test(message)) {
return null;
}
// Drop cancelled navigation (user clicked away)
if (message.includes('cancelled') || message.includes('AbortError')) {
return null;
}
// Drop browser extension errors by checking stack frames
const frames = event.exception?.values?.[0]?.stacktrace?.frames || [];
if (frames.some(f => f.filename?.match(/extensions?\//i) || f.filename?.match(/^(chrome|moz)-extension:\/\//))) {
return null;
}
// Always send critical errors regardless of sampleRate
// Re-enable any that were sampled out
if (event.level === 'fatal' || event.tags?.critical === 'true') {
return event;
}
return event;
},
// Complementary: block errors from known noisy patterns
ignoreErrors: [
'ResizeObserver loop completed with undelivered notifications',
'ResizeObserver loop limit exceeded',
'Non-Error promise rejection captured',
/Loading chunk \d+ failed/,
/Unexpected token '<'/, // HTML returned instead of JS (CDN issue)
/^Script error\.?$/, // Cross-origin script with no details
],
// Block events from third-party scripts
denyUrls: [
/extensions\//i,
/^chrome:\/\//i,
/^chrome-extension:\/\//i,
/^moz-extension:\/\//i,
/hotjar\.com/,
/intercom\.io/,
/google-analytics\.com/,
/googletagmanager\.com/,
/cdn\.segment\.com/,
],
});
Step 5 — Enable Server-Side Inbound Data Filters (Free)
Inbound data filters drop events at Sentry's edge before they are ingested and counted against quota. They cost nothing to enable.
Navigate to Project Settings > Inbound Filters (or use the API) and enable:
Filter
What it drops
Impact
Browser Extensions
Errors from Chrome/Firefox extensions
5-15% of frontend errors
Legacy Browsers
IE 11, old Safari/Chrome versions
2-10% depending on audience
Localhost Events
Errors from localhost and 127.0.0.1
Dev noise (variable)
Web Crawlers
Bot-triggered errors (Googlebot, Bingbot)
1-5% of frontend errors
Filtered Transactions
Health checks, static asset requests
10-40% of transactions
bash
# Enable inbound filters via API
for filter in browser-extensions legacy-browsers localhost-events web-crawlers; do
curl -s -X PUT \
-H "Authorization: Bearer $SENTRY_AUTH_TOKEN" \
-H "Content-Type: application/json" \
-d '{"active": true}' \
"https://sentry.io/api/0/projects/$SENTRY_ORG/$SENTRY_PROJECT/filters/$filter/"
echo " -> Enabled: $filter"
done
Add custom error message filters for project-specific noise:
Step 6 — Configure Spike Protection and Per-Key Rate Limits
Spike protection is auto-enabled on all Sentry plans and caps burst events during sudden spikes (deploy bugs, infinite loops). Verify it is active under Organization Settings > Spike Protection.
Per-key rate limits restrict events per DSN key per time window. Set these in Project Settings > Client Keys (DSN) > Rate Limiting or via the API:
bash
# Set rate limit: 1000 errors per hour per DSN key
curl -s -X PUT \
-H "Authorization: Bearer $SENTRY_AUTH_TOKEN" \
-H "Content-Type: application/json" \
-d '{"rateLimit": {"window": 3600, "count": 1000}}' \
"https://sentry.io/api/0/projects/$SENTRY_ORG/$SENTRY_PROJECT/keys/$KEY_ID/"
Spend allocations (Team and Business plans): Set per-category budgets under Settings > Subscription > Spend Allocations to cap on-demand spending per billing period.
Step 7 — Optimize Reserved vs On-Demand Volume
Sentry offers two pricing models for volume above the plan's included quota:
Model
Rate (errors)
Best for
Reserved volume
~$0.000180/event (pre-paid blocks)
Predictable workloads
On-demand volume
~$0.000290/event (pay-as-you-go)
Spiky/seasonal traffic
Reserved volume is approximately 38% cheaper per event than on-demand. If your 30-day audit shows consistent volume, purchase reserved blocks to match the P90 usage. Let spikes overflow into on-demand.
Example calculation:
Average monthly errors: 120,000
Plan included: 50,000 (Team plan)
Overage: 70,000
On-demand cost: 70,000 x $0.000290 = $20.30/month
Reserved cost: 70,000 x $0.000180 = $12.60/month
Monthly savings: $7.70 ($92.40/year)
Step 8 — Reduce Event Payload Size
Smaller payloads mean lower bandwidth costs and faster event processing. These settings do not reduce event count but lower overall resource consumption.
typescript
import * as Sentry from '@sentry/node';
Sentry.init({
dsn: process.env.SENTRY_DSN,
// Reduce breadcrumbs from default 100 to 20
maxBreadcrumbs: 20,
// Truncate long string values (default 250)
maxValueLength: 500,
// Disable features you are not actively using
replaysSessionSampleRate: 0, // Session replays off
replaysOnErrorSampleRate: 0, // Error replays off
profilesSampleRate: 0, // Profiling off
beforeSend(event) {
// Truncate large request bodies
if (event.request?.data && typeof event.request.data === 'string') {
if (event.request.data.length > 2000) {
event.request.data = event.request.data.substring(0, 2000) + '...[truncated]';
}
}
// Strip unnecessary headers
if (event.request?.headers) {
const keep = ['content-type', 'user-agent', 'referer', 'accept-language'];
event.request.headers = Object.fromEntries(
Object.entries(event.request.headers)
.filter(([k]) => keep.includes(k.toLowerCase()))
);
}
return event;
},
});
Step 9 — Verify Savings
After deploying changes, wait 48-72 hours and re-run the usage audit from Step 1 to measure actual savings.
bash
# Compare current period vs previous period
curl -s -H "Authorization: Bearer $SENTRY_AUTH_TOKEN" \
"https://sentry.io/api/0/organizations/$SENTRY_ORG/stats/usage/?statsPeriod=7d&groupBy=category&field=sum(quantity)&interval=1d" \
| python3 -c "
import json, sys
data = json.load(sys.stdin)
print('=== Post-Optimization 7-Day Usage ===')
for group in data.get('groups', []):
cat = group['by']['category']
total = sum(interval[1] for interval in group.get('series', {}).get('sum(quantity)', []))
print(f' {cat}: {total:,} events')
print()
print('Compare against your Step 1 baseline to calculate % reduction.')
"
Show full SKILL.md (395 more words)Show less
Output
After completing this skill:
SDK sampling configured: sampleRate for errors, tracesSampler for performance traces
Sentry Cost Tuning 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 Cost Tuning compared with similar skills
Skill
Stars
Used in
Tokens
Auto-check
Licence
Repo updated
Sentry Cost Tuning this skilljeremylongshore/tons-of-skills-marketplace
Enforces that every error in a service is captured to Sentry v8, with patterns for controllers, routes, cron jobs and database performance spans instead of console logging alone.
How do I install Sentry Cost Tuning in Claude Code?
Run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill sentry-cost-tuning -a claude-code`. Or copy the skill folder (skills/.curated/sentry-cost-tuning in jeremylongshore/tons-of-skills-marketplace) into .claude/skills/sentry-cost-tuning in your project. Claude Code loads it when a task matches its description.
How do I install Sentry Cost Tuning in Codex?
Run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill sentry-cost-tuning -a codex`. Or copy the skill folder (skills/.curated/sentry-cost-tuning in jeremylongshore/tons-of-skills-marketplace) into .agents/skills/sentry-cost-tuning in your project. Codex loads it when a task matches its description.
Can I use Sentry Cost Tuning 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-cost-tuning -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-cost-tuning, .gemini/skills/sentry-cost-tuning, .github/skills/sentry-cost-tuning and .opencode/skills/sentry-cost-tuning in your project.
What does Sentry Cost Tuning need to run?
Going by SKILL.md and its folder, Sentry Cost Tuning needs the command-line tools its instructions call (curl and python3) and credentials named SENTRY_AUTH_TOKEN. Our summary lists: Python 3; A credential in SENTRY_AUTH_TOKEN. Its frontmatter pre-approves these tools: Read, Write, Edit, Grep, Glob, Bash(curl:*), Bash(node:*), Bash(npx:*). Compatibility (from SKILL.md): Designed for Claude Code.
Does Sentry Cost Tuning access the network?
SKILL.md names 2 domains. In commands or code: sentry.io; the agent is likely to contact it when it follows the instructions. As links in the text: docs.sentry.io. This is read from the text; nothing was executed.
Is Sentry Cost Tuning 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 Cost Tuning use?
Sentry Cost Tuning 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 Cost Tuning use?
About 4.4k tokens (SKILL.md is roughly 18k 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 Cost Tuning?
Skills that share tags, products or a category with Sentry Cost Tuning: Node Backend Development Guidelines (diet103/claude-code-infrastructure-showcase, 10k stars), Sentry v8 Error Tracking (diet103/claude-code-infrastructure-showcase, 10k stars), Hybrid Cloud Rpc (getsentry/sentry, 46k stars) and Hybrid Cloud Test Gen (getsentry/sentry, 46k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
Who maintains Sentry Cost Tuning?
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.