Agent skill

Hz Perfetto Debug

by meta-quest in meta-quest/agentic-tools

Analyzes Meta VR and Horizon OS VR performance using Perfetto traces — frame timing, CPU/GPU bottlenecks, render pass analysis.

Apache-2.0Auto-check passedMobile

Install Hz Perfetto Debug

skills CLI
$ npx skills add meta-quest/agentic-tools --skill hz-perfetto-debug -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install meta-quest/agentic-tools hz-perfetto-debug --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/meta-quest/agentic-tools.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/hz-perfetto-debug .claude/skills/hz-perfetto-debug && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
hz-perfetto-debug
GitHub stars
215
Token cost
~2.8k tokens
SKILL.md length
1,204 words
Files
6 (incl. references)
Skills in repo
34
Repo updated
First seen
Licence
Apache-2.0

At a glance

Analyzes Meta VR and Horizon OS VR performance using Perfetto traces — frame timing, CPU/GPU bottlenecks, render pass analysis.

  • Works in 12 steps: Capture a Trace → List Available Traces → Load a Trace → …
  • Profiling frame drops
  • SKILL.md covers When to Use, VR Frame Time Targets, metavr Setup and Quick Start Workflow, plus 6 more sections
  • Calls npx

What it does

Hz Perfetto Debug is an agent skill from meta-quest/agentic-tools. Analyzes Meta VR and Horizon OS VR performance using Perfetto traces — frame timing, CPU/GPU bottlenecks, render pass analysis. Use when profiling frame drops, jank, or thermal issues on Meta VR devices. Build paths: all Meta VR app stacks; use hz-quest-verify-first if the build path is unclear.

Its SKILL.md is about 2.8k tokens, which your agent loads only when the skill is triggered. The skill folder holds 6 other files, including reference files (for example `references/analyzing-traces.md`, `references/capturing-traces.md` and `references/frame-timing.md`).

It sits in Mobile, covering Mobile performance. The repository describes itself as: Agent Skills for Meta Quest/Horizon OS VR Development. The licence is Apache-2.0.

When your agent uses it

  • Profiling frame drops
  • Thermal issues on Meta VR devices

Example prompts

  • “Use the hz-perfetto-debug skill to analyz Meta VR and Horizon OS VR performance using Perfetto traces — frame timing, CPU/GPU bottlenecks, render…”
  • “/hz-perfetto-debug”

Requirements

  • Node.js
  • Pre-approved tools (allowed-tools): Bash(metavr:*), Bash(hzdb:*), Bash(npx:*)

Workflow steps

12 steps, taken from the step headings in SKILL.md.

  1. Capture a Trace
  2. List Available Traces
  3. Load a Trace
  4. Get Performance Overview
  5. Run SQL Queries
  6. Analyze Thread States
  7. Get GPU Metrics
  8. Validate Trace Quality
  9. Identify Target Process
  10. Identify Game Engine
  11. Find Key Threads
  12. Detect Frame Boundaries

What it can do on your machine

Read from SKILL.md and the folder at commit 3a8553d. 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:

    • Bash(metavr:*)
    • Bash(hzdb:*)
    • Bash(npx:*)

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • npx

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use npx, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Hz Perfetto Debug loads about 2.8k tokens when it runs, and up to ~12k if it reads all its reference files. Until then it costs about 79 tokens; SKILL.md has 1,204 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~79
When it runs · the whole SKILL.md, loaded when a task matches
~2.8k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~12k

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.

SKILL.md

The full file from meta-quest/agentic-tools at commit 3a8553d, republished under its Apache-2.0 licence (© meta-quest). 1,204 words, ~2,791 tokens.

