perf-investigate

perf-investigate is a command for Claude Code from carloshpdoc/ios-workflow-claude. It costs 0 tokens per session (1,791 once invoked), scanned A, original, Apache-2.0.

A guided investigation for iOS performance problems and memory leaks, using Xcode tools that measure execution time and show objects held in memory.

In plain words
What is it for?
Use it to investigate slow screens, hangs, frame drops, or suspected leaks and organize the work into stacked pull requests.
Why use it?
It requires measurements before architectural changes, helping distinguish an observed problem from a guess about its cause.

Command for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the ios-workflow plugin — 22 commands, 3 agents shipped together

Good fit Use it to investigate slow screens, hangs, frame drops, or suspected leaks and organize the work into stacked pull requests.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/carloshpdoc/ios-workflow-claude/perf-investigate
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.

Clone the repo
git clone --depth 1 https://github.com/carloshpdoc/ios-workflow-claude

Made for: Claude Code.

Or install ios-workflow, the plugin that ships this one along with the rest of its 22 commands, 3 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 perf-investigate

README.md
[![agentmods](https://agentmods.dev/badge/commands/carloshpdoc/ios-workflow-claude/perf-investigate/github.svg)](https://agentmods.dev/commands/carloshpdoc/ios-workflow-claude/perf-investigate)
Your own site
<a href="https://agentmods.dev/commands/carloshpdoc/ios-workflow-claude/perf-investigate"><img src="https://agentmods.dev/badge/commands/carloshpdoc/ios-workflow-claude/perf-investigate/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for perf-investigate

Your own site · 80×15
<a href="https://agentmods.dev/commands/carloshpdoc/ios-workflow-claude/perf-investigate"><img src="https://agentmods.dev/badge/commands/carloshpdoc/ios-workflow-claude/perf-investigate.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,791 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00000 $0.01791
Opus 5 $0.00000 $0.00896
Sonnet 5 $0.00000 $0.00358
Haiku 4.5 $0.00000 $0.00179

Measured 10d ago against content hash 7e9fa4f7d770, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

perf-investigate scanned grade A with 0 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 10d 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/ios-workflow/commands/perf-investigate.md · 122 lines

How it starts

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

Perf / Leak Investigation

Project context: Values in angle brackets below (e.g. <scheme>, <JIRA_KEY>, <flag-key-enum>) are resolved at runtime — detect them from the project (xcodebuild -list -json for the scheme, git/gh for repo & owner, the branch name for the Jira key, a codebase search for flag/font files), or ask if they cannot be inferred. This plugin ships no per-project config.

Drive an iOS performance or memory-leak investigation on using Memory Graph + Time Profiler. Enforce data-before-architecture and stacked PRs.

Usage

/perf-investigate <symptom or <JIRA_KEY>-XXXX>

Examples:

/perf-investigate <Feature> place-details opens are slow after 15 cycles
/perf-investigate <JIRA_KEY>-XXXX
/perf-investigate Explore tab leaks BSPlaceDetailVMV3

Triggers

Run this skill when the user mentions any of: "perf", "lento", "slow", "leak", "memory", "vazamento", "TTI", "hang", "jank", "frame drop", "spin", "freezou", "trava".

Hard rules (do not skip)

  1. No architectural change before measurement. Reject hypotheses framed in architectural terms ("the wrapper is wrong", "the navigation pattern leaks") until the user provides a .memgraph (for retention) or a .trace (for TTI/jank).
  2. Memory Graph (.memgraph) for retain cycles, NOT xctrace --template Leaks --attach. The latter fails silently with libmalloc not initialized. See reference_ios_leak_tooling.md.
  3. Time Profiler with --attach works for hangs and CPU sampling. Use it for TTI/slowness investigations.
  4. Compare to a fluid baseline tab. Pick a known-fluid feature in your app as the baseline; capture both the suspect and baseline in the same session.
  5. One PR per logical fix. If the investigation produces 2+ fixes, use stacked PRs — see commit-and-pr skill.

Workflow

Phase 1 — Triage (no code yet)

  1. Restate the symptom in observable terms (e.g., "after 15 opens, next open takes 6s" not "the wishlist is slow").
  2. Decide the right tool:
    • "X is retained / leaking / accumulating" → Memory Graph (Tool 2 in the tooling memory).
    • "X is slow / hangs / janky" → Time Profiler (Tool 3 in the tooling memory).
    • "Memory grows over time without leaks" → Allocations Mark-Heap (Instruments GUI only — fall back to user).
  3. Ask the user to capture the right artifact and save to ~/Desktop/<descriptive-name>.{memgraph,trace}. Provide the exact xctrace command if Time Profiler is needed.
  4. Also ask for a baseline capture from a comparable fluid tab (usually Explore) when relevant.

Read the full file on GitHub · 122 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. 10d ago First seen · 122 lines · 0 tokens per session scan A 7e9fa4f7d770

Subscribe to this mod's changes

perf-investigate is a command published in the GitHub repository carloshpdoc/ios-workflow-claude (7 stars, last pushed 3mo ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 1,791 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.