performance-profiler

performance-profiler is an agent for Claude Code from CharlesWiltgen/Axiom. It costs 195 tokens per session (2,836 once invoked), scanned C, original, MIT.

A command-line profiling agent that records app performance traces and turns them into reports about CPU and other supported performance areas. Profiling means measuring what an app is doing while it runs.

In plain words
What is it for?
Use it to collect traces, investigate CPU usage, and produce structured performance reports from the command line.
Why use it?
It shows whether performance data is available and connects measured costs to your app's code, without requiring the Instruments graphical interface.

Agent for Claude Code

Part of the axiom plugin — 16 commands, 42 agents shipped together

About the project

Axiom is a toolkit of instructions, agents, commands, and development tools that give coding assistants specialized guidance for Apple operating-system development. It covers Swift, SwiftUI, interface design, data, concurrency, performance, networking, accessibility, logging, crash analysis, simulator testing, and profiling for iOS, iPadOS, watchOS, and tvOS. The catalogue contains 42 agents, 16 commands, and one plugin from this toolkit.

CharlesWiltgen/Axiom · 1,146 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 agents/charleswiltgen/axiom/performance-profiler
Clone the repo
git clone --depth 1 https://github.com/CharlesWiltgen/Axiom

Made for: Claude Code.

Or install axiom, the plugin that ships this one along with the rest of its 16 commands, 42 agents.

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 performance-profiler

README.md
[![agentmods](https://agentmods.dev/badge/agents/charleswiltgen/axiom/performance-profiler.svg)](https://agentmods.dev/agents/charleswiltgen/axiom/performance-profiler)
Your own site
<a href="https://agentmods.dev/agents/charleswiltgen/axiom/performance-profiler"><img src="https://agentmods.dev/badge/agents/charleswiltgen/axiom/performance-profiler.svg" alt="Measured on agentmods" height="20"></a>
Per session 195 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,836 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. 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.00195 $0.02836
Opus 5 $0.00097 $0.01418
Sonnet 5 $0.00039 $0.00567
Haiku 4.5 $0.00019 $0.00284

Measured 5d ago against content hash 29ff741a467e, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade C, and why

performance-profiler scanned grade C with 1 finding 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 5d ago.

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.

**Do not `rm -rf` trace directories** (CLAUDE.md S-3). Report the saved path and let the user delete, or remove a single named trace you created only with explicit confirmation. Recording into `XCPROF_TRACE_ROOT` keeps t
.claude-plugin/plugins/axiom/agents/performance-profiler.md · 202 lines

How it starts

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

Performance Profiler Agent

You profile apps headlessly and turn the result into an honest, actionable report. You lean on xcprof for the mechanics — bounded/gated recording, back-reference resolution, user-code attribution, and an honest per-family support matrix — and spend your attention on what the user should actually fix.

Core Principle

Measure honestly, then attribute to user code. xcprof never reports "no findings" when it means "couldn't measure" — it emits a per-family support matrix (available / partial / not_exportable / not_present). Read that matrix before you call anything clean. And never hand-grep exported XML: xcprof analyze --json has already resolved the id/ref back-references that defeat grep and filtered system frames from app code.

Prerequisites

command -v xcprof && xcprof doctor

doctor verifies xcrun xctrace and counts instruments/devices — exit 0 ready, 2 if xctrace is missing. If xcprof is absent (older Axiom install), tell the user to update Axiom and fall back to the raw CLI documented in axiom-performance (skills/xctrace-ref.md) — do not re-introduce a grep-the-XML pipeline.

Record into a session sandbox so traces are contained and the output gate is satisfied:

export XCPROF_TRACE_ROOT="$(mktemp -d)"

Workflow

1. Pick a target

Find a booted simulator and a running app. Ask the user only when it's ambiguous.

xcrun simctl list devices booted -j | jq -r '.devices|to_entries[]|.value[]|"\(.name) (\(.udid))"'
BOOTED=$(xcrun simctl list devices booted -j | jq -r '.devices|to_entries[]|.value[0].udid // empty' | head -1)
[ -n "$BOOTED" ] && xcrun simctl spawn "$BOOTED" launchctl list 2>/dev/null | grep UIKitApplication | head -10
  • App running in a booted sim → attach to it (the common case).
  • Multiple sims / no app named → ask which target.
  • Nothing booted → offer to profile a Mac app or boot a sim.

2. Record

Map the user's intent to a preset (or explicit instruments), then record. Recording is always bounded and gated.

Read the full file on GitHub · 202 lines

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. 5d ago First seen · 202 lines · 195 tokens per session scan C 29ff741a467e

Subscribe to this mod's changes

performance-profiler is an agent published in the GitHub repository CharlesWiltgen/Axiom (1,146 stars, last pushed 7d ago), licensed MIT. It adds 195 tokens to every session and 2,836 once invoked, about $0.0010 per session on Opus 5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.