/roblox-skills:roblox-performancefrom roblox-skills
Diagnoses and optimizes Roblox game performance using MicroProfiler, Script Profiler, Developer Console, Scene Analysis, and Luau heap snapshots. Helps fix lag, stutters, low FPS, mobile crashes, and high ping.
Ships in roblox-skills. 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.
Measure before optimizing. Identify whether the bottleneck is server compute, client compute (CPU/GPU), memory, network, or load time, then use the matching tool.
| Tool | Open | Use for |
|---|---|---|
| Developer Console | F9 (in game) | Errors, server/client memory by category, network, script activity. Works in live servers. |
| MicroProfiler | Ctrl+Alt+F6 (⌘⌥F6); Dev Console for server | Per-frame timing; spikes; dump a frame for detail. |
| Script Profiler | Studio / Dev Console | Which functions consume Luau time (sampling). |
| Luau heap snapshots | Dev Console → Memory → Luau Heap | What tables/closures/instances are held and by what (leaks). |
| Scene Analysis | Studio | Script memory, unparented instances (leaks), instance composition, audio/animation memory, triangles. Also SceneAnalysisService via Studio MCP. |
| Performance Stats / Debug Stats | Ctrl+Alt+F7 / Shift+Ctrl+F1–F5 | Live CPU/GPU/memory/network overlays. |
| Network Simulator | Studio Device Simulator toolbar | Test with latency, jitter, packet loss (3G/4G/Wi-Fi profiles). |
| Performance dashboard | Creator Hub | Live aggregate FPS, server heartbeat, memory, crash rates by device. |
Label your own code in the MicroProfiler and memory views:
--!strict
local RunService = game:GetService("RunService")
debug.setmemorycategory("EnemyAI") -- memory allocated by this thread is attributed to "EnemyAI"
RunService.Heartbeat:Connect(function(_deltaTime)
debug.profilebegin("EnemyAI.think") -- shows as a labeled bar in the MicroProfiler
-- ... work ...
debug.profileend()
end)
Stats (workspace:GetRealPhysicsFPS(), Dev Console Server Stats).PlaceMemory, LuaHeap, GraphicsTexture, Sounds, Animation categories.game.ServerLowMemoryWarning fires (server only, live servers and Team Test, not Studio
playtests) when memory leaves normal levels, then every 60 s while it stays high. Use it to free memory
fast (destroy debris/effects, pause spawning, unload empty map areas) and log it; it frees nothing itself.--!strict
game.ServerLowMemoryWarning:Connect(function()
warn("Server memory high: cleaning up")
-- e.g. destroy temporary effects, pause NPC/item spawners until memory recovers
end)
| Symptom | Usual cause | Fix |
|---|---|---|
| Memory grows over time | Leaked connections, tables keyed by players/instances, destroyed-but-referenced instances, unparented instances | Disconnect/clean up per player & per character; clear tables on PlayerRemoving; use Scene Analysis "unparented instances" and heap snapshots. |
| Server lag with many players | Per-player loops each frame, while true do task.wait() end loops, heavy remote handlers, physics of many unanchored parts | Event-driven code, one scheduler loop, throttled think rates, anchor static parts, server-own fewer assemblies. |
| Client FPS drops | Too many parts/draw calls, shadows from many lights, transparency/particles overdraw, per-frame UI updates | Merge/instance meshes, CastShadow = false on small parts, fewer shadowed lights, limit particles, update UI on change only. |
| Spikes every N seconds | Autosave/GC bursts, synchronized loops across players, big Clone()s | Stagger with random offsets; pool objects; spread work across frames. |
| High ping / rubber banding | Remote spam, large payloads, replicating many property changes | Batch, delta-compress, throttle; tween on clients; see roblox-networking. |
| Long join times | Huge place, many unique assets, no streaming | Streaming, SLIM LOD, fewer unique meshes/textures, ContentProvider:PreloadAsync only for critical assets. |
RaycastParams outside loops; avoid FindFirstChild/GetDescendants
per frame. Replace GetDescendants scans with tags (CollectionService) or maintained sets.deltaTime from Heartbeat/PreSimulation rather than task.wait() loops for per-frame work.table.clear.--!native (whole script) or @native (per function) for math-heavy code; typed parameters help
the native compiler. Don't blanket-enable: compile time and a global native-code memory limit.--!optimize 2 is how Roblox compiles live games already; don't rely on Studio timings for micro-benchmarks.MeshParts with shared MeshId are instanced (cheap); unions (PartOperation)
can be expensive — check triangle counts in Scene Analysis.RenderFidelity = Automatic/Performance for detailed meshes; CollisionFidelity = Box/Hull for
decorative meshes; CanCollide/CanQuery/CanTouch = false for pure decoration.PointLight/SpotLight/SurfaceLight; limit ParticleEmitter.Rate
and particle size (overdraw); Beam/Trail counts.SurfaceAppearance sparingly.roblox-architecture), Model.LevelOfDetail = SLIM for static models, and let
StreamOutBehavior = Opportunistic free memory.CollisionFidelity, collision groups to skip pairs); CanTouch = false
where Touched isn't needed.CFrame of unanchored parts every frame; use constraints or anchor + CFrame.workspace:BulkMoveTo(parts, cframes, Enum.BulkMoveMode.FireCFrameChanged) to move many anchored parts.PhysicsSteppingMethod = Adaptive) reduces physics CPU.Scripts under different Actor instances can run in parallel:
--!strict
-- Script parented under an Actor (one Actor per logical unit, e.g. per NPC group or chunk).
local RunService = game:GetService("RunService")
local results: { number } = {}
RunService.Heartbeat:ConnectParallel(function(_deltaTime)
-- Parallel phase: read-only access to most instances, pure computation, thread-safe APIs (raycasts).
for i = 1, 100 do
results[i] = math.noise(i / 10, os.clock())
end
task.synchronize()
-- Serial phase: write to instances, fire events, call thread-unsafe APIs.
end)
task.desynchronize() / task.synchronize() switch phases; ConnectParallel starts in parallel.require or modify most instances while desynchronized. Communicate with Actor:SendMessage /
BindToMessageParallel or SharedTable (SharedTableRegistry).Profiling walkthrough and memory-leak hunting: references/profiling.md.
roblox-architecture (streaming), roblox-networking (bandwidth), roblox-physics, roblox-npc-ai,
roblox-studio-mcp (Roblox's rbx-perf-profiling/scene analysis via MCP).
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
23 skills in this plugin
/roblox-analytics-liveopsAnalytics and live ops - AnalyticsService economy/funnel/onboarding/progression/custom events, player segments, experience configs via ConfigService, A/B experiments, badges, experience notifications, timed events, daily rewards, season passes. Use when instrumenting a game, tuning economy or onboarding, running A/B tests or feature flags, or planning live events and re-engagement./roblox-architectureRoblox project structure and client/server model - replication, where code and assets belong (ServerScriptService, ReplicatedStorage, StarterPlayer), RunContext, service/controller bootstrapping, player/character lifecycle, CollectionService components, attributes, streaming-safe client code, library choices. Use when starting a project, deciding where code goes, or fixing replication/streaming bugs./roblox-npx claudepluginhub el4cteo/roblox-skills --plugin roblox-skillsOther plugins' skills for the same job