Skip to content
Development
Command

/unity-optimize

Profile and optimize performance — uses MCP profiler for frame timing, memory, rendering stats. Identifies bottlenecks and applies fixes.

From plugin
everything-claude-unity
2427 skills20 agents27 commands
Install
> /plugin marketplace add XeldarAlz/everything-claude-unity

How it fires

How this command gets triggered: by you, by Claude, or both.

  • Fires itselfClaude auto-loads it when your prompt matches the work.
  • You can call itInvoke it directly when you want it.
  • Slash command/unity-optimize

Context preview

What this command does when you run it.

Profile and optimize performance — uses MCP profiler for frame timing, memory, rendering stats. Identifies bottlenecks and applies fixes.

Command definition

unity-optimize.md
name: unity-optimize
description: "Profile and optimize performance — uses MCP profiler for frame timing, memory, rendering stats. Identifies bottlenecks and applies fixes."
user-invocable: true
args: focus_area

/unity-optimize — Performance Optimization

Optimize the project's performance. Focus area: **$ARGUMENTS**

Workflow

Use the `unity-optimizer` agent to:

Step 1: Profile

manage_profiler → start session, capture frame timing
manage_graphics → get rendering stats (draw calls, batches, triangles)
manage_profiler → memory snapshot

Step 2: Identify Bottleneck Type

  • **CPU-bound** — GC allocations, expensive Update loops, physics
  • **GPU-bound** — too many draw calls, overdraw, complex shaders
  • **Memory** — large textures, uncompressed audio, leaked Addressables

Step 3: Code Scan

Run `./scripts/validate-code-quality.sh` to find:

  • GetComponent in Update
  • Uncached Camera.main
  • LINQ in gameplay code
  • Allocations in hot paths

Step 4: Fix

Apply targeted fixes based on profiling data.

Step 5: Verify

Re-profile to confirm improvement. Compare before/after metrics.

Performance Budgets (Mobile)

| Metric | Target | |--------|--------| | Draw calls | < 100 | | Frame time | < 33ms (30fps) | | GC alloc/frame | 0 bytes | | Texture memory | < 150MB |

Ships witheverything-claude-unity

The ultimate Claude Code toolkit for Unity game development. A production-ready, plug-and-play system that gives Claude Code deep Unity expertise — from writing performant C# to building scenes, profiling performance, and triggering iOS/Android builds — all

Get the whole plugin

Other commands on everything-claude-unity.