/bama:performancefrom bama
Diagnoses and fixes macOS app performance issues including hangs, stutter, CPU, memory, and energy. Covers main-thread offloading, GPU compositing, and measurement-driven optimization.
Ships in bama. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Fast means two numbers: the first frame after a key press shows in under 100 ms, and nothing on the main thread blocks for more than 50 ms. Every change in this skill starts and ends with a measurement, so you know it helped. Symptom-by-symptom fixes are in recipes.md. For video, audio, camera, Metal, or large image pipelines, also read gpu-media.md.
reproduce -> measure (release build) -> find the line -> fix -> measure again -> commit with the numbers
Reproduce. Write the exact steps, or add a probe command to the
debug bridge (test-mac-app skill) that runs the slow action and logs
the time of each step.
Measure the release build. Debug Swift is 3 to 10 times slower and points at the wrong code.
Find the line. Pick the tool for the symptom:
| Symptom | Tool |
|---|---|
| App freezes, spinning pointer | sample <App> 5, then read the main thread stack |
| Slow action | Time Profiler: xcrun xctrace record --template 'Time Profiler' --attach <App> --time-limit 10s |
| Short freezes while typing or dragging | --template 'Hangs' |
| Stutter while moving or animating | --template 'Animation Hitches' |
| Memory grows | footprint <App>, leaks <App>, --template 'Allocations' |
| Fan, battery | --template 'Energy Log', look for timers and polling |
Read traces as text, not in the Instruments GUI: see "Measuring" in
recipes.md. Delete every .trace after reading. A trace
stores the app's full environment, and an app opened from an agent's
shell inherits that shell's tokens. Never commit or share one.
Fix with the matching recipe.
Measure again with the same steps. Put before and after in the commit message: "Picker opens in 40 ms, was 600 ms".
CALayer once. Pointer
movement changes only small layers. Never redraw a full-screen picture per
mouse event.NSCache.CIContext), Vision, and
AVFoundation already run on the GPU or the Neural Engine. Hand them the
work instead of looping over pixels in Swift.MTKView, compute shaders) only when a measurement shows
Core Animation or Core Image is too slow. Most apps never need it.CGImage from ScreenCaptureKit passes to a layer
without a copy. Keep it as a CGImage or IOSurface. Converting to
NSImage and back costs copies.Done when the slow action has a measured before and after, the after meets the two numbers at the top, and the commit message names both.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
macos-performance, instruments, profiling, main-thread, gpu-compositing
21 skills in this plugin
/agent-cliOptional command line and MCP server for a macOS app, so Claude Code, Codex, and scripts can drive it (list, add, change, search, act) through the running app. Use when the user wants agents to work with their app or its data, asks for a CLI, an MCP server, or automation for the app, or says "Claude should be able to use my app"./app-briefOne-page brief (docs/BRIEF.md) for a new macOS app, written before any code. Use when the user has an app idea, wants to replace an app they pay for, or the research and clone skills are done./app-iconLiquid Glass macOS app icon made as an Icon Composer file (Icon/AppIcon.icon, JSON plus SVG layers), compiled with actool, and reviewed in every look with ictool. Use when the user wants an app icon, a better icon, or a Dock icon./bamaBuild any Mac app. Start here to pick the next skill for a native macOS app./build-and-verifyBuild a SwiftUI macOS app from the command line, install it, and check light and dark window snapshots of every page before calling a change done. Use after any UI code change, when a build fails, or when the user asks to run, screenshot, or check the app./cloneWalk through any existing app (native Mac app with computer use, web app with a browser), screenshot every screen, menu, and dialog, write a screen index, and turn it into user stories. Use when the user wants to clone, rebuild, replace, or copy the design of an app, or says "screenshot every screen".npx claudepluginhub daveebbelaar/bama --plugin bamaOther plugins' skills for the same job