Download SKILL.mdSave it as .claude/skills/hz-perfetto-debug/SKILL.md (or your agent's skills folder). This skill also uses 5 other files; get the full folder from GitHub.
name
hz-perfetto-debug
description
Analyzes Meta VR and Horizon OS VR performance using Perfetto traces — frame timing, CPU/GPU bottlenecks, render pass analysis. Use when profiling frame drops, jank, or thermal issues on Meta VR devices. Build paths: all Meta VR app stacks; use hz-quest-verify-first if the build path is unclear.
allowed-tools
Bash(metavr:*), Bash(hzdb:*), Bash(npx:*)
license
Apache-2.0

Perfetto Debug Skill

When to Use

Use this skill when investigating VR performance issues on Meta VR devices:

  • Frame drops, jank, or stuttering
  • CPU or GPU bottlenecks
  • Render pass overhead and GPU utilization
  • Thermal throttling and clock frequency changes
  • Frame timing variance and missed vsync deadlines
  • Thread contention and synchronization issues
  • High draw call counts or overdraw

VR Frame Time Targets

These are the hard deadlines for each refresh rate. If a frame exceeds its target, the compositor must reproject or the user sees a stale frame.

Refresh RateFrame Time BudgetNotes
120 Hz8.3 msSupported on Quest 2, Quest 3, Quest 3S
90 Hz11.1 msSupported on Quest 2, Quest Pro, Quest 3, Quest 3S
72 Hz13.9 msDefault on all Quest devices
60 Hz16.7 msMedia apps only (Quest 2); interactive apps must use 72 Hz+

Missing a frame deadline by even 1 ms causes a stale frame (reprojection). Stale frames above 10% of total frames indicate a serious performance problem.

metavr Setup

Perfetto tracing is powered by the metavr CLI — install the standalone binary on your PATH (see the metavr-cli skill), or invoke via npx with no install:

bash
metavr --version

Examples below use the bare metavr command; if you use the npm distribution, prefix with npx -y. Connect your Meta VR device via USB with developer mode enabled before capturing traces.

Quick Start Workflow

1. Capture a Trace
bash
# Capture a 5-second trace from the currently running VR app
metavr perf capture

# Specify duration and target app
metavr perf capture --duration 10000 --app com.example.myapp

# Enable GPU render stage tracing for detailed pass analysis
metavr perf capture --gpu-render-stage

# Enable XR runtime metrics
metavr perf capture --xr-runtime

# Custom output name
metavr perf capture -o my-session-name

The capture auto-detects the foreground VR app if --app is not specified. CPU scheduling and GPU metrics tracing are enabled by default. The trace is pulled to your local machine automatically.

2. List Available Traces
bash
metavr perf traces

Returns .pftrace files sorted by modification time (newest first). Searches standard directories including ~/Documents, ~/Downloads, and the current working directory.

3. Load a Trace
bash
metavr perf load <trace-file>

Loads and processes the trace for analysis. Accepts a hex session ID, filename (with or without .pftrace extension), or a full/relative path.

4. Get Performance Overview
bash
metavr perf context

Returns a structured performance analysis including:

  • CPU and GPU frame timing statistics
  • Thread breakdown with utilization percentages
  • GPU counter summaries (if available)
  • Detected bottlenecks and recommendations
5. Run SQL Queries
bash
metavr perf query <session-id> "SELECT ts, dur, name FROM slice WHERE name LIKE '%PlayerLoop%' LIMIT 20"

Executes arbitrary SQL against the loaded Perfetto trace database. All Perfetto tables are available: slice, thread_track, thread, process, counter, counter_track, args, sched_slice, and more.

6. Analyze Thread States
bash
metavr perf thread-state <session-id> <utid>

# With time range
metavr perf thread-state <session-id> <utid> --start-ts 1000000 --end-ts 5000000000

Returns a thread state breakdown showing how much time the thread spent running, sleeping, blocked, or waiting for CPU. Useful for identifying whether a thread is CPU-bound, I/O-bound, or starved.

7. Get GPU Metrics
bash
metavr perf gpu-counters <session-id> --start-ts 100,200,300 --end-ts 150,250,350

Returns GPU metric counters (mean, standard deviation, quantiles) for GPU frame ranges. Requires at least 20 frames for statistical accuracy. Metrics include texture fetch rates, shader ALU capacity, vertex processing, and fragment shading statistics.

Detailed Analysis Workflow

Follow these steps in order for a thorough performance investigation.

Step 1: Validate Trace Quality

Before analyzing, confirm the trace is usable:

  • Duration: At least 2 seconds of data (ideally 3-5 seconds)
  • Slice count: Should have thousands of slices for a meaningful trace
  • Process presence: The target app process must be present
sql
SELECT
  (MAX(ts) - MIN(ts)) / 1e9 AS duration_seconds,
  COUNT(*) AS total_slices
FROM slice

If the trace has fewer than 1000 slices or is under 1 second, it may not contain enough data for meaningful analysis. Capture a new trace with metavr perf capture.

Step 2: Identify Target Process

Find the application process (not system services):

sql
SELECT upid, pid, name
FROM process
WHERE name NOT LIKE 'com.oculus%'
  AND name NOT LIKE '/system%'
  AND name NOT LIKE 'com.android%'
  AND name IS NOT NULL
ORDER BY pid

For known apps, filter directly by package name.

Step 3: Identify Game Engine

Look for engine-specific markers:

EngineKey Markers
UnityPlayerLoop, UnityMain, PhaseSync, PostLateUpdate.FinishRendering
UnrealUGameEngine::Tick, FEngineLoop::Tick, RHI Thread
Native OpenXRxrWaitFrame, xrBeginFrame, xrEndFrame without engine markers
Step 4: Find Key Threads

Identify the threads that matter for VR rendering:

sql
SELECT t.utid, t.tid, t.name, p.name AS process_name
FROM thread t
JOIN process p USING(upid)
WHERE p.name = '<target-process>'
ORDER BY t.name

Critical threads to locate:

ThreadPurpose
Main thread (UnityMain / GameThread)Game logic, physics, scripts
Render thread (UnityGfx / RenderThread)Draw call submission
GPU completion (GPU completion / RHI Thread)GPU fence waiting
Worker threads (Job.Worker / TaskGraph)Parallel workloads

Once you have a thread's utid, use metavr perf thread-state <session-id> <utid> to get a quick breakdown of its running/sleeping/blocked time.

Step 5: Detect Frame Boundaries

Find frame start/end markers to segment per-frame analysis:

  • Unity: PlayerLoop slices on the main thread define frame boundaries
  • Unreal: FEngineLoop::Tick slices on the game thread
  • OpenXR: xrWaitFrame to xrEndFrame sequences
Step 6: Analyze Expensive Functions

Find what consumes the most time per frame:

sql
SELECT name, COUNT(*) AS call_count, SUM(dur)/1e6 AS total_ms, AVG(dur)/1e6 AS avg_ms
FROM slice
WHERE track_id IN (
  SELECT id FROM thread_track WHERE utid = <main_thread_utid>
)
GROUP BY name
ORDER BY total_ms DESC
LIMIT 20
Step 7: Check High-Frequency Calls

Functions called excessively per frame can indicate batching issues:

sql
SELECT name, COUNT(*) AS calls
FROM slice
WHERE track_id IN (
  SELECT id FROM thread_track WHERE utid = <utid>
)
  AND dur < 100000
GROUP BY name
HAVING calls > 1000
ORDER BY calls DESC
Show full SKILL.md (492 more words)Show less
Step 8: Analyze GPU Render Passes

See the GPU analysis reference for detailed render pass breakdown, surface analysis, and GPU counter interpretation.

Key Perfetto Concepts

ConceptDescription
SliceA timed span of execution (function call, frame, render pass). Has ts (start), dur (duration), name, and track_id.
TrackA timeline lane. Thread tracks hold slices for a specific thread. Counter tracks hold metric values over time.
Thread (utid)Unique thread ID within the trace. Use utid (not tid) for joins — tid can be reused.
Process (upid)Unique process ID within the trace. Use upid (not pid) for joins.
TimestampsAll timestamps are in nanoseconds. Divide by 1e6 for milliseconds, 1e9 for seconds.
CounterA time-series metric (GPU utilization, clock frequency, temperature). Stored in the counter table.
ArgsKey-value metadata attached to slices. Accessed via the args table joined on arg_set_id.

Performance Targets

MetricTargetWarningCritical
Frame time (90 Hz)< 11.1 ms> 11.1 ms> 16.7 ms
Stale frame rate< 5%> 10%> 25%
Main thread utilization< 80% of budget> 80%> 95%
GPU utilization< 85% of budget> 85%> 95%
Frame variance (std dev)< 1 ms> 2 ms> 4 ms
Draw calls per frame< 100> 200> 500

Engine-Specific Notes

Unity
  • PhaseSync: VR vsync alignment mechanism. Appears as idle time at the start of PlayerLoop. This is normal and intentional — do NOT flag as wasted time.
  • Single-pass multiview: Both eyes rendered in one pass. If you see two render passes per frame, the app may be using multi-pass rendering (less efficient).
  • Dynamic batching: Watch for high SetPass call counts, which indicate materials are not being batched.
  • IL2CPP vs Mono: IL2CPP builds have different function naming in traces. Look for mangled C++ names instead of C# method names.
Unreal Engine
  • RHI Thread: Unreal uses a separate RHI (Render Hardware Interface) thread for GPU command submission. Check this thread for driver overhead.
  • Forward vs Deferred: Forward rendering is preferred on Meta VR. Deferred rendering has significantly higher GPU cost.
  • Blueprint Tick: Heavy Blueprint usage shows up as UObject::ProcessEvent. High counts indicate Blueprints should be converted to C++.
  • Nativized Blueprints: Show up with __StaticExec suffix in trace names.

Common Pitfalls

  • Do NOT report PhaseSync or xrWaitFrame idle time as a performance problem — these are intentional frame pacing mechanisms.
  • GPU render pass names like surface#0 are not descriptive — correlate them with the resolution and MSAA level to identify what they render.
  • Thread names can be truncated in traces. UnityMain may appear as UnityMai or similar.
  • Always use utid (not tid) when joining thread-related tables in SQL queries.
  • Timestamps are nanoseconds. A common mistake is treating them as microseconds.
  • Counter values are instantaneous samples, not averages over a period.

References

For detailed guides on specific topics, see:

© meta-quest, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 5 other files (references) in skills/hz-perfetto-debug of meta-quest/agentic-tools.

  • SKILL.md
  • references/analyzing-traces.md
  • references/capturing-traces.md
  • references/frame-timing.md
  • references/gpu-analysis.md
  • references/sql-queries.md

Open the folder on GitHubat commit 3a8553d

Compare with similar skills

Hz Perfetto Debug 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.

Hz Perfetto Debug compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Hz Perfetto Debug this skillmeta-quest/agentic-tools215—~2.8kAutomated safety check: PassApache-2.0
React Native Best Practicesvercel-labs/openreview1.7k17 repos~1.1kAutomated safety check: PassMIT
Dongle Crash Analysishaumacher/phoneblock367—~1.9kAutomated safety check: NotesGPL-3.0
Perfetto Trace Analysisjameshnsears/QuoteUnquote1002 repos~1.7kAutomated safety check: PassApache-2.0
React Native Best Practicescallstackincubator/agent-skills1.7k4 repos~3.1kAutomated safety check: PassMIT
Kototoro Browse Source ScrollKototoro-app/Kototoro613—~793Automated safety check: PassApache-2.0

Similar skills

  • React Native Best Practices

    vercel-labs/openreview

    Official

    A prioritized rule set for React Native and Expo apps covering list performance, animation, navigation, UI patterns, state, rendering, monorepos and configuration.

    1.7k GitHub starsUsed in 17 repos~1.1k tokens
    MobileAuto-check passed
  • Dongle Crash Analysis

    haumacher/phoneblock

    Decode and analyze an ESP32 dongle crash report (uploaded .coredump).

    367 GitHub stars~1.9k tokensUpdated 6 days ago
    MobileAuto-check: notes
  • Perfetto Trace Analysis

    jameshnsears/QuoteUnquote

    Analyzes Perfetto traces to find the root cause of latency, memory, or jank issues in Android apps.

    100 GitHub starsUsed in 2 repos~1.7k tokens
    MobileAuto-check passed
  • React Native Best Practices

    callstackincubator/agent-skills

    Official

    Provides React Native performance optimization guidelines for FPS, TTI, bundle size, memory leaks, re-renders, and animations.

    1.7k GitHub starsUsed in 4 repos~3.1k tokens
    MobileAuto-check passed
  • Kototoro Browse Source Scroll

    Kototoro-app/Kototoro

    Diagnose and fix Kototoro Browse/Explore page content source scrolling jank when many sources exist.

    613 GitHub stars~793 tokensUpdated today
    MobileAuto-check passed
  • Levyra Android Performance

    LUC4N3X/Levyra-deepsound

    Automatically use for Android runtime performance investigations involving Perfetto/System Trace, jank, latency, startup, CPU scheduling, blocking, memory, I/O, IPC, graphics, power, or measured…

    590 GitHub stars~3.2k tokensUpdated today
    MobileAuto-check passed

More from meta-quest/agentic-tools

All 34 skills in this repo
  • Hz Android 2D Porting

    meta-quest/agentic-tools

    Guides porting existing Android 2D apps to Meta VR and Horizon OS — input adaptation, panel layout, and design requirements.

    215 GitHub stars~2.1k tokensUpdated 15 days ago
    Auto-check passed
  • Hz API Upgrade

    meta-quest/agentic-tools

    Upgrades Meta VR apps to newer Horizon OS SDK versions — migration guides, deprecated API replacements, changelog.

    215 GitHub stars~1.8k tokensUpdated 15 days ago
    Auto-check passed
  • Hz Iwsdk Webxr

    meta-quest/agentic-tools

    Builds WebXR experiences for Meta VR and Horizon OS using the Immersive Web SDK (IWSDK) — ECS architecture, Three.js integration, spatial UI.

    215 GitHub stars~3k tokensUpdated 15 days ago
    Auto-check passed
  • Hz Metavrx Layout SDK

    meta-quest/agentic-tools

    Build multi-window Meta Horizon OS experiences with the MetaVrx Layout SDK in Jetpack Compose or React Native.

    215 GitHub stars~855 tokensUpdated 15 days ago
    Auto-check passed
  • Hz New Project Creation

    meta-quest/agentic-tools

    Scaffolds new Meta VR and Horizon OS projects after the build path is selected — Standard Android, Meta Spatial SDK, Unity, Unreal, or WebXR.

    215 GitHub stars~2.3k tokensUpdated 15 days ago
    Auto-check passed
  • Hz React Native Expo

    meta-quest/agentic-tools

    Build and iterate on React Native apps for Meta VR / Horizon OS with Expo.

    215 GitHub stars~2.8k tokensUpdated 15 days ago
    Auto-check passed

Categories

Questions about Hz Perfetto Debug

What does Hz Perfetto Debug do?

Analyzes Meta VR and Horizon OS VR performance using Perfetto traces — frame timing, CPU/GPU bottlenecks, render pass analysis. Hz Perfetto Debug is an agent skill from meta-quest/agentic-tools. Analyzes Meta VR and Horizon OS VR performance using Perfetto traces — frame timing, CPU/GPU bottlenecks, render pass analysis.

When should I use Hz Perfetto Debug?

Hz Perfetto Debug fits situations like: profiling frame drops; thermal issues on Meta VR devices.

How do I install Hz Perfetto Debug in Claude Code?

Run `npx skills add meta-quest/agentic-tools --skill hz-perfetto-debug -a claude-code`. Or copy the skill folder (skills/hz-perfetto-debug in meta-quest/agentic-tools) into .claude/skills/hz-perfetto-debug in your project. Claude Code loads it when a task matches its description.

How do I install Hz Perfetto Debug in Codex?

Run `npx skills add meta-quest/agentic-tools --skill hz-perfetto-debug -a codex`. Or copy the skill folder (skills/hz-perfetto-debug in meta-quest/agentic-tools) into .agents/skills/hz-perfetto-debug in your project. Codex loads it when a task matches its description.

Can I use Hz Perfetto Debug 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 meta-quest/agentic-tools --skill hz-perfetto-debug -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/hz-perfetto-debug, .gemini/skills/hz-perfetto-debug, .github/skills/hz-perfetto-debug and .opencode/skills/hz-perfetto-debug in your project.

What does Hz Perfetto Debug need to run?

Going by SKILL.md and its folder, Hz Perfetto Debug needs the command-line tools its instructions call (npx). Our summary lists: Node.js. Its frontmatter pre-approves these tools: Bash(metavr:*), Bash(hzdb:*), Bash(npx:*).

Does Hz Perfetto Debug access the network?

SKILL.md contains no URLs. Its commands use npx, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Hz Perfetto Debug 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 Hz Perfetto Debug use?

Hz Perfetto Debug is published under the Apache-2.0 licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Hz Perfetto Debug use?

About 2.8k tokens (SKILL.md is roughly 11k 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 9.2k tokens, read only when the agent opens those files.

What are the alternatives to Hz Perfetto Debug?

Skills that share tags, products or a category with Hz Perfetto Debug: React Native Best Practices (vercel-labs/openreview, 1.7k stars), Dongle Crash Analysis (haumacher/phoneblock, 367 stars), Perfetto Trace Analysis (jameshnsears/QuoteUnquote, 100 stars) and React Native Best Practices (callstackincubator/agent-skills, 1.7k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Hz Perfetto Debug?

meta-quest (a GitHub organization) maintains it in meta-quest/agentic-tools, which has 215 GitHub stars. The repository holds 34 skills in this directory. The repository was last updated on September 24, 2026.

Source: meta-quest/agentic-tools on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.