Unity 7 project folders: sort assets by type and use one naming rule

Translated from the original Traditional Chinese version.

Summary

Unity doesn’t limit how you arrange files under Assets, but when scenes, scripts, prefabs, and materials are mixed together, neither you nor Claude can find the file to change. Unity’s official project organization guide recommends sorting folders by file type, keeping names free of spaces, and moving files inside the Editor. The rule is shown on the Fruit Catcher project here, then written into CLAUDE.md so Claude puts new files in the same places.

Table of contents

Every scene, script, image, and material you add while making a game goes into the project’s Assets folder. Unity doesn’t limit how you arrange things under Assets, so at the start of a project files tend to pile up at the top level, and a few days later you can’t tell which material the basket uses or which script nobody uses anymore. The same thing happens when you ask Claude to write code. Without a rule, Claude may put each new file somewhere different. Unity’s official project organization guide has a rule for this. Below, you apply it to the Fruit Catcher project, sorting folders by file type and naming things consistently, and then write the rule into CLAUDE.md so Claude follows it later.

Claude & Unity project creation: create your first 3D project and run the game in the Editor already explained which parts of a project folder to keep and which Unity generates automatically. Here you organize only what is inside Assets. I tested on Windows 11 with Unity 7000.0.0a23 (Alpha).

The Fruit Catcher folders

In the Project window, click Assets and the folders under it are listed on the right. The Fruit Catcher project keeps scenes, scripts, prefabs, and materials in separate folders, so Assets has only five folders and one file at the top level:

The Project window of the Fruit Catcher project. Assets contains the five folders Materials, Prefabs, Scenes, Scripts, and Settings, plus the InputSystem_Actions file

Folder What it holds
Scenes Scenes. Fruit Catcher has only one, the FruitCatcher scene
Scripts C# scripts, such as BasketController, which controls the basket
Prefabs Prefabs, which are object templates saved as files, such as Apple, Banana, and Bomb
Materials Materials, which set an object’s color and surface look, such as Apple and Ground
Settings Graphics settings that came with the template when the project was created, such as the quality settings for URP (the Universal Render Pipeline, Unity’s standard renderer). You don’t need to change them yourself

A project freshly created from the Universal 3D template (the 3D template that uses URP) has only three folders under Assets, Scenes, Settings, and TutorialInfo, plus two files, InputSystem_Actions and Readme. TutorialInfo and Readme are the template’s instructions, and I deleted them before starting Fruit Catcher:

The Project window of a project just created from the template. Assets contains the folders Scenes, Settings, and TutorialInfo, plus the files InputSystem_Actions and Readme

InputSystem_Actions at the top level of Assets is the key binding file that comes with the template. The Input System in Unity 7 reads this file, so it stays where it is.

This layout matches Unity’s own templates. When you create a project with Unity Hub or the Unity CLI, the template itself already has Scenes and Settings folders (project organization guide). With only five or six scripts, you don’t need subfolders under Scripts. When there are too many scripts for one folder, split them into subfolders by function, such as Player and UI.

Create folders

To add a folder in your own project, right-click Assets in the Project window, choose Create > Folder, and type the folder name:

The right-click menu in the Project window with Create expanded. The first item in the submenu is Folder

Create only the folders you need now. Git doesn’t store empty folders. Unity also creates a .meta file for every folder, a small file with the same name that records the folder’s ID and settings, and Git does store that file. If the .meta file of an empty folder is committed, a clone on another computer gets the .meta file but no folder, and Unity deletes the .meta file (the Empty folders section of the project organization guide).

Use one naming rule

When names are consistent, both you and Claude can guess where a file lives from its name. This series uses three naming rules:

  1. Use English, capitalize the first letter of each word, and use no spaces, such as FruitSpawner and GameManager. Unity’s guide says not to use spaces in file and folder names, because Unity’s command line tools have issues with path names that include spaces (project organization guide). Claude drives Unity through command-line tools too. This capitalized style with no spaces is called PascalCase.
  2. A script’s file name matches the name of its class, the named block of code the script defines, and one file holds one class. BasketController.cs contains the BasketController class, which is how Unity can attach the script to an object.
  3. A prefab and a material for the same thing share one name, and the folder tells them apart, such as Prefabs/Apple and Materials/Apple.

