/unity-dev:unity-profilingfrom unity-dev
Measures frame time, hitches, and GC allocations in Unity using ProfilerRecorder counters. Provides reference docs, C# resources, and a before/after comparison workflow.
Ships in unity-dev. 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; scripts run unread.
"It feels smoother now" survives until someone else plays it. A frame time alone is barely better: one number, from one moment, on one machine, with nothing to hold it against.
| The situation | Read |
|---|---|
| Starting from nothing; "how many draw calls is this"; "which counters exist on my version"; a counter reads zero | reference/counters.md |
| "The frame rate drops when…" — taking the measurement: warm-up, window size, run modes, the log line and the JSONL schema | reference/frame-windows.md |
| "It hitches when the third pickup spawns" — hitches around spawning, streaming or pooling; a system that builds the same thing twice | reference/work-counters.md |
| "did my change actually help"; building the before/after table; a comparison that refuses | reference/compare.md |
| A window in hand and no cause yet: first-appearance hitch, GC, synchronous loads, distant geometry | reference/where-the-time-goes.md |
| No counter names the cost and you need the marker inside the frame | reference/raw-capture.md |
| A frame-time budget that a test fails on, every run, against this machine's recorded baseline | reference/perf-tests.md · templates/PerfRegressionTest.cs |
"is it the GC" and whose: allocation calls per Update and LateUpdate phase; GetAllocatedBytesForCurrentThread reads 0 | reference/gc-per-phase.md · resources/GcAllocProbe.cs |
| Memory grows by a step each time a screen or match is rebuilt; runtime materials and meshes | reference/runtime-asset-leaks.md · resources/OwnedAssets.cs · templates/AssetLeakSoakTest.cs |
| A frame time read on a shared machine; post-processing cost; CPU or GPU in the Editor | reference/frame-hygiene.md |
Files to copy into Assets/ — namespace UnityDev.Perf, Runtime, no package required:
resources/CounterCatalog.cs, resources/FrameSampler.cs, resources/WorkCounters.cs,
resources/ProfilerRawCapture.cs, plus resources/GcAllocProbe.cs with GcAllocProbeOpener.cs
for allocation by phase and resources/OwnedAssets.cs for runtime-asset ownership (that one is
gameplay code). The rest are instrumentation, not gameplay; keep them behind a
development-build check before shipping.
What settles a performance question is a window — a fixed number of frames of a named situation, summarised into one row — taken twice, with one thing changed in between.
A driven run is not a hardware benchmark.
batchmode-nographics,editor-windowedand a player build are three different instruments. Each is internally consistent and none of their numbers mean anything against another's. Every window records which instrument produced it, and the comparison script refuses to subtract across them. And a human playing the actual build still decides shader compilation, GPU upload and whether the thing feels good — measurement narrows the question, it does not answer it.
1 · List the counters this build exposes. Never recall them. Names differ by render pipeline,
graphics backend, platform and version, and a wrong name produces a recorder that reads 0 —
indistinguishable from "this build draws nothing". resources/CounterCatalog.cs, then
reference/counters.md.
2 · Sample a window. 90 frames after 30 warm-up frames, sampled in LateUpdate at the end of
the execution order with a Stopwatch as the clock. Out comes one greppable [PERF] line and one
JSONL record. resources/FrameSampler.cs, then reference/frame-windows.md.
3 · Change exactly one thing. Two changes in one window cannot be attributed, and the wrong one gets kept.
4 · Re-run the same situation and compare. Same seed, same instrument, three windows a side.
scripts/compare_windows.py, then reference/compare.md.
The complaint is "it hitches when the third pickup spawns in the hazard lane". Booted into that situation with a fixed seed, one window says:
[PERF] window=hazard-lane mode=editor-windowed frames=90 ft_med=8.31 ft_p95=12.90 ft_max=41.2
hitches=2 draw_med=412 tris_med=51200 gc_sum=184320 disc[pickup-pool]=214 missing=1 zero=0
Read it in that order. The median is fine, so the game is not uniformly heavy; ft_p95 at 12.90
against a median of 8.31 is unevenness. Draw calls and triangles are the same as the run before,
so it is not a rendering cost. The last number is the finding: the pickup pool threw away
214 units of work during those ninety frames while completing seventeen. The lane selector is
flipping across a 1.3-unit lane boundary and cancelling the set it was building each time.
A 0.2-unit dead band on that boundary, then the same window again: discarded 214 → 7, ft_p95
12.90 → 9.10 ms, hitches 2 → 0, triangles unchanged. One parameter, two numbers that moved
together, and a table that says why.
A router, read against a window you already have. Depth for the first four rows is in
reference/where-the-time-goes.md; the rest belong to the skill that owns the subsystem.
| The window says | Go to |
|---|---|
One large ft_max the first time something appears, never again | first-appearance section, then unity-render-urp |
Memory/GC Allocated In Frame has a non-zero median; spikes on a period | GC section, then unity-game-ui for per-frame string building |
| A spike lined up with a jump in a completed-work counter | synchronous-loads section, then unity-audio when it is a clip |
| Triangles high while looking at distance, draw calls ordinary | distant-geometry section, then unity-scene-optimisation |
| Discarded work climbing while scheduled climbs | reference/work-counters.md |
| Draw calls and SetPass calls high, triangles ordinary | unity-scene-optimisation · unity-sprite-atlas for 2D · unity-game-ui for canvases |
| GPU frame time much larger than the CPU times | unity-scene-optimisation · unity-render-urp for post-processing |
| Shadow caster count high | unity-lighting |
| Pixel art shimmering and slow | unity-2d-pixel-perfect |
| Slow only in the browser | unity-web-release |
| Slow only on the device, fine in the editor | unity-device-testing, after a development-player window taken on it |
| Frame time is fine and it still feels wrong | unity-play-harness |
missing[] is "not exposed on this build",
zeroAll[] is "exposed and flat". Report both; never quietly average a zero into a result.reference/frame-hygiene.md).-cold suffix on that window's label so nobody compares it against a warmed one.| Not here | Go to |
|---|---|
| Booting into a moment, a readable state line, a feel complaint with nothing to measure | unity-play-harness |
| Driving Unity, exit codes, screenshots, proving a harness told the truth | unity-debug |
| Installing editors, licences, CI invocation | unity-cli |
| Atlasing sprites, decimating meshes | unity-sprite-atlas · unity-3d-models |
| Configuring post-processing and renderer features | unity-render-urp |
| Browser download size, headers and memory ceilings | unity-web-release |
| Building, signing and reading a device artifact back | unity-android-release |
| Stutters on the device, runs fine in the Editor — a window taken on the phone | unity-device-testing |
| Audio memory, load types and mixer cost | unity-audio |
| Deciding what the budget should be | unity-game-brief |
| Where a character's frame windows fall: the budget ladder, the import check | game-character-pipeline (game-assets plugin) |
reference/compare.md (opens in a new tab)reference/counters.md (opens in a new tab)reference/frame-hygiene.md (opens in a new tab)reference/frame-windows.md (opens in a new tab)reference/gc-per-phase.md (opens in a new tab)reference/perf-tests.md (opens in a new tab)reference/raw-capture.md (opens in a new tab)reference/runtime-asset-leaks.md (opens in a new tab)reference/where-the-time-goes.md (opens in a new tab)reference/work-counters.md (opens in a new tab)resources/CounterCatalog.cs (opens in a new tab)resources/FrameSampler.cs (opens in a new tab)resources/GcAllocProbe.cs (opens in a new tab)resources/GcAllocProbeOpener.cs (opens in a new tab)resources/OwnedAssets.cs (opens in a new tab)resources/ProfilerRawCapture.cs (opens in a new tab)resources/WorkCounters.cs (opens in a new tab)scripts/compare_windows.py (opens in a new tab)templates/AssetLeakSoakTest.cs (opens in a new tab)templates/PerfRegressionTest.cs (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub tipoli5890/game-studio --plugin unity-dev51 skills in this plugin
/unity-2d-animationSkeletal 2D characters: PSB rig, bones and weights, sprite swaps, 2D IK (2D Animation package)./unity-2d-controllerMove a 2D character: platformer jump, slopes, coyote time, moving platforms, top-down movement./unity-2d-gridGrid tactics and tile puzzles, hex or square: move range, A* paths, line of sight, turns, undo./unity-2d-level2D level layout as data: Tiled/LDtk import, rooms, endless chunks, seeded levels, jump reachability.