find-orphaned-meta
Task
Find orphaned .meta files in the Unity project: $ARGUMENTS
What
Detect .meta files in Assets/ and Packages/ whose corresponding file or folder no longer exists. Unity generates a .meta file for every asset — when the asset is deleted but the .meta remains, Unity logs warnings and the stale .meta pollutes the repository.
When
Use when you need to:
- Find
.metafiles left behind after file/folder deletions - Diagnose Unity warnings like "A meta data file (.meta) exists but its folder/asset can't be found"
- Clean up after git operations (branch switch, merge, rebase) that may leave orphaned
.metafiles
How
Step 1: Run the detection script
.claude/skills/find-orphaned-meta/scripts/find-orphaned-meta.sh
The script scans Assets/ and Packages/ by default. Pass directory arguments to scan specific paths.
Output: one orphaned .meta path per line. Empty output means no orphans found.
Step 2: Report findings
- If no orphans: report "No orphaned .meta files found."
- If orphans found: list them and ask the user whether to delete them.
Step 3: Delete (with user confirmation)
After user approves, delete the orphaned .meta files:
rm -- "<orphaned-meta-path>"
Then run uloop compile to verify Unity no longer reports warnings about missing assets.
More from hatayama/unity-cli-loop
uloop-control-play-mode
Control Unity Editor play mode (play/stop/pause). Use when you need to: (1) Start play mode to test game behavior, (2) Stop play mode to return to edit mode, (3) Pause play mode for frame-by-frame inspection.
3uloop-run-tests
Execute Unity Test Runner and get detailed results. Use when you need to: (1) Run EditMode or PlayMode unit tests, (2) Verify code changes pass all tests, (3) Diagnose test failures with error messages and stack traces. Auto-saves NUnit XML results on failure.
2uloop-compile
Compile Unity project and report errors/warnings. Use when you need to: (1) Verify code compiles after C# file edits, (2) Check for compile errors before testing, (3) Force full recompilation with Domain Reload. Returns error and warning counts.
2uloop-screenshot
Capture screenshots of Unity Editor windows as PNG files. Use when you need to: (1) Screenshot Game View, Scene View, Console, Inspector, or other windows, (2) Capture current visual state for debugging or documentation, (3) Save editor window appearance as image files.
2uloop-launch
Launch Unity project with matching Editor version via uloop CLI. Use when you need to: (1) Open a Unity project with the correct Editor version, (2) Restart Unity to apply changes, (3) Switch build target when launching.
2uloop-record-input
Record keyboard and mouse input during PlayMode into a JSON file. Use when you need to: (1) Capture human gameplay input for later replay, (2) Record input sequences for E2E testing, (3) Save input for bug reproduction.
2