getsentry/sentry-java is a Java and Android software development kit for sending application errors, events, and diagnostic information to Sentry. It is used by developers working with Java, Android, Kotlin, and other JVM-based applications to monitor software behavior. The catalogue rules, skills, instructions, and setting support workflows around this SDK.
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.
npx agentmods add rules/getsentry/sentry-java/scopesgit clone --depth 1 https://github.com/getsentry/sentry-javaWrote 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.
[](https://agentmods.dev/rules/getsentry/sentry-java/scopes)<a href="https://agentmods.dev/rules/getsentry/sentry-java/scopes"><img src="https://agentmods.dev/badge/rules/getsentry/sentry-java/scopes.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00007 | $0.01710 |
| Opus 5 | $0.00003 | $0.00855 |
| Sonnet 5 | $0.00001 | $0.00342 |
| Haiku 4.5 | $0.00001 | $0.00171 |
Grade A, and why
scopes 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 yesterday.
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.
How it starts
The opening of the file, as written. The whole thing — 127 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Java SDK Hubs and Scopes
Scopes
Scopes implements IScopes and manages three Scope instances, global, isolation and current scope.
For some data, all three Scope instances are combined, for others, a certain one is used exclusively and for some we look at each scope in a certain order and use the data of the first scope that has the data set. This logic is contained in CombinedScopeView.
Data itself is stored on Scope instances.
Scopes also has a parent field, linking the Scopes it was forked off of and a creator String, explaining why it was forked.
Hub
Up until major version 7 of the Java SDK the IHub interface was a central part of the SDK.
In major version 8 we replaced the IHub interface with IScopes. IHub has been deprecated.
While there is some bridging code in place to allow for easier migration, we are planning to remove it in an upcoming major.
Scope Types
We have introduced some new Scope types in the SDK, allowing for better control over what data is attached where. Previously there was a stack of scopes that was pushed and popped. Instead we now fork scopes for a given lifecycle and then restore the previous scopes. Since Hub is gone, it is also never cloned anymore. Separation of data now happens through the different scope types while making it easier to manipulate exactly what you need without having to attach data at the right time to have it apply where wanted.
Global Scope
Global scope is attached to all events created by the SDK.
It can also be modified before Sentry.init has been called.
It can be manipulated using Sentry.configureScope(ScopeType.GLOBAL, (scope) -> { ... }).
Global scope can be retrieved from Scopes via getGlobalScope. It can also be retrieved directly via Sentry.getGlobalScope.
Isolation Scope
Isolation scope can be used e.g. to attach data to all events that come up while handling an incoming request.
It can also be used for other isolation purposes.
It can be manipulated using Sentry.configureScope(ScopeType.ISOLATION, (scope) -> { ... }).
The SDK automatically forks isolation scope in certain cases like incoming requests, CRON jobs, Spring @Async and more.
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.
- yesterday First seen · 127 lines · 7 tokens per session scan A fbb2cb6076b3
scopes is a cursor rule published in the GitHub repository getsentry/sentry-java (1,349 stars, last pushed today), licensed MIT. It adds 7 tokens to every session and 1,710 once invoked, about $0.0000 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.
Other cursor rules, from other repositories
android-viewmodel
Android ViewModel conventions — StateFlow, repository abstraction, coroutines, no LiveData.
swiftui-accessibility
SwiftUI accessibility rules for VoiceOver — labels, hints, traits, values, and attribute preservation.
project-status
PriceGrab shipped state and product backlog (read first).
security-threat-and-stability
Maximum security scrutiny on issues/PRs and stability-first code changes.
best-practices
Engineering best practices for this codebase.
android-gradle-build-logic
Shape Android build logic with Gradle, version catalogs, plugins, convention patterns, and toolchain compatibility.