Object names in a scene follow the same rule. For how to group objects in Hierarchy, see Unity 7 Hierarchy: organize scene objects with parents and empty objects.

Unity reserves a few folder names, and files in those folders have special roles. For example, scripts in an Editor folder run only in the Editor and aren’t built into the game, while everything in a Resources folder is bundled into the game. You won’t need these folders as a beginner. When you name your own folders, just avoid Editor, Resources, Plugins, StreamingAssets, and Gizmos (special folder names).

Move files inside the Editor

Every file, like every folder, has a .meta file with the same name next to it, which records the file’s ID and import settings. The Project window doesn’t show .meta files. You can see them only by opening the Assets folder in a file manager. The File Explorer in the next screenshot is set to Traditional Chinese, so its Type column labels each .meta file as a META file in Chinese:

The Assets folder in Windows File Explorer. Materials, Prefabs, Scenes, Scripts, Settings, and InputSystem_Actions each have a .meta file with the same name, and the Type column labels them as META files in Chinese

Scenes and prefabs use the IDs in .meta files to find the materials and scripts they use, so a .meta file has to move with its file. Do all moving and renaming in Unity’s Project window: drag a file to another folder, or select it and press F2 to rename it, and Unity handles the .meta file as well (project organization guide). If you move only the material in File Explorer, its .meta file stays behind. When Unity refreshes, it shows a yellow warning in Console, “A meta data file (.meta) exists but its asset … can’t be found”, and deletes the leftover .meta file. Objects in the scene that used the material can’t find it anymore and turn magenta:

After the material is moved outside Unity, the Cube in the Scene turns magenta, the material field in Inspector shows Missing (Material), and Console has one yellow warning

When you drag a material in the Project window and the objects in the scene that use it keep their color, the .meta file moved with it.

Write the rules into CLAUDE.md

Claude & Unity version control: review every AI change in a pull request before it merges already created a CLAUDE.md in the project, and Claude reads it before every job. If we add the folder and naming rules to it, Claude follows them when it adds files. In the Claude desktop app, open the project folder in the Code tab and type:

1Add folder and naming rules to CLAUDE.md: scenes go in Assets/Scenes, scripts in Assets/Scripts, prefabs in Assets/Prefabs, and materials in Assets/Materials. Names of files, folders, and scene objects use English PascalCase with no spaces, and a script's file name matches its class name. When you move or rename files in Assets, handle the .meta files too.

What Claude adds looks roughly like this, though the exact wording differs each time:

1## Folders and naming
2
3- Scenes go in `Assets/Scenes/`, scripts in `Assets/Scripts/`, prefabs in `Assets/Prefabs/`, and materials in `Assets/Materials/`.
4- Before adding a file, decide its location from these rules. Create a folder only when there is no matching one.
5- Names of files, folders, and scene objects use English PascalCase with no spaces.
6- A script's file name matches its class name, and one file holds one class.
7- When you move or rename files in Assets, move or rename the `.meta` files with them.

After the change, ask Claude to open a branch, commit, and open a pull request with the flow from Claude & Unity version control: review every AI change in a pull request before it merges. The Fruit Catcher project’s CLAUDE.md has the same rules, and you can read it in the project on GitHub.

Test notes

Item Details
System Windows 11, physical machine
Editor Unity 7000.0.0a23 (Alpha)
Template Universal 3D (com.unity.template.urp-blank)
Project stage-4-score branch of tedliou/claude-unity-fruit-catcher

In a project created from the URP blank template in Unity 7000.0.0a23, Assets has the Scenes and Settings folders and the InputSystem_Actions file, and Settings has a Build Profiles folder that Unity 6.6 doesn’t have.

Summary

These rules suit a personal project with no team convention yet. If the project already has its own folder rules, write those into CLAUDE.md instead. After I organized the Fruit Catcher project with these rules, Assets had only five folders and one key binding file at the top level.

Further reading

Ted Liou

Ted Liou

Software engineer writing about Unity and AI development.

Comments