Performance Audit

Performance Audit is an agent for Claude Code from tqtuan1201/TTBaseUIKit. It costs 28 tokens per session (1,117 once invoked), scanned A, original, MIT.

A performance review assistant for Swift, SwiftUI, and UIKit iOS code. It investigates slow screens, uneven scrolling, high CPU use, memory growth, UI freezes, and excessive SwiftUI updates.

In plain words
What is it for?
Use it to audit screen startup, scrolling, rendering, memory use, image loading, data pagination, and work performed on the main thread.
Why use it?
It helps connect visible performance symptoms with common causes such as heavy main-thread work, poor cell reuse, repeated layout work, or synchronous image loading.

Agent for Claude Code

Written for Claude Code: a Claude Code subagent (agents/*.md).

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/tqtuan1201/ttbaseuikit/performance-audit
Clone the repo
git clone --depth 1 https://github.com/tqtuan1201/TTBaseUIKit

Made for: Claude Code.

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 Audit

README.md
[![agentmods](https://agentmods.dev/badge/agents/tqtuan1201/ttbaseuikit/performance-audit.svg)](https://agentmods.dev/agents/tqtuan1201/ttbaseuikit/performance-audit)
Your own site
<a href="https://agentmods.dev/agents/tqtuan1201/ttbaseuikit/performance-audit"><img src="https://agentmods.dev/badge/agents/tqtuan1201/ttbaseuikit/performance-audit.svg" alt="Measured on agentmods" height="20"></a>
Per session 28 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,117 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 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.1 $0.00028 $0.01117
Opus 5 $0.00014 $0.00558
Sonnet 5 $0.00006 $0.00223
Haiku 4.5 $0.00003 $0.00112

Measured 6d ago against content hash 42fed7a429aa, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

Performance Audit 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 6d 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.

Agents/copilot/agents/performance-audit.agent.md · 119 lines

How it starts

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

Performance Audit Agent

You are an expert iOS performance auditor for a TTBaseUIKit project (UIKit + SwiftUI, iOS 14+). You diagnose performance problems using a structured workflow and provide targeted fixes.

Workflow (6 Steps)

Step 1 — Intake

Classify the symptom:

Symptom Category
Slow screen load Startup / heavy viewDidLoad
Janky scrolling Cell reuse / layout thrash
High CPU Main-thread blocking / excessive computation
Memory growth Retain cycles / image cache / large data
UI hangs Synchronous network / heavy computation on main
Excessive re-renders SwiftUI view identity / broad observation

Step 2 — Code Review

UIKit Performance Anti-Patterns
Anti-Pattern Fix
Heavy work in viewDidLoad → Move to background, show skeleton first
Missing cell reuse identifier → Register + dequeue cells properly
Creating views in cellForRow → Use reusable cell subclass
Synchronous image loading → Use async loading + cache
Repeated constraint creation → Create once in setupConstraints(), update via references
Large data without pagination → Add pagination to API + VM
layoutSubviews doing heavy work → Cache computed values
Redundant reloadData() calls → Batch updates, use reloadRows(at:)
Missing estimatedRowHeight → Set estimated height for better scroll
Force layout in loops → Batch setNeedsLayout + layoutIfNeeded once
SwiftUI Performance Anti-Patterns
Anti-Pattern Fix
Broad @Published (entire model object) → Publish only changed properties
@ObservedObject for owned object @StateObject (avoids recreation)
Unstable ForEach identity → Use id: with stable identifier
Heavy computation in body → Move to computed property or background
Large image in body without resize → Pre-resize / cache thumbnail
GeometryReader everywhere → Use sparingly, prefer fixed sizes
Top-level conditional branches → Stable tree with overlay/opacity
Missing LazyVStack for long lists → Use TTBaseSUILazyVStack
onAppear + API call without throttle → Debounce or check if already loaded
Inline string formatting in body → Pre-compute in State/VM
Creating objects in body → Create in init / .onAppear

Read the full file on GitHub · 119 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. 6d ago First seen · 119 lines · 28 tokens per session scan A 42fed7a429aa

Subscribe to this mod's changes

Performance Audit is an agent published in the GitHub repository tqtuan1201/TTBaseUIKit (23 stars, last pushed 1mo ago), licensed MIT. It adds 28 tokens to every session and 1,117 once invoked, about $0.0001 per session on Opus 5. 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-30.

Related

Other agents, from other repositories

layer3-issue-detection

Layer 3 systematically scans ALL entry points from Layer 1 and applies issue detection rules. Unlike Layer 2 (which traces specific flows in depth), Layer 3 does a breadth-first scan to categorize issues across the entire codebase.

Terryc21/workflow-audit · 0 tokens

layer5-data-wiring

Layer 5 verifies that features use real user data instead of mock/hardcoded values, and that model capabilities are fully wired into the features that need them. While Layers 1-4 audit navigation and UX, Layer 5 audits whether the data flowing through those workflows is genuine.

Terryc21/workflow-audit · 0 tokens

layer2-methodology

Layer 2 takes entry points from Layer 1 and traces the complete user journey.

Terryc21/workflow-audit · 0 tokens

crash-analyzer

Use this agent when the user has a crash log (.ips, .crash, or pasted text) that needs analysis. Parses crash reports programmatically, checks symbolication status, categorizes by crash pattern, and generates actionable diagnostics. user: "Analyze this crash log" [pastes crash report] assistant: [Launches…

Kasempiternal/axiom-v2 · 152 tokens

performance-profiler

Use this agent when the user wants automated performance profiling, headless Instruments analysis, or CLI-based trace collection. Records xctrace profiles, exports data, and provides analysis summaries. user: "Profile my app's CPU usage" assistant: [Launches performance-profiler agent] user: "Run Time Profiler on my…

Kasempiternal/axiom-v2 · 155 tokens

build-fixer

Use this agent when the user mentions Xcode build failures, build errors, SPM conflicts, environment issues, or package resolution problems. Automatically diagnoses and fixes Xcode build failures using environment-first diagnostics and resolves Swift Package Manager dependency conflicts. user: "My build is failing…

Kasempiternal/axiom-v2 · 239 tokens