Clean up a messy Google Drive with Claude: find duplicates, rename and sort
Connect Google Drive to Claude, get a cleanup plan for one messy folder that you approve row by row, then let Claude rename and sort the files and set duplicates aside, without deleting anything.
- Level Beginner
- Time 30-60 minutes for a folder of 50-200 files
- Works with
- Claude.ai
- Claude Desktop
On this page12 sections
“Scan_0012.pdf”, “Copy of Resume.docx”, three files called “Untitled document” and a budget named “FINAL v3 (use this one)”. Most Drives look like this. Sorting them by hand is a lost afternoon. In this guide Claude does the sorting, but only after you’ve approved a written plan, and nothing gets deleted along the way.
What you’ll have at the end
- One messy folder sorted into clear subfolders (for example Money, Home, Work, Personal, Archive).
- Files renamed to one pattern:
2026-03-31 Invoice - Acme.pdf. - Likely duplicates moved into a
_Duplicates to checkfolder, so you decide what goes to the trash. - A cleanup plan table, saved in Drive, listing what changed and why.
- A short rules file you can reuse on the next folder.
What you need
| Item | Details (per the official docs) |
|---|---|
| A Claude account | Anthropic’s Google Workspace article says the Gmail, Calendar and Drive connectors are available for all users on Claude (web) and Claude Desktop. |
| The Google Drive connector | Google builds and runs it. You sign in with your own Google account, so Claude can only reach files that account can open. |
| Team or Enterprise plan? | Drive doesn’t appear in your connector list until an Owner adds it for the organization. Owners also decide whether members can let actions run without asking. |
| One messy folder | Start with one folder, not your whole Drive. |
Cost: there’s nothing extra to buy. Big folders mean long conversations and many tool calls, and Anthropic’s usage article lists both conversation length and tool use as things that count toward your usage limits. On a paid plan, Settings > Usage shows where you stand. Split a large clean-up across several chats.
Step 1: Connect Google Drive and set the safety switches
- In claude.ai, go to Customize > Connectors. In the desktop app, select Customize in the sidebar, then Connectors.
- Find Google Drive, select Connect, sign in to Google and approve the permissions. The button changes to Disconnect when it worked.
- Select Google Drive under Your connectors and open Tool permissions. For each tool you can choose Always allow, Needs approval or Blocked. Set these:
share_file: Blocked. A clean-up never needs to change who can see your files.trash_file: Needs approval (or Blocked if you want to do all deleting yourself).update_file: set it to Needs approval for now. This is the tool that moves files. Anthropic’s article lists share, move and trash; when we looked at the tool, it also accepted a new file name, so it renames too. If Claude says it can’t rename a file, rename it yourself in Drive (right-click > Rename).
By default Claude asks before it shares, moves or trashes a file. That’s what you want while you build trust. In Step 5 you’ll decide whether to relax it for renaming and moving.
Step 2: Write your rules
Claude sorts better when your choices are written down. Save this as cleanup-rules.md on your computer (or keep it in a note) and change it to fit your life:
# My Drive cleanup rules
## Folders (create them inside the folder I'm cleaning)
- Money: invoices, receipts, budgets, tax
- Home: lease, utilities, insurance
- Work: anything about my job or my team
- Personal: CV, photos, everything else that's mine
- Archive: files I haven't touched in over 12 months and that fit nowhere else
## File names
- Format: YYYY-MM-DD Topic - Detail
- Use the date in the file name or content if there is one, otherwise the last-modified date.
- Keep the file extension (.pdf, .jpg, .docx) as it is.
- No "FINAL", "v2", "Copy of" or "(1)" in new names.
## Never
- Never delete or trash anything.
- Never touch files I don't own. Mark them "not mine, keep".
- Never change sharing.
Google’s own Drive help suggests the same basics: short, meaningful names with dates, and folders inside folders, starting simple.
Step 3: Take an inventory (read-only)
Open a new chat. Select +, then Connectors, and turn on Google Drive. Attach cleanup-rules.md with + (or paste it in). Then send this, using your own folder name:
Use Google Drive to list every file in my folder named "Inbox mess", including its subfolders. Don't change anything. For each file, give me: id, name, type, size, last modified, owner, folder and link. Then tell me how many files there are, and how many I don't own.
The connector can search by folder, owner and date, and for each file it returns details like the name, type, size, owner and last-modified time. Check the count against what you see in Drive. If it’s short, ask: Did you get every page of results? Keep going until there are no more.
Step 4: Get a cleanup plan
This is the prompt we tested (see “What we saw when we tested it”):
Make a cleanup plan for these files using my rules in cleanup-rules.md. Don't change anything in Drive yet.
Find duplicates first. Treat two files as likely duplicates when they have the same type and, after removing "Copy of", "(1)" and similar, the same name, or the same size. Keep the one without "Copy of" or "(1)" in its name; if that doesn't decide it, keep the newest. Mark the others "duplicate": they will go to a folder called "_Duplicates to check", never to the trash. If the sizes differ, say "check by hand" instead of "duplicate". Treat versions like "v2" and "v3" as different files, not duplicates; mark the older version for Archive.
Then give me the plan as a table with these columns, one row per file:
id | current name | action | new name | destination folder | reason | OK?
Actions are only: keep, rename, move, rename + move, duplicate, check by hand. Leave the "OK?" column empty for me to fill in. Don't guess dates you can't see. If a name tells you nothing (like "Untitled document" or "Scan_0012"), read the file before you name it, and if you still can't tell, mark it "check by hand".
After the table, list the new folders you'd create and anything you weren't sure about.
Why the duplicate rule looks like this: the connector reports a file’s name, type, size and dates, but no content fingerprint. A matching name or size is a hint, not proof. That’s why duplicates go to a holding folder instead of the trash.
Step 5: Review the plan, then let Claude do it
Ask Claude to save the plan where you can edit it:
Save this plan as a Google Sheet called "Drive cleanup plan" inside "Inbox mess".
Open the Sheet, type yes in the OK? column for every row you agree with, and fix any new name or folder you don’t like. Leave a row empty to skip it. Then, back in the same chat:
Read the Google Sheet "Drive cleanup plan". Only use rows where "OK?" says yes, with any changes I made.
1. Create the destination folders inside "Inbox mess" if they don't exist yet, including "_Duplicates to check".
2. Rename and move the files exactly as the rows say. Do 10 files at a time, then tell me what you did.
3. Don't trash anything and don't change sharing. If something fails, stop and tell me which file and why.
Claude will ask for approval on each move. For a few files, approve them one by one. For a long plan you’ve already checked, you can choose Always allow for update_file when it asks, or set it under Tool permissions, and switch it back to Needs approval when you’re done.
Step 6: Deal with the duplicates yourself
Open _Duplicates to check, compare each file with the one Claude kept, and then move the real duplicates to the trash. Before you do, know two things from Google’s help pages:
- Files in the trash are deleted forever after 30 days. Until then you can restore them from Trash.
- People you shared a file with can still open it until it’s permanently deleted, and trashed files still count toward your storage until then.
If you use Google Drive for desktop to mirror or stream files, trashing a file puts it in the trash everywhere.
What we saw when we tested it
We ran the Step 4 prompt with claude -p on a made-up list of 15 files (scans, photos, “Copy of” files, two budget versions, a lease, and one file owned by a colleague), using the rules file above. We didn’t use a live Drive account, so Steps 3, 5 and 6 depend on your connector and weren’t part of the test.
- It found the three real duplicate pairs (same name once “Copy of” or “(1)” was removed, same size) and sent the copies to
_Duplicates to check. - Two lease files had the same name but different sizes. It marked them “check by hand” instead of calling them duplicates.
- It left the two “Untitled document” files alone. Our test list had no size for them, so it couldn’t compare them. In a real Drive, check pairs like this by hand.
- It kept the colleague’s file in place with “not mine, keep”.
- It pointed out its own conflicts: the old budget version didn’t meet our “over 12 months” Archive rule, and dates taken from last-modified times might not match an invoice’s real date.
The “not sure” list is where your judgment matters. Read it before you fill in the OK? column.
What can go wrong
- Claude misses files. Big folders come back in pages. Compare the count with Drive and ask Claude to keep going.
- A move makes a shortcut instead. Google’s help says that to move a file you need permission at both the old and new location; otherwise a shortcut is created instead. This can happen with files someone else owns. Keep the “Never touch files I don’t own” rule.
- Changes look slow. Google notes that after you move many files at once, the changes can take a while to show up. Refresh before you assume a step failed.
- Claude can’t read a file. Through the Drive connector, Claude can’t see comments or suggested edits, and with a very large file it may get only part of the content. It reads the text, not images inside documents. Expect “check by hand” for those.
- A name is wrong. Edit the row and run Step 5 again on that row only, or rename it yourself in Drive.
- Team or Enterprise account says “Access blocked”. Your Google Workspace admin may need to mark Claude as a trusted app. Anthropic’s Workspace article has the steps for them.
Make it yours
- Different folders. Students might use one folder per course; freelancers one per client. Only the rules file changes.
- Stricter or looser duplicates. Add
Also treat files with the same name and a modified time within 5 minutes as duplicatesif your phone uploads photos twice. - Make it a skill. Once your rules work on two or three folders, turn them into a skill so you don’t paste them every time. See Turn a prompt you repeat into a skill.
- Files on your computer instead. For a messy Downloads folder, the File Organizer skill does the same kind of review with Claude Code.
Next steps
- Google Drive connector: what else it can do.
- Sort receipts and invoices for tax time
Sources
- claude.com/docs/connectors/google/drive (opens in a new tab)
- support.claude.com/en/articles/10166901-use-google-workspace-connectors (opens in a new tab)
- claude.com/docs/connectors/getting-started (opens in a new tab)
- claude.com/connectors/google-drive (opens in a new tab)
- support.claude.com/en/articles/9797557-usage-limit-best-practices (opens in a new tab)
- developers.google.com/workspace/drive/api/reference/mcp/tools_list/search_files (opens in a new tab)
- developers.google.com/workspace/drive/api/reference/mcp/tools_list/get_file_metadata (opens in a new tab)
- developers.google.com/workspace/drive/api/reference/mcp/tools_list/create_file (opens in a new tab)
- support.google.com/drive/answer/2375091 (opens in a new tab)
- support.google.com/drive/answer/2375102 (opens in a new tab)
- support.google.com/drive/answer/2405957 (opens in a new tab)
Related guides
Best MCP servers for non-developers: what to connect first
The best MCP servers and connectors for people who don't code: email, calendar, files, notes, meetings, design and automation, with plans, setup and safety.
Beginner10 minutes to pick, about 5 minutes per connector to set up
Claude skills vs MCP vs plugins: which do you need?
Skills teach Claude how to do a task, MCP connectors let it reach your apps and data, plugins bundle both. Decision table, plan notes and a tested example.
Beginner10 minutes to decide, about 30 minutes for the hands-on example
Make Claude write like you: build a writing-style skill
To make Claude write like you, turn 4-6 samples of your writing into a my-voice skill: checkable rules, banned words, before/after examples. Tested template.
Beginner45-60 minutes