unity-cleaner

Audit and clean Unity projects by finding unused, duplicate, and oversized assets.

Updated Aug 31, 2026
One-click install
npx skills add https://github.com/pikachu0310/codex-agent-ops-public --skill unity-cleaner-pikachu0310
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: unity-cleaner
Source: https://github.com/pikachu0310/codex-agent-ops-public/tree/main/.agents/skills/unity-skills/skills/cleaner
Command: npx skills add https://github.com/pikachu0310/codex-agent-ops-public --skill unity-cleaner-pikachu0310

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Unity projects accumulate unused materials, duplicate textures, missing script references, and empty folders over time, bloating builds and causing runtime errors. This Skill audits the project and removes that bloat with safety guardrails. ## Core Features & Use Cases - Asset Auditing: Find unused assets, duplicate files by MD5 hash, large assets by size, and empty folders anywhere under the Assets directory. - Reference Integrity: Detect missing scripts and null references on GameObjects, inspect what references a given asset, and resolve full dependency trees. - Safe Deletion: Delete assets through a two-step confirmToken handshake (preview first, confirm within 5 minutes), and strip missing script components in place. - Use Case: Before a release, run a full audit to find duplicate textures wasting megabytes, preview deletion of unused materials, and fix missing script references across all scenes. ## Quick Start Ask the agent to find duplicate textures and unused materials in the Unity project, then preview which assets would be deleted before confirming the cleanup.

Frequently Asked Questions about unity-cleaner

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I find unused assets in a Unity project?

Call cleaner_find_unused_assets with an assetType filter such as Material or Texture2D and an optional searchPath. It returns assets not referenced by others, including path, name, type, and size in bytes.

How to find duplicate files in Unity by content?

Use cleaner_find_duplicates, which groups files by MD5 hash within a chosen asset type and search path. It reports duplicate groups, file lists, and total wasted bytes so you can decide what to remove.

How do I safely delete assets in Unity without losing work?

cleaner_delete_assets uses a two-step confirmToken handshake: call it with paths to preview what will be deleted, then call again with the returned token within 5 minutes to confirm. Without the token nothing is removed.

Can this skill fix missing script references on GameObjects?

Yes, cleaner_fix_missing_scripts removes missing script components from GameObjects in place, optionally including inactive objects. Use cleaner_find_missing_references first to see the full list of missing scripts and null references.

Why does cleaner_delete_assets return MODE_FORBIDDEN?

Deletion operations are auto-forbidden in Approval and Auto operating modes because they carry the Delete operation flag. They only run under Bypass mode or through a user-managed Allowlist entry, and still require the confirmToken handshake.

What are the limitations of unused asset detection in Unity?

Results are potentially unused assets based on static reference analysis, so assets loaded dynamically at runtime may be flagged incorrectly. Verify usage with cleaner_get_asset_usage or the dependency tree before deleting anything.