用 Claude 整理杂乱的 Google Drive:找出重复文件、重命名并归类
把 Google Drive 连接到 Claude,为一个杂乱的文件夹拿到一份由你逐行批准的整理计划,再让 Claude 重命名、归类文件并把重复文件单独放好,全程不删除任何东西。
- 难度 入门
- 用时 一个有 50-200 个文件的文件夹需要 30-60 分钟
- 适用于
- Claude.ai
- Claude Desktop
本页内容12 个部分
“Scan_0012.pdf”、“Copy of Resume.docx”、三个都叫“Untitled document”的文件,还有一份名为“FINAL v3 (use this one)”的预算表。大多数人的 Drive 都是这个样子。手动整理要白白耗掉一个下午。在这份指南里,整理工作由 Claude 来做,但前提是你已经批准了一份书面计划,而且整个过程中不会删除任何东西。
最终你会得到什么
- 一个杂乱的文件夹被整理进清晰的子文件夹(例如 Money、Home、Work、Personal、Archive)。
- 文件按统一格式重新命名:
2026-03-31 Invoice - Acme.pdf。 - 疑似重复的文件被移到
_Duplicates to check文件夹,由你决定哪些放进回收站。 - 一份保存在 Drive 里的整理计划表格,列出改了什么、为什么改。
- 一份简短的规则文件,下一个文件夹可以接着用。
你需要准备什么
| 项目 | 详情(依据官方文档) |
|---|---|
| Claude 账号 | Anthropic 的 Google Workspace 文章说,Gmail、Calendar 和 Drive 连接器对 Claude(网页版)和 Claude Desktop 上的所有用户开放。 |
| Google Drive 连接器 | 由 Google 构建和运营。你用自己的 Google 账号登录,所以 Claude 只能访问这个账号能打开的文件。 |
| Team 或 Enterprise 方案? | 在 Owner 为组织添加 Drive 之前,它不会出现在你的连接器列表里。Owner 还决定成员能否让操作无需询问就直接运行。 |
| 一个杂乱的文件夹 | 先从一个文件夹开始,不要一上来就处理整个 Drive。 |
费用:不需要额外购买任何东西。文件夹越大,对话就越长、工具调用就越多,而 Anthropic 的用量文章把对话长度和工具使用都列为会计入用量限制的因素。在付费方案上,可以在 Settings > Usage 中查看当前用量。大规模整理请分成几次聊天来做。
第 1 步:连接 Google Drive 并设置安全开关
- 在 claude.ai 中,前往 Customize > Connectors。在桌面应用中,选择侧边栏的 Customize,再选择 Connectors。
- 找到 Google Drive,选择 Connect,登录 Google 并批准权限。连接成功后,按钮会变成 Disconnect。
- 在 Your connectors 下选择 Google Drive,打开 Tool permissions。每个工具都可以选择 Always allow、Needs approval 或 Blocked。按下面设置:
share_file:Blocked。整理文件从来不需要改变谁能看到你的文件。trash_file:Needs approval(如果你想所有删除都自己来,就设为 Blocked)。update_file:暂时设为 Needs approval。这是移动文件的工具。Anthropic 的文章列出了共享、移动和放入回收站;我们查看这个工具时发现,它也接受新的文件名,所以它也能重命名。如果 Claude 说它无法重命名某个文件,就在 Drive 里自己重命名(右键 > Rename)。
默认情况下,Claude 在共享、移动或把文件放入回收站之前都会先询问你。在你建立信任的阶段,这正是你想要的。在第 5 步,你再决定要不要对重命名和移动放宽限制。
第 2 步:写下你的规则
把你的选择写下来,Claude 就能归类得更好。把下面的内容保存为电脑上的 cleanup-rules.md(或者记在一条笔记里),并按你的情况修改:
# 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 自己的 Drive 帮助也建议同样的基本做法:使用简短、有意义并带日期的名称,用文件夹套文件夹,从简单开始。
第 3 步:清点文件(只读)
打开一个新聊天。选择 +,再选择 Connectors,打开 Google Drive。用 + 附上 cleanup-rules.md(或者直接粘贴进去)。然后发送下面这条提示词,把文件夹名换成你自己的:
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.
这个连接器可以按文件夹、所有者和日期搜索,并为每个文件返回名称、类型、大小、所有者和最后修改时间等信息。把数量和你在 Drive 里看到的核对一下。如果少了,就问:Did you get every page of results? Keep going until there are no more.
第 4 步:拿到一份整理计划
这是我们测试过的提示词(见“我们测试时看到了什么”):
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.
为什么重复规则要这样写:连接器会报告文件的名称、类型、大小和日期,但不提供内容指纹。名称或大小相同只是线索,不是证据。所以重复文件会被放进一个暂存文件夹,而不是回收站。
第 5 步:审阅计划,再让 Claude 执行
让 Claude 把计划保存到你能编辑的地方:
Save this plan as a Google Sheet called "Drive cleanup plan" inside "Inbox mess".
打开这个表格,在你同意的每一行的 OK? 列里输入 yes,并修改你不满意的新名称或文件夹。想跳过某一行,就把它留空。然后回到同一个聊天:
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 都会请求你批准。文件不多时,就逐个批准。对于你已经检查过的长计划,可以在它询问时为 update_file 选择 Always allow,或者在 Tool permissions 下设置,完成后再改回 Needs approval。
第 6 步:自己处理重复文件
打开 _Duplicates to check,把每个文件和 Claude 保留的那个比对一下,然后把真正重复的文件移到回收站。动手之前,先了解 Google 帮助页面上的两点:
- 回收站里的文件在 30 天后会被永久删除。在此之前,你可以从 Trash 中恢复它们。
- 在文件被永久删除之前,你共享过的人仍然可以打开它,而且放进回收站的文件在此之前仍然占用你的存储空间。
如果你用 Google Drive 桌面版来镜像或流式传输文件,把一个文件放进回收站,它在所有地方都会进入回收站。
我们测试时看到了什么
我们用上面的规则文件,以 claude -p 在一份虚构的 15 个文件清单上运行了第 4 步的提示词(包括扫描件、照片、“Copy of”文件、两个预算版本、一份租约,以及一个同事拥有的文件)。我们没有使用真实的 Drive 账号,所以第 3、5、6 步取决于你的连接器,不在这次测试范围内。
- 它找出了三对真正的重复文件(去掉“Copy of”或“(1)”后名称相同,大小也相同),并把副本放进了
_Duplicates to check。 - 两个租约文件名称相同但大小不同。它把它们标为“check by hand”,而没有判定为重复。
- 它没有动那两个“Untitled document”文件。我们的测试清单里没有它们的大小,所以它无法比较。在真实的 Drive 里,这样的文件请手动检查。
- 它把同事的文件留在原处,标为“not mine, keep”。
- 它主动指出了自身的冲突:旧的预算版本不满足我们“超过 12 个月”的 Archive 规则;从最后修改时间取得的日期,可能和发票上的真实日期不一致。
“拿不准”清单正是需要你做判断的地方。在填写 OK? 列之前,先读一读它。
可能出现的问题
- Claude 漏掉了文件。大文件夹的结果是分页返回的。把数量和 Drive 核对,并让 Claude 继续。
- 移动变成了创建快捷方式。Google 的帮助说,要移动一个文件,你需要在原位置和新位置都有权限;否则会改为创建一个快捷方式。别人拥有的文件可能会出现这种情况。请保留“Never touch files I don’t own”这条规则。
- 改动显示得很慢。Google 指出,一次移动很多文件后,改动可能要过一会儿才显示出来。在认定某一步失败之前,先刷新一下。
- Claude 读不了某个文件。通过 Drive 连接器,Claude 看不到评论或建议修改;对于非常大的文件,它可能只能拿到部分内容。它读取的是文字,而不是文档里的图片。这类文件预计会被标为“check by hand”。
- 名称不对。修改那一行,只针对那一行再运行一次第 5 步,或者在 Drive 里自己重命名。
- Team 或 Enterprise 账号提示“Access blocked”。你的 Google Workspace 管理员可能需要把 Claude 标记为受信任的应用。Anthropic 的 Workspace 文章里有给管理员的操作步骤。
打造你自己的版本
- 不同的文件夹。学生可以每门课一个文件夹;自由职业者可以每个客户一个。只需要改规则文件。
- 更严格或更宽松的重复判断。如果你的手机会把照片上传两次,就加上
Also treat files with the same name and a modified time within 5 minutes as duplicates。 - 做成技能。等你的规则在两三个文件夹上都好用了,就把它们变成一个技能,这样不用每次都粘贴。参见把你总在重复输入的提示词,变成一键使用的技能。
- 改为整理电脑上的文件。对于杂乱的“下载”文件夹,File Organizer 技能可以用 Claude Code 做同样的审阅。
下一步
- Google Drive 连接器:了解它还能做什么。
- 为报税季整理一整年的收据和发票
来源
- claude.com/docs/connectors/google/drive(在新标签页中打开)
- support.claude.com/en/articles/10166901-use-google-workspace-connectors(在新标签页中打开)
- claude.com/docs/connectors/getting-started(在新标签页中打开)
- claude.com/connectors/google-drive(在新标签页中打开)
- support.claude.com/en/articles/9797557-usage-limit-best-practices(在新标签页中打开)
- developers.google.com/workspace/drive/api/reference/mcp/tools_list/search_files(在新标签页中打开)
- developers.google.com/workspace/drive/api/reference/mcp/tools_list/get_file_metadata(在新标签页中打开)
- developers.google.com/workspace/drive/api/reference/mcp/tools_list/create_file(在新标签页中打开)
- support.google.com/drive/answer/2375091(在新标签页中打开)
- support.google.com/drive/answer/2375102(在新标签页中打开)
- support.google.com/drive/answer/2405957(在新标签页中打开)
相关指南
适合非开发者的最佳 MCP 服务器:先连接哪些
适合不写代码的人的最佳 MCP 服务器和连接器:邮件、日历、文件、笔记、会议、设计和自动化,附套餐、设置方法和安全须知。
入门挑选需要 10 分钟,每个连接器设置大约 5 分钟
Claude 技能 vs MCP vs 插件:你需要哪一个?
技能教 Claude 怎样完成任务,MCP 连接器让它触达你的应用和数据,插件把两者打包在一起。附决策表、套餐说明和一个实测示例。
入门做决定需要 10 分钟,动手示例大约 30 分钟
让 Claude 像你一样写作:打造个人文风技能
把你最好的 4-6 篇文章做成带有具体规则、禁用词和前后对比示例的 my-voice 技能,这样 Claude 起草的每封邮件、每条帖子和每份简介,一开始就带着你的口吻。
入门45-60 分钟