btrace-perfetto

btrace-perfetto is a skill for Claude Code, Codex from getsentry/sentry-java. It costs 72 tokens per session (3,174 once invoked), scanned C, original, MIT.

A workflow for capturing and comparing Android performance traces with Perfetto using a connected device. A trace is a recorded timeline of system and application activity used to find slow operations.

In plain words
What is it for?
Use it to record traces, compare two branches, inspect touch events, and calculate performance differences with trace queries.
Why use it?
It provides evidence for whether an SDK change affects performance instead of relying on guesswork.

Skill for Claude CodeCodex

About the project

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.

getsentry/sentry-java · 1,349 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.

agentmods
npx agentmods add skills/getsentry/sentry-java/btrace-perfetto
Any agent
npx skills add getsentry/sentry-java --skill btrace-perfetto
Clone the repo
git clone --depth 1 https://github.com/getsentry/sentry-java

Made for: Claude Code, Codex.

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 btrace-perfetto

README.md
[![agentmods](https://agentmods.dev/badge/skills/getsentry/sentry-java/btrace-perfetto.svg)](https://agentmods.dev/skills/getsentry/sentry-java/btrace-perfetto)
Your own site
<a href="https://agentmods.dev/skills/getsentry/sentry-java/btrace-perfetto"><img src="https://agentmods.dev/badge/skills/getsentry/sentry-java/btrace-perfetto.svg" alt="Measured on agentmods" height="20"></a>
Per session 72 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,174 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 2 findings. Scan, not verified.
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 $0.00072 $0.03174
Opus 5 $0.00036 $0.01587
Sonnet 5 $0.00014 $0.00635
Haiku 4.5 $0.00007 $0.00317

Measured yesterday against content hash 2fea16d212fa, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade C, and why

btrace-perfetto scanned grade C with 2 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.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

adb shell "rm -rf /storage/emulated/0/Android/data/io.sentry.samples.android/files/rhea-port"

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl -sL "https://repo1.maven.org/maven2/com/bytedance/btrace/rhea-trace-processor/3.0.0/rhea-trace-processor-3.0.0.jar" \
.claude/skills/btrace-perfetto/SKILL.md · 304 lines

How it starts

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

btrace Perfetto Trace Capture

Capture Perfetto traces with btrace 3.0 on a connected Android device, optionally comparing two branches. Opens results in Perfetto UI with a prefilled SQL query. After capture, query traces locally with trace_processor to compute comparison stats.

Prerequisites

Before starting, verify:

  1. Connected device: adb devices shows a device (Android 8.0+, 64-bit)
  2. btrace CLI jar: Check if tools/btrace/rhea-trace-shell.jar exists. If not, download it:
    mkdir -p tools/btrace/traces
    curl -sL "https://repo1.maven.org/maven2/com/bytedance/btrace/rhea-trace-processor/3.0.0/rhea-trace-processor-3.0.0.jar" \
      -o tools/btrace/rhea-trace-shell.jar
    
  3. Perfetto trace_processor: Check if /tmp/trace_processor exists. If not, download it:
    # Download trace_processor (--fail ensures HTTP errors don't leave a file behind)
    curl -sSL --fail "https://get.perfetto.dev/trace_processor" -o /tmp/trace_processor
    
    # Verify magic bytes directly — file(1) output is too inconsistent across
    # versions/platforms to rely on for scripts or PIE binaries.
    magic=$(head -c 4 /tmp/trace_processor 2>/dev/null | od -An -vtx1 -N4 | tr -d ' \n')
    case "$magic" in
      2321*)                               ;; # #! shebang (script)
      7f454c46)                            ;; # ELF (Linux)
      cffaedfe|cefaedfe|feedfacf|feedface) ;; # Mach-O (macOS)
      cafebabe)                            ;; # Mach-O universal
      *)
        echo "Error: Downloaded file is not a valid script or executable (magic: ${magic:-empty})"
        rm -f /tmp/trace_processor
        exit 1
        ;;
    esac
    
    # Make executable only after verification
    chmod +x /tmp/trace_processor
    
  4. Device ABI: Run adb shell getprop ro.product.cpu.abi — btrace only supports arm64-v8a and armeabi-v7a (no x86/x86_64)

Step 1: Parse Arguments

Argument Default Description
branch1 current branch First branch to trace
branch2 main Second branch to compare against
duration 30 Trace duration in seconds
sql-query see below SQL query to prefill in Perfetto UI

Read the full file on GitHub · 304 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. yesterday First seen · 304 lines · 72 tokens per session scan C 2fea16d212fa

Subscribe to this mod's changes

btrace-perfetto is a skill published in the GitHub repository getsentry/sentry-java (1,349 stars, last pushed today), licensed MIT. It adds 72 tokens to every session and 3,174 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it C with 2 findings (recursive force delete, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

analyzing-android-malware-with-apktool

Perform static analysis of Android APK malware using apktool for resource decompilation, jadx for Java source recovery, and androguard for manifest inspection, dangerous permission-combination detection, and identification of obfuscated code, dynamic code loading, and reflection-based API calls. Use to statically…

mukul975/Anthropic-Cybersecurity-Skills · 84 tokens

solopi-ai

通过 SoloPi 的机器可读 CLI 编译和执行 AI 验证计划,管理签名端侧 ExecuTorch 决策模型、持久设备池、无人值守任务、安卓设备、应用、动作、配置、用例步骤与交互录制、回放及性能历史、动态 Agent、批量与重复执行、性能监控、压力测试和证据。适用于需求/AC 到 Result Judge 三态结论、cloud/on-device 决策切换、模型发布门禁,以及 generation 租约的多设备 CI 执行。.

alipay/SoloPi · 127 tokens

argent-tv-interact

Control and inspect TV apps via argent — Apple TV (tvOS), Android TV (leanback), and Amazon Fire TV (Vega). Boot the target, read focus, navigate with the D-pad remote, type, screenshot, and on Vega debug the JS runtime (evaluate, console logs, network inspector). Use when a task targets a TV (runtimeKind "tv", or…

software-mansion/argent · 107 tokens

app-store-preflight-compliance

Pre-submission compliance scanner workflow for Apple App Store apps. Use when reviewing iOS, macOS, tvOS, watchOS, or visionOS projects (Swift, Objective-C, React Native, Expo) for App Store rejection risks, submission readiness, privacy compliance, or guideline violations.

RevylAI/greenlight · 65 tokens

compose-recomposition-performance

Use when investigating Jetpack Compose recomposition performance, skippable/restartable composables, composables.txt or compiler reports, Layout Inspector recomposition counts, or frame-rate State reads in composition vs layout/draw, and it is not yet clear whether the cause is parameter stability or deferred reads.…

vitorpamplona/amethyst · 78 tokens

android-navigation-3

Install and migrate to Jetpack Navigation 3. Use when implementing Navigation 3 patterns including NavDisplay, NavKey routes, deep links, multiple backstacks, scenes (dialogs, bottom sheets), or migrating from Navigation 2.

HoangNguyen0403/agent-skills-standard · 52 tokens