Example 2 — Asset Pipeline Audit

Difficulty: Intermediate  ·  Time: 15–20 minutes  ·  What you’ll learn: Using Claude Code to audit your Content Browser — find unused assets, trace references, assess deletion risk, and clean up safely with the approval flow protecting you from accidents.


Prerequisites

Make a safe sandbox to practice on. So you can delete freely, duplicate a few stock assets into a throwaway folder. In Claude Code: “Duplicate /Game/LevelPrototyping/Materials/M_PrototypeGrid to /Game/AuditDemo/Materials/M_AuditBase, duplicate MI_PrototypeGrid_Gray to MI_AuditTrim and reparent it to M_AuditBase, then duplicate T_GridChecker_A three times into /Game/AuditDemo/Textures/T_AuditUnused_A, _B, _C and SM_Cube to SM_AuditUnusedProp.” That gives you one material that is actually in use (referenced by the instance) and four genuinely orphaned assets.

Overview

  1. List the contents of a content folder
  2. Trace references — what is used vs. orphaned
  3. Deep-dive a specific asset to see what depends on it
  4. Delete safely via the approval flow
  5. Save and verify

The key feature here is the approval flow: every destructive operation requires approved: true in the tool arguments — and that gate lives in the plugin, not the client.


Step 1 — Inventory a folder

List everything in /Game/AuditDemo, recursively.

Claude calls asset.list_in_directory and returns the full asset list. For a class breakdown, ask it to group by type and it calls asset.registry_get_assets_by_path with recursive: true.

Step 2 — Trace what’s used vs. orphaned

For each asset in /Game/AuditDemo, tell me what references it — which are used and which are orphaned?

Claude calls asset.registry_get_referencers per asset. Anything that comes back with an empty referencer list is a deletion candidate. In the sandbox, the three T_AuditUnused_* textures and SM_AuditUnusedProp return [] (orphans), while M_AuditBase returns [MI_AuditTrim] — so it is in use. This is the part that is tedious to do by hand in the Reference Viewer.

Step 3 — Deep-dive a specific asset

Run the asset-deep-dive recipe on /Game/AuditDemo/Materials/M_AuditBase.

The asset-deep-dive recipe returns, in one call: the asset’s registry data, its dependencies (what it points at), its referencers (what points at it), and counts. For M_AuditBase you will see referencer_count: 1 and a dependency list — so you know exactly what would break if you removed it, and leave it alone.

Step 4 — Delete safely (the approval flow)

Now delete an orphan. Without approval, Webified Bridge refuses:

Delete /Game/AuditDemo/Textures/T_AuditUnused_A.

Claude calls asset.delete and gets back:

{
  "requires_approval": true,
  "tool": "asset.delete",
  "instruction": "Call this tool again with the same arguments plus approved=true. This is a tool argument, not a Claude Code permission."
}

Nothing is deleted. Claude tells you what it was about to do and asks how to proceed. You say “Yes, go ahead and delete it.” — Claude calls asset.delete again with approved: true, and the asset disappears from the Content Browser.

Why this matters: approved is a tool argument, not a Claude Code permission setting — so the gate is enforced in the plugin and works identically across Claude Code, the desktop app, the VS Code extension, or any custom client. Nothing irreversible happens on Claude’s inference alone.

Step 5 — Batch the rest, then verify

Delete the other orphaned assets too — check with me before each one.

Claude works through them, asking for approval per asset (approve or skip individually). Then “Save the AuditDemo folder and list it again” — Claude calls asset.save_directory then asset.list_in_directory for a before/after; only the used pair (M_AuditBase + MI_AuditTrim) remains.


What just happened

Recipes used

Recipe Description
content-folder-summary Confirm a folder exists, list it, and recurse via the Asset Registry
asset-deep-dive One-call registry data + dependencies + referencers for an asset
asset-deletion-impact-report Summarise what would break if an asset were deleted

Going further