sentry-unreal
CLAUDE.md173 starsChanged 5 months agoMITView on GitHub
This project is the Sentry SDK for Unreal Engine which provides crash and error monitoring as well as performance tracking for games built with Unreal Engine. It wraps multiple Sentry SDKs for supported platforms (sentry-native for Windows/Linux/macOS/Xbox/WinGDK/PlayStation/Nintendo, sentry-cocoa for macOS/iOS, sentry-java for Android) into a single Unreal Engine plugin and extends them with Unreal Engine-specific functionality. For sentry-native platforms SDK supports multiple crash handler backends. The backend is selected in Sentry.Build.cs at build time via the UseNativeBackend setting configured in…
In this repository5 other files it gives its agents.
- build-depsSkill
- packSkill
- ue-buildSkill
- ue-integration-testSkill
- ue-unit-testSkill
The file
Show its rules and text
We split this CLAUDE.md into the rules it gives an agent
17 rules. About 0 are common, 9 are distinctive, and 8 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈9
Distinctive · estimate
This author's own choices. Worth a look.
8
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Very specific: line 118
Create Sentry<Name>Test.{h,cpp} under IntegrationTests/ as a subclass of FSentryBaseIntegrationTest and implement Run()
- Very specific: line 119
Add an entry to the dispatch table in USentryPlaygroundGameInstance::CheckForPendingIntegrationTest mapping the command-line switch to a …
- Very specific: line 120
Document the switch in sample/README.md under the Integration Tests section
- Very specific: line 186
When introducing a new public API that becomes part of the common interface, ensure that a corresponding stub is added to its Null …
- Very specific: line 193
Use file naming pattern {Platform}SentryXxx.cpp for platform implementations (e.g., AndroidSentrySubsystem.cpp)
- Very specific: line 194
Run clang-format on changed C++ files before committing: git diff --name-only --diff-filter=d $(git merge-base main HEAD) -- …
- Distinctive: line 195
No BOM (Byte Order Mark) in source files
- Very specific: line 197
Avoid giving a UENUM and a USTRUCT/UCLASS the same base name after prefix stripping (e.g., ESentryFoo + FSentryFoo both become SentryFoo in …
- Distinctive: line 210
Never commit secrets, credentials, API keys, or tokens to the repository
- Distinctive: line 211
Never print or display environment variables that may contain secrets (passwords, API keys, auth tokens, DSNs)
- Distinctive: line 212
When checking environment variables, only verify if they are set (non-empty), don't output their values
- Distinctive: line 216
When introducing a new SDK feature or changing existing behavior, consider whether the Unreal plugin documentation needs to be updated as …
- Distinctive: line 224
If the build, test, or script execution fails, try to understand the root cause of the error and suggest a fix.
- Distinctive: line 230
When implementing features that wrap native SDK functionality, check APIs in the following order (proceed to next source only if previous …
- Distinctive: line 245
Local source: - Check env vars specifying local repository path.
- Very specific: line 257
When researching how Unreal Engine implements specific features (subsystems, modules, plugins, build pipeline, etc.), check the …
- Distinctive: line 265
If the env var is not set, ask the user for the path before falling back to online documentation.
≈ “Common” is an estimate: at least 1 in 5 of the 12,729 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Project Overview
This project is the Sentry SDK for Unreal Engine which provides crash and error monitoring as well as performance tracking for games built with Unreal Engine. It wraps multiple Sentry SDKs for supported platforms (sentry-native for Windows/Linux/macOS/Xbox/WinGDK/PlayStation/Nintendo, sentry-cocoa for macOS/iOS, sentry-java for Android) into a single Unreal Engine plugin and extends them with Unreal Engine-specific functionality.
Plugin Architecture
Plugin Modules
- Sentry - Main plugin API with platform-specific implementations (Runtime module)
- SentryEditor - Editor utilities, settings UI, build tools (Editor module)
Plugin Source Structure
plugin-dev/Source/
├── Sentry/
│ ├── Public/ # Public API headers (SentrySubsystem.h, SentrySettings.h, SentryLibrary.h)
│ └── Private/
│ ├── Android/ # Android implementation (sentry-java via JNI)
│ ├── Apple/ # Base for Mac and iOS (sentry-cocoa)
│ ├── GenericPlatform/ # Base for Microsoft, Linux, PS, Switch (sentry-native)
│ ├── HAL/ # Hardware Abstraction Layer
│ ├── Interface/ # Abstract interfaces
│ ├── IOS/ # iOS overrides for Apple
│ ├── Linux/ # Linux overrides for GenericPlatform
│ ├── Mac/ # macOS overrides for Apple/GenericPlatform
│ ├── Microsoft/ # Windows/Xbox/WinGDK base, overrides GenericPlatform
│ ├── Null/ # Stubs for unsupported platforms
│ ├── Performance/ # Performance monitors (frame time, GC, network, game stats)
│ ├── SessionReplay/ # Session replay recording (backbuffer capture, MP4 encoder)
│ ├── Tests/ # Unit test specs
│ ├── Utils/ # Common utilities
│ └── Windows/ # Windows overrides for Microsoft
├── SentryEditor/ # Editor utilities
└── ThirdParty/ # Pre-built platform SDKsPlatform Hierarchy
sentry-native (C/C++ SDK)
├── GenericPlatform/ # Base implementation for all sentry-native platforms
│ ├── Microsoft/ # Shared Windows + Xbox + WinGDK code
│ │ ├── Windows/ # Windows-specific overrides
│ │ └── Xbox/ # Xbox-specific overrides (private extension)
│ │ └── WinGDK/ # WinGDK-specific overrides (private extension)
│ ├── Mac/ # macOS-specific overrides (native backend)
│ ├── Linux/ # Linux-specific overrides
│ ├── PlayStation/ # PlayStation-specific (private extension)
│ └── Switch/ # Nintendo Switch-specific (private extension)
sentry-cocoa (Objective-C SDK)
├── Apple/ # Base implementation for all Apple platforms
│ ├── Mac/ # macOS-specific overrides (cocoa backend)
│ └── IOS/ # iOS-specific overrides
sentry-java (Java/Kotlin SDK)
└── Android/ # Android implementation (JNI interop)
Null/ # Stubs for unsupported platformsCrash Handler Backends
For sentry-native platforms SDK supports multiple crash handler backends. The backend is selected in Sentry.Build.cs at build time via the UseNativeBackend setting configured in SentrySettings.
| Platform | Default backend | Alternative backend |
| Windows (x64, ARM64) | Crashpad | Native |
| Linux (x64, ARM64) | Crashpad | Native |
| macOS | Cocoa | Native |
| Xbox/WinGDK | Breakpad | Native |
Each platform's ThirdParty directory contains subdirectories per backend (e.g. Crashpad/ + Native/, Cocoa/ + Native/, or Breakpad/ + Native/).
Public API
Core:
SentrySubsystem- Main SDK entry point (initialize, capture events, manage scope)SentrySettings- Plugin configuration (DSN, options, feature toggles)SentryLibrary- Blueprint function library for instantiating Sentry objects
Sentry Entities:
SentryEvent,SentryBreadcrumb,SentryScope,SentryUser,SentryAttachment,SentryHint,SentryFeedback,SentryMetric,SentryLog- Data objects representing Sentry concepts
Tracing:
SentryTransaction,SentrySpan,SentryTransactionContext,SentrySamplingContext- Tracing and performance measurement
Callbacks:
SentryBeforeSendHandler,SentryBeforeBreadcrumbHandler,SentryBeforeLogHandler,SentryBeforeMetricHandler,SentryTraceSampler- Hooks for customizing SDK behavior
Utilities:
SentryVariant- Universal value type for passing data to Sentry APIs (tags, context, etc.)SentryOutputDevice/SentryErrorOutputDevice- UE log output integration
Platform Implementation Pattern
- Public API is platform-agnostic
- Platform-specific implementations in
Private/{Platform}/directories - Abstract interfaces in
Interface/define contracts - Wrapper classes translate platform-specific SDKs to Unreal APIs
Sample Project
The sample/ directory contains SentryPlayground demo game used for manual testing (demo UI) and CI integration tests.
- Integration test dispatch:
sample/Source/SentryPlayground/SentryPlaygroundGameInstance.cpp—CheckForPendingIntegrationTestmaps command-line switches (e.g.-crash-capture) to test factories - Integration test implementations:
sample/Source/SentryPlayground/IntegrationTests/— one class per test, each extendingFSentryBaseIntegrationTest - Sentry configuration:
sample/Config/DefaultEngine.iniunder[/Script/Sentry.SentrySettings]section - Logs:
sample/Saved/Logs/- runtime logs, useful for debugging
Adding a new integration test:
- Create
Sentry<Name>Test.{h,cpp}underIntegrationTests/as a subclass ofFSentryBaseIntegrationTestand implementRun() - Add an entry to the dispatch table in
USentryPlaygroundGameInstance::CheckForPendingIntegrationTestmapping the command-line switch to a factory lambda - Document the switch in
sample/README.mdunder the Integration Tests section
Refer to sample/README.md for detailed documentation.
Console Support
Console support (PlayStation, Xbox/WinGDK, Switch) is provided via private plugin extensions stored in separate repositories.
Extension paths
Path to extensions source code may be set via environment variables. When working on console-related tasks, check them first, only ask to provide path explicitly if these aren't available or invalid.
SENTRY_PLAYSTATION_PATH→ PS5SENTRY_XBOX_PATH→ XSX, XB1, WinGDKSENTRY_SWITCH_PATH→ Switch, Switch2
Setup console extensions:
pwsh ./scripts/init-consoles.ps1 -All # All platforms
pwsh ./scripts/init-consoles.ps1 -PS5 -XSX # Specific platformsThis builds extensions and integrates them into sample/Platforms/{Platform}/:
- Binaries copied to
Plugins/Sentry/Source/ThirdParty/ - Sources symlinked for live editing (changes go directly to extension repo)
- Config symlinked (
{Platform}Engine.ini)
Extension structure:
sentry-{platform}/unreal/
├── Sentry/Source/Sentry/Private/ # Platform implementation ({Platform}SentrySubsystem.cpp)
└── sample-config/ # Platform-specific sample project settingsAdding console-specific features: Edit symlinked sources in extension repo. Follow same patterns as main plugin ({Platform}SentryXxx.cpp).
Refer to Building for Consoles in CONTRIBUTING.md for build instructions.
Crash Reporter
The plugin includes an optional external crash reporter - a .NET desktop application that shows a user-facing dialog when a crash occurs, allowing players to submit feedback and review crash details (tags, context, stacktrace). Supported on Windows, Linux, and macOS (x64 and ARM64).
- Sources: local checkout via
SENTRY_CRASH_REPORTER_PATHenv var
Development Guidelines
Project Setup
To work with the Unreal project, it has to be properly set up (symlink plugin source code into sample/Plugins, download dependencies).
# Initialize (first-time setup - downloads SDK dependencies via GitHub CLI, CI provides pre-built binaries)
pwsh ./scripts/init-win.ps1 # Windows
./scripts/init.sh # macOS/LinuxTo build platform SDKs and other dependencies locally (optional - useful when testing unreleased changes), use the /build-deps skill.
Supported Unreal Engine versions are listed in scripts/packaging/engine-versions.txt. When using an engine built from source, the .uproject file will contain a GUID instead of a version number in the EngineAssociation field.
Common Instructions
- Before implementing new plugin features that wrap existing native SDK functionality, examine the relevant SDK's API (
sentry-native,sentry-cocoa, orsentry-java) to understand its usage, check platform availability, and identify interop requirements (JNI for Android, Objective-C++ for Apple). Refer toNative SDK API Lookup Orderin Quick References for where to find SDK APIs. - When introducing a new public API that becomes part of the common interface, ensure that a corresponding stub is added to its
Nullimplementation to avoid compilation errors on unsupported platforms. - Package plugin and update snapshot after adding/removing files under
plugin-devdir (use/packskill).
Code Style
- Source files require copyright notice:
Copyright (c) YYYY Sentry. All Rights Reserved.(forYYYYuse file creation year) - Use file naming pattern
{Platform}SentryXxx.cppfor platform implementations (e.g., AndroidSentrySubsystem.cpp) - Run clang-format on changed C++ files before committing:
git diff --name-only --diff-filter=d $(git merge-base main HEAD) -- 'plugin-dev/Source/**/*.h' 'plugin-dev/Source/**/*.cpp' | xargs clang-format -i - No BOM (Byte Order Mark) in source files
- Files must end with a single empty line (newline at EOF)
- Avoid giving a
UENUMand aUSTRUCT/UCLASSthe same base name after prefix stripping (e.g.,ESentryFoo+FSentryFooboth becomeSentryFooin Python). If unavoidable, addmeta = (ScriptName = "...")to theUENUMto resolve the collision.
Project Build & Testing
Build and test workflows are available as skills:
/ue-build- Build sample project for a target platform/ue-unit-test- Run Sentry unit tests/ue-integration-test- Run integration tests/build-deps- Build plugin SDK dependencies locally and refresh ThirdParty binaries
Security
- Never commit secrets, credentials, API keys, or tokens to the repository
- Never print or display environment variables that may contain secrets (passwords, API keys, auth tokens, DSNs)
- When checking environment variables, only verify if they are set (non-empty), don't output their values
Documentation
When introducing a new SDK feature or changing existing behavior, consider whether the Unreal plugin documentation needs to be updated as part of the change.
For guidance on content, structure, and writing style, look for similar documentation in sibling SDKs. Reuse existing patterns whenever possible to keep documentation consistent across SDKs.
The SENTRY_DOCS_PATH environment variable points to a local checkout of the documentation repository where any required updates should be made.
Troubleshooting
- If the build, test, or script execution fails, try to understand the root cause of the error and suggest a fix. Check logs for additional issue insights.
Quick References & Tips
Native SDK API Lookup Order
When implementing features that wrap native SDK functionality, check APIs in the following order (proceed to next source only if previous is unavailable or lacks context):
- ThirdParty headers - pre-built SDK headers and libraries:
plugin-dev/Source/ThirdParty/Win64/- sentry-native (C headers + .lib), subdirs:Crashpad/,Native/plugin-dev/Source/ThirdParty/WinArm64/- same as Win64 for ARM64plugin-dev/Source/ThirdParty/Linux/- sentry-native (C headers + .a), subdirs:Crashpad/,Native/plugin-dev/Source/ThirdParty/LinuxArm64/- same as Linux for ARM64plugin-dev/Source/ThirdParty/Mac/- subdirs:Cocoa/(Objective-C headers + .dylib),Native/(C headers + .a)plugin-dev/Source/ThirdParty/IOS/- sentry-cocoa (Objective-C framework)plugin-dev/Source/ThirdParty/Android/- sentry-java (.aar/.jar)
- Repo submodules - full SDK sources in
modules/:modules/sentry-native- sentry-native submodulemodules/sentry-java- sentry-java submodule
- Local source - Check env vars specifying local repository path; if not set, prompt user; if not provided, proceed to next source:
SENTRY_NATIVE_PATH- sentry-native repositorySENTRY_COCOA_PATH- sentry-cocoa repositorySENTRY_JAVA_PATH- sentry-java repository
- GitHub - Fetch from GitHub as last resort:
Unreal Engine Source Lookup
When researching how Unreal Engine implements specific features (subsystems, modules, plugins, build pipeline, etc.), check the UNREAL_ENGINE_ROOT environment variable for the path to a local UE source tree. Key source locations within the engine:
Engine/Source/Runtime/- Core runtime modules (Core, CoreUObject, Engine, etc.)Engine/Source/Editor/- Editor modulesEngine/Source/Developer/- Developer tools and utilitiesEngine/Source/Programs/- Standalone programs (UnrealBuildTool, AutomationTool, etc.)Engine/Plugins/- Built-in engine plugins
If the env var is not set, ask the user for the path before falling back to online documentation.
Reading Environment Variables
On Windows, when checking env vars via PowerShell through the Bash tool, use the .NET method with single-quoted strings to avoid shell interpolation issues:
[System.Environment]::GetEnvironmentVariable('VAR_NAME')Useful Resources
- Main SDK documentation: https://develop.sentry.dev/sdk/overview/
- Internal contributing guide: https://docs.sentry.io/internal/contributing/
- Unreal Engine SDK documentation: https://docs.sentry.io/platforms/unreal/
Other Related Code & Repositories
- sentry-native: crash and error monitoring on Windows/Linux and game consoles
- sentry-java: crash and error monitoring on Android
- sentry-cocoa: crash and error monitoring on macOS and iOS
- sentry-desktop-crash-reporter: external crash reporter dialog for Windows/Linux/macOS
- sentry-cli: uploading debug symbols for symbolicating stack traces gathered via the SDK
- sentry-android-gradle-plugin: uploading Android debug symbols
- app-runner: PowerShell module used in integration tests
- sentry-docs: documentation sources for Sentry products
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

