AI Studio is creating too many folders in Google Drive

Still happing. This is literally putting me of from using google AI studio

Did anybody solved it?

I cannot believe for 1 year such annoying bug was not solved

I have HUNDREDS OF THESE FOLDERS Which are ruing my Google drive

It creates new folder for every open or close of any app in the AI Studio

Same issue here; has anyone filed a support ticket or received a response?

1 Like

Hi All, Here is what I am doing as a workaround.

Workaround - AI Studio Folder Cleanup

/**
* Google AI Studio Folder Consolidator
* 1. Finds all folders named “Google AI Studio”
* 2. Deletes empty ones permanently.
* 3. Moves files from older folders into the newest one.
* 4. Deletes the now-empty old folders.
* 5. Cronjob for every week cleanup
*/

Part 1: The Prompt for Gemini

Copy and paste this into Gemini to generate the custom script:

"Act as a Google Apps Script expert. Create a script that manages multiple folders named ‘Google AI Studio’ in my Google Drive root.

The script should:

  1. Find all folders named exactly ‘Google AI Studio’.

  2. Identify the newest one by creation date to serve as the ‘Master’ folder.

  3. Iterate through all other folders with that name:

    • Move every file inside them into the Master folder.

    • If there are subfolders, move those into the Master folder as well.

    • After a folder is emptied, delete it permanently (bypass the trash) using the Drive API.

  4. Include a DRY_RUN boolean at the top so I can test it without deleting anything first.

  5. Include professional logging so I can see exactly which files were moved and which IDs were deleted."


Part 2: Implementation Steps

Once Gemini gives you the code, follow these steps to set it up:

  1. Open Apps Script: Go to script.google.com and click New Project.

  2. Paste & Save: Delete the placeholder code and paste the script Gemini provided. Click the Disk icon to save (name it “AI Studio Cleanup”).

  3. Enable the Drive API: This is the most important step for “permanent” deletion:

    • On the left, click the + next to Services.

    • Find Drive API, select it, and click Add.

  4. Run a Test:

    • Ensure DRY_RUN is set to true.

    • Click Run. You will need to click “Review Permissions” and “Allow” (you may need to click “Advanced” → “Go to AI Studio Cleanup (unsafe)” if prompted).

    • Check the Execution Log at the bottom to see what would have happened.

  5. Go Live: Change DRY_RUN to false and click Run again to perform the actual cleanup.


Part 3: Final Tips for Success

  • Don’t Rename the Master: Google AI Studio looks for the exact string “Google AI Studio.” If you rename your master folder to “My AI Prompts,” the system won’t find it and will just create a new “Google AI Studio” folder immediately.

  • The “Root” Requirement: AI Studio prefers the folder to be in the root of your Drive. Moving the master folder into a sub-folder (like “Work/AI”) will often trigger the creation of a duplicate in the root.

  • Set a Weekly Trigger: Once the script works, click the Alarm Clock icon (Triggers) on the left of the script editor. Add a new trigger to run the main function “Time-driven” every Monday at 1 AM. This keeps your Drive permanently clean without manual effort.

  • Duplicate Filenames: If you have two different prompts with the exact same name in different folders, the moveTo() command might overwrite one or throw an error depending on the script logic. It’s best to give your prompts unique names in AI Studio.

1 Like

I still have the same problem today, with more than 100 folders created.

1 Like

Hi @Sangeetha_Jana (and any other Googlers). Any update on this issue? Love the AI Studio product, but it’s making Google Drive organization difficult.

Would greatly appreciate a response. Thanks!

One year later and no solution for such simple problem…

This is ludicrous, a very easy fix and google just hasn’t bothered :man_shrugging:

Maybe we are getting somewhere? Saw this today…