ArTchie Studios

Tag Layer Auditor

Dumps project tags and layers, then walks currently open scenes plus every scene and prefab under Assets/ to find unused tags, unused user layers, undefined tags, and ignored Physics layer pairs.

Editor-only. Unity 2021.3+. Lives in Rivet.Editor (includePlatforms: Editor). No extra packages.

Editor window

ArTchie / Rivet / Tag Layer Auditor

Button What it does
Scan Reads InternalEditorUtility.tags / layers, scans open scenes, then every Assets/ scene (additive open) and prefab (LoadPrefabContents).
Copy JSON Puts the report JSON on the clipboard.
Write report Writes <project>/RivetReports/tag-layer-auditor.json (creates the folder if needed).

Skips Packages/ and Library/ when collecting project scenes/prefabs. Objects tagged Untagged are skipped for tag-usage (not a finding).

Batchmode (CI)

Unity -batchmode -nographics -quit -projectPath <proj> -executeMethod Rivet.TagLayerAuditor.RunBatch -rivet-out <file.json> -rivet-fail
Arg Meaning
-rivet-out <file.json> Output path. Default: <project>/RivetReports/tag-layer-auditor.json
-rivet-fail Exit code 1 if any finding (items) exists; otherwise 0

RunBatch only calls EditorApplication.Exit when Application.isBatchMode is true. It logs count=, unused tag/layer counts, and the output path.

Also accepts -rivet-out=file.json.

JSON

{
  "tool": "TagLayerAuditor",
  "generatedUtc": "2026-08-18T02:00:00Z",
  "tags": ["Player", "Enemy"],
  "layers": ["Default", "UI", "Enemy"],
  "unusedTags": ["Enemy"],
  "unusedLayers": ["Enemy"],
  "count": 2,
  "items": [
    {
      "rule": "unusedTag",
      "name": "Enemy",
      "detail": "Tag is defined in TagManager but was not found on any open-scene, Assets/ scene, or prefab object."
    },
    {
      "rule": "unusedLayer",
      "name": "Enemy",
      "detail": "User layer 8 is named but was not found on any open-scene, Assets/ scene, or prefab object."
    }
  ],
  "ignoreCollision": [
    { "a": "Player", "b": "Ignore Raycast" }
  ]
}

tags is InternalEditorUtility.tags (no Untagged). layers is the named layers from InternalEditorUtility.layers plus any extra names from LayerMask.LayerToName for slots 0–31.

Rules

Rule Meaning
unusedTag Tag is defined but never used on a scanned object
unusedLayer User layer 8–31 has a name but is never used
undefinedTag Object m_TagString is not Untagged and not in InternalEditorUtility.tags

count is items.Length. Built-in layers 0–7 are never listed as unused.

ignoreCollision lists named-layer pairs where Physics.GetIgnoreLayerCollision(a, b) is true (including a layer with itself). Pairs are unique with layer index a <= b. Physics2D is not dumped.

Notes

  • Prefabs: PrefabUtility.LoadPrefabContents / UnloadPrefabContents.
  • Scenes: additive open+close in the Editor window (restores your previous setup); OpenSceneMode.Single in batch. Already-open scenes are scanned first (including untitled).
  • Empty projects and a missing RivetReports folder are fine. A stock empty project still has Unity's built-in tags (Respawn, Finish, …); unused ones are reported.
  • Does not add/remove tags or layers. Does not change the Physics matrix. Does not touch runtime player code.

Source in the box: Assets/ArTchie Studios/ArTchie-Suite/com.artchie.rivet/Documentation/TagLayerAuditor.md