Codex软件写代码交付AI 评分 · 80/100AI 辅助编辑·未发现明显提示词注入风险X

Mac 磁盘只读审计:用 Codex/Claude Code 可视化空间占用并列出清理候选

输入:一段只读审计指令 → 处理:AI 扫描 home 目录、生成可视化分解与编号候选表 → 输出:可逐项批准的清理清单

有一点经验步骤提示词贴士
给谁
Mac 用户,磁盘空间紧张,希望先审计再手动决定清理项
你会得到
获得磁盘空间总览、大文件夹可视化分解、带风险说明的编号清理候选表;作者示意从 956 GB 降至 600 GB(配图示意,非保证)
你需要
Codex

硬约束

在 Codex 或 Claude Code 中粘贴作者提供的只读审计提示词。工具将扫描 home 文件夹(不打开个人文件内容、不下载仅云端文件),返回总用量与可用空间、按文件夹/文件类型的可视化分解、以及编号清理候选表。用户必须逐项显式批准后,工具才能执行任何删除或移动操作。来源未说明具体模型版本;本站未实测。

他们做了什么

作者 fenillramoliya 在 X 发帖分享一段用于 Codex 或 Claude Code 的只读 Mac 存储审计提示词,并在自回复中贴出完整文本。该提示词要求 AI 扫描 home 目录、生成可视化空间分解与编号清理候选表,并禁止在获得用户显式批准前执行任何清理操作。

效果如何

作者报告通过该流程识别并清理了大文件,配图示意存储从 956 GB 降至 600 GB(标注为 Illustrative before/after,属作者自述效果,非本站实测)。

值得知道

956 GB → 600 GB 为作者配图示意对比,非保证结果;来源未说明使用的具体模型版本;提示词要求工具不打开个人文件内容、不下载仅云端文件,但 AI 工具的实际文件访问范围受本地权限与沙箱限制;编号清理表中的「可回收空间」为估算值,实际释放可能因稀疏文件、共享块、重叠总计而产生差异;建议对任何删除操作保留 Time Machine 或其他备份。

步骤

  1. 打开 Codex 或 Claude Code

    启动你本地已安装的 Codex CLI 或 Claude Code 交互会话。确保工具对你的 home 目录有读取权限(无需写入权限即可开始审计)。

  2. 粘贴只读审计提示词

    将下方提示词完整粘贴到对话中并发送。该提示词要求工具仅执行探索性审计,禁止在获得你显式批准前删除、移动、清空或停止任何文件与应用。

    运行提示词 · 来源原文。Codex 或 Claude Code 的对话输入框

    Audit my Mac’s storage and show me where the space is going.
    
    This is an exploration task. Do not delete, move, clear or unpin files, empty Trash, or stop apps. Wait for my explicit approval before cleanup.
    
    Inspect my home folder, not just the current project. Use folder sizes and file metadata without opening personal file contents or downloading cloud-only files.
    
    Give me:
    
    1. Total, used and available disk space. Explain any differences from macOS Storage Settings.
    
    2. A visual, tile-style breakdown of the largest folders and file types: Documents, Downloads, Desktop, recordings, archives, development projects and app caches. Drill into the biggest contributors.
    
    3. A numbered cleanup table showing:
       • Exact path and measured size
       • What it contains
       • Why it might be removable
       • What I would lose or need to recreate
       • Any checks required before removal
    
    Separate regenerable caches and build output from personal files, backups, dependencies and app data. Large or old does not automatically mean unnecessary.
    
    Preserve passwords, cookies, history, bookmarks, sessions, credentials, source code, Git history, databases and Docker volumes. Keep AI/coding tools’ data and shared caches out of cleanup candidates unless I explicitly include them.
    
    For cloud folders, distinguish freeing local space from deletion that syncs everywhere. For installers, verify the app is installed and the installer is unused. Identify apps or dev servers that must close before cleanup.
    
    Use allocated disk usage where possible. Flag sparse files, shared blocks and overlapping totals. Give a conservative recovery estimate without double-counting, and clearly state anything you couldn’t verify.
    
    Finish by asking which numbered items I approve. Do not perform cleanup yet.
  3. 审阅输出并逐项批准

    工具将返回三部分内容:磁盘总览与 macOS Storage Settings 差异说明、大文件夹可视化分解、编号清理候选表。仔细阅读每条路径的风险说明(会丢失什么、是否需要重建、移除前检查项)。只有在完全理解后果后,再回复批准具体编号;未批准的项不会被执行。

可复制提示词

搭建指导 · 本站建议版本。搭建助手阅读用:确认本地已安装 Codex CLI 或 Claude Code,且对 home 目录有读取权限

这一段是提示词,页面不会在这里插入广告。

打开 Codex 或 Claude Code,把第 2 步的来源审计提示词原样粘贴进去,按它的输出逐项检查并修复。

提示词较长,建议直接复制完整文本粘贴;不要分段发送以免截断编号列表格式。

来源

让 Codex/Claude Code 只读审计 Mac 磁盘:可视化大文件夹与清理候选表,956GB→600GB · fenillramoliya · X · 2026-10-17T17:44:33.000Z

留言与反馈

试过这个方法吗?分享效果、遇到的问题或改进建议。留言审核后公开,请勿填写敏感信息。

正在加载…

    相关用例