unity-performance-and-gc

unity-performance-and-gc is a skill for Claude Code, Codex from makifbaysal/tasktrooper. It costs 76 tokens per session (1,739 once invoked), scanned A, original, Apache-2.0.

A guide to measuring and reducing performance costs in Unity, especially memory allocations made during each frame. It covers profiling, caching, object pools, physics queries, rendering, and background jobs.

In plain words
What is it for?
Use it when working on per-frame updates, spawning, physics queries, UI, rendering, or other code where frame time and memory allocations matter.
Why use it?
It helps find the actual causes of frame drops and garbage-collection pauses instead of guessing. Changes are checked with Unity's profiling tools or allocation tests.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it when working on per-frame updates, spawning, physics queries, UI, rendering, or other code where frame time and memory allocations matter.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/makifbaysal/tasktrooper/unity-performance-and-gc
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.

Any agent
npx skills add makifbaysal/tasktrooper --skill unity-performance-and-gc
Clone the repo
git clone --depth 1 https://github.com/makifbaysal/tasktrooper

Made for: Claude Code, Codex.

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 unity-performance-and-gc

README.md
[![agentmods](https://agentmods.dev/badge/skills/makifbaysal/tasktrooper/unity-performance-and-gc/github.svg)](https://agentmods.dev/skills/makifbaysal/tasktrooper/unity-performance-and-gc)
Your own site
<a href="https://agentmods.dev/skills/makifbaysal/tasktrooper/unity-performance-and-gc"><img src="https://agentmods.dev/badge/skills/makifbaysal/tasktrooper/unity-performance-and-gc/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for unity-performance-and-gc

Your own site · 80×15
<a href="https://agentmods.dev/skills/makifbaysal/tasktrooper/unity-performance-and-gc"><img src="https://agentmods.dev/badge/skills/makifbaysal/tasktrooper/unity-performance-and-gc.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 76 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,739 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.00076 $0.01739
Opus 5.5 $0.00030 $0.00696
Sonnet 5.5 $0.00015 $0.00348
Haiku 4.5 $0.00008 $0.00174

Measured 1mo ago against content hash 3edb97912376, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

unity-performance-and-gc 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 1mo 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.

catalog/agents/game-developer/skills/unity-performance-and-gc/SKILL.md · 132 lines

How it starts

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

Unity Performance and GC

Overview

Unity's managed heap is garbage-collected; every allocation in Update is a future GC spike, and the incremental collector only spreads the pain. Most frame drops in Unity projects come from a short list: allocations per frame, per-frame lookups, unpooled spawning, physics queries that allocate, UI rebuilds, and draw calls. Find which one with the Profiler, fix it, and prove the fix with numbers (game-performance-budget).

Core principle: Zero managed allocations per frame in gameplay, measured — not assumed — with the Profiler's GC Alloc column or an allocation test.

Profile first

  • Profiler: CPU Usage (Hierarchy, sort by Time ms and GC Alloc), Rendering, Physics, Memory modules. Profile a Development Build with Autoconnect; the Editor adds overhead.
  • Deep Profile only to locate a call, never for timing.
  • Profile Analyzer compares a before and an after capture; Memory Profiler finds leaks across scene loads.
  • Mark your own code: static readonly ProfilerMarker s_Marker = new("Enemy.Think"); using (s_Marker.Auto()) { ... }.

The allocation list

// ❌ allocates or searches every frame
void Update() {
    var enemies = FindObjectsByType<Enemy>(FindObjectsSortMode.None);       // array + scene search
    var close = enemies.Where(e => (e.transform.position - transform.position).sqrMagnitude < r2).ToList(); // LINQ + closure
    hpText.text = "HP: " + hp;                                              // new string every frame
    if (other.tag == "Enemy") { }                                           // allocates the tag string
    var hits = Physics.OverlapSphere(transform.position, 5f);              // new array per call
    StartCoroutine(Flash(new WaitForSeconds(0.1f)));                        // allocation per call
}

// ✅ cached, reused, non-allocating
readonly Collider[] _hits = new Collider[32];
static readonly WaitForSeconds FlashDelay = new(0.1f);
int _shownHp = -1;

void Update() {
    int count = Physics.OverlapSphereNonAlloc(transform.position, 5f, _hits, enemyMask);
    for (int i = 0; i < count; i++) { /* use _hits[i] */ }
    if (hp != _shownHp) { _shownHp = hp; hpText.SetText("HP: {0}", hp); }   // TextMeshPro, no string alloc
    if (other.CompareTag("Enemy")) { }
}

Read the full file on GitHub · 132 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. 1mo ago First seen · 132 lines · 76 tokens per session scan A 3edb97912376

Subscribe to this mod's changes

unity-performance-and-gc is a skill published in the GitHub repository makifbaysal/tasktrooper (123 stars, last pushed today), licensed Apache-2.0. It adds 76 tokens to every session and 1,739 once invoked, about $0.0003 per session on Opus 5.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-10-09.

Related

unity-performance-and-gc compared with skills from other repositories

unity-performance-and-gc next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
unity-performance-and-gcmakifbaysal/tasktrooperSkill123todayApache-2.0A76Claude Code, Codex
agent-performance-optimizerruvnet/rufloSkill83ktodayMITA19Claude Code
agent-refinementruvnet/rufloSkill83ktodayMITA15Claude Code
doca-flowNVIDIA/skillsSkill4.2k2d agoApache-2.0A224Claude Code
i4h-workflow-train-rlNVIDIA/skillsSkill4.2k2d agoApache-2.0A38Codex
tao-analyze-gaps-visual-changenetNVIDIA/skillsSkill4.2k2d agoApache-2.0A103Claude Code
doca-debugNVIDIA/skillsSkill4.2k2d agoApache-2.0A233Claude Code