object-pooling

object-pooling is a skill for Claude Code from XeldarAlz/everything-claude-unity. It costs 35 tokens per session (1,055 once invoked), scanned A, original, MIT.

A way to reuse Unity game objects instead of creating and removing them repeatedly. It keeps objects such as projectiles, particles, enemies, pickups, and audio sources in a pool for later use.

In plain words
What is it for?
It helps implement Unity's built-in ObjectPool or a custom component pool, prepare objects before gameplay, and correctly handle getting, releasing, and destroying pooled objects.
Why use it?
Repeated creation and removal allocates memory and can trigger garbage collection, which may cause runtime slowdowns. Reusing objects reduces that overhead.

Skill for Claude Code

Written for Claude Code: installed under .claude/.

Part of the everything-claude-unity plugin — 42 skills, 27 commands, 20 agents, 5 hooks shipped together

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.

agentmods
npx agentmods add skills/xeldaralz/everything-claude-unity/object-pooling
Any agent
npx skills add XeldarAlz/everything-claude-unity --skill object-pooling
Clone the repo
git clone --depth 1 https://github.com/XeldarAlz/everything-claude-unity

Made for: Claude Code.

Or install everything-claude-unity, the plugin that ships this one along with the rest of its 42 skills, 27 commands, 20 agents, 5 hooks.

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 object-pooling

README.md
[![agentmods](https://agentmods.dev/badge/skills/xeldaralz/everything-claude-unity/object-pooling.svg)](https://agentmods.dev/skills/xeldaralz/everything-claude-unity/object-pooling)
Your own site
<a href="https://agentmods.dev/skills/xeldaralz/everything-claude-unity/object-pooling"><img src="https://agentmods.dev/badge/skills/xeldaralz/everything-claude-unity/object-pooling.svg" alt="Measured on agentmods" height="20"></a>
Per session 35 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,055 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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.00035 $0.01055
Opus 5 $0.00017 $0.00528
Sonnet 5 $0.00007 $0.00211
Haiku 4.5 $0.00003 $0.00105

Measured 6d ago against content hash cb043c0ec2c5, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

object-pooling 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 6d 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.

.claude/skills/core/object-pooling/SKILL.md · 183 lines

How it starts

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

Object Pooling

Every Instantiate() allocates memory. Every Destroy() triggers GC. Pool objects you create and destroy frequently: projectiles, particles, enemies, pickups, audio sources.

Unity Built-In ObjectPool (2021+)

using UnityEngine.Pool;

public sealed class ProjectilePool : MonoBehaviour
{
    [SerializeField] private Projectile _prefab;
    [SerializeField] private int _defaultCapacity = 20;
    [SerializeField] private int _maxSize = 100;

    private ObjectPool<Projectile> _pool;

    private void Awake()
    {
        _pool = new ObjectPool<Projectile>(
            createFunc: CreateProjectile,
            actionOnGet: OnGetProjectile,
            actionOnRelease: OnReleaseProjectile,
            actionOnDestroy: OnDestroyProjectile,
            collectionCheck: false,
            defaultCapacity: _defaultCapacity,
            maxSize: _maxSize
        );
    }

    public Projectile Get() => _pool.Get();

    public void Release(Projectile projectile) => _pool.Release(projectile);

    private Projectile CreateProjectile()
    {
        Projectile projectile = Instantiate(_prefab);
        projectile.SetPool(this);
        return projectile;
    }

    private void OnGetProjectile(Projectile projectile)
    {
        projectile.gameObject.SetActive(true);
    }

    private void OnReleaseProjectile(Projectile projectile)
    {
        projectile.gameObject.SetActive(false);
    }

    private void OnDestroyProjectile(Projectile projectile)
    {
        Destroy(projectile.gameObject);
    }
}

// Projectile returns itself to pool
public sealed class Projectile : MonoBehaviour
{
    private ProjectilePool _pool;

    public void SetPool(ProjectilePool pool) => _pool = pool;

    public void ReturnToPool()
    {
        _pool.Release(this);
    }
}

Warm-Up (Pre-Spawn)

Pre-instantiate objects during loading to avoid runtime hitches:

private void Start()
{
    // Pre-warm the pool
    List<Projectile> temp = new List<Projectile>();
    for (int i = 0; i < _defaultCapacity; i++)
    {
        temp.Add(_pool.Get());
    }
    for (int i = 0; i < temp.Count; i++)
    {
        _pool.Release(temp[i]);
    }
    temp.Clear();
}

Read the full file on GitHub · 183 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. 6d ago First seen · 183 lines · 35 tokens per session scan A cb043c0ec2c5

Subscribe to this mod's changes

object-pooling is a skill published in the GitHub repository XeldarAlz/everything-claude-unity (21 stars, last pushed 4mo ago), licensed MIT. It adds 35 tokens to every session and 1,055 once invoked, about $0.0002 per session on Opus 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-08-30.

Related

Other skills, from other repositories

foundations-queueing-theory

Applies queueing theory (Little's Law, M/M/c, Erlang, Kingman, USL) to capacity and latency decisions. Use when load causes non-linear latency growth or queue overrun risk.

vasilyu1983/AI-Agents-public · 51 tokens

gamedev-godot

Creates Godot games from empty project to exported build. Use when starting, building, validating, or shipping a Godot 2D/3D game or app.

vasilyu1983/AI-Agents-public · 40 tokens

gamedev-roblox

Creates Roblox experiences from empty Studio place to published world. Use when starting, building, validating, or shipping a Roblox game.

vasilyu1983/AI-Agents-public · 31 tokens

xlsx

Create, read and edit Microsoft Excel .xlsx spreadsheets — data tables, formulas, multiple sheets, number formats, conditional formatting, charts, frozen panes and named ranges. Also covers reading an existing workbook to extract values or formulas, recalculating formulas so cached values are correct, converting to…

smith-network-solutions/threadknot · 84 tokens

pdf

Read, create and manipulate PDF files — extract text and tables, merge, split, rotate, reorder and delete pages, read and fill AcroForm fields, add or strip metadata, encrypt and decrypt, and generate new PDFs from HTML or from scratch. Also covers rasterising pages to images so a PDF can actually be looked at, and…

smith-network-solutions/threadknot · 88 tokens

rove

Use when controlling Rove tasks, parallel coding attempts, hosted agent sessions, task lifecycle, or the daemon-owned issue tracker from a shell. Also the ONLY channel for messaging another agent session on this machine — rove api send, never a peer/MCP side channel.

Sma1lboy/rove · 56 tokens