A tool that gives AI agents programmatic access to Apple Instruments trace data. Instruments is normally a GUI-only tool — this tool bridges the gap by exporting .trace files into DuckDB, where they can be queried with SQL.
Given an Instruments .trace file, this tool will:
- Export the trace to DuckDB + Parquet (via
export_to_duckdb.py) - Explore the exported tables — CPU profiling, hitches, hangs, signposts, Core Animation, SwiftUI updates, RunLoop activity, and more
- Prepare derived views for frame-level analysis (via
prepare_analysis.py) - Analyze performance data using SQL queries with full schema knowledge
Requires macOS with Xcode, uv, and DuckDB:
brew install duckdb
curl -LsSf https://astral.sh/uv/install.sh | sh# Claude Code
claude install-skill jlreyes/instruments-analyzer
# Any agent (via skills.sh)
npx skills add jlreyes/instruments-analyzerClone and copy the skill files into your project's .claude/skills/ directory:
git clone https://github.com/jlreyes/instruments-analyzer.git
cp -r instruments-analyzer/. your-project/.claude/skills/instruments-analyzer/git clone https://github.com/jlreyes/instruments-analyzer.git
cd instruments-analyzerxcrun xctrace record --template 'SwiftUI' --time-limit 20s \
--output ./traces/recording.trace \
--attach YourApp --no-promptOr use the included PerfDebugging.tracetemplate in Instruments.
./scripts/export_to_duckdb.py traces/recording.trace traces/recording/analysis.duckdb# Use with Claude Code
# Analyze the performance trace in traces/recording/analysis.duckdb.
# Or query directly with DuckDB
duckdb traces/recording/analysis.duckdb
SELECT * FROM hitches ORDER BY duration_ns DESC LIMIT 10;| File | Description |
|---|---|
SKILL.md |
The skill prompt — Instruments → DuckDB workflow |
SCHEMAS.md |
Full DuckDB schema reference for all exported tables |
scripts/export_to_duckdb.py |
Exports Instruments .trace to DuckDB + Parquet |
scripts/prepare_analysis.py |
Creates analysis views, frame summaries, cascade analysis |
PerfDebugging.tracetemplate |
Instruments template for recording traces |
scroll_and_animation.md |
Jank diagnosis workflow — interaction windowing, cascade analysis, per-frame attribution, root cause clustering, and prioritized fix plans. |
MIT