If you are like me then cowork is taking up a lot of room on your computer as you use it constantly. Archiving does not delete the file. After using Claude to clean up the Claude Cowork 23GB sandbox — yes, this does break cowork, don't do it! I had to get codex and claude CLI to fix it afterwards. So after that I emailed Anthropic. They said the conversations on cowork live here on a Mac: ~/Library/Application Support/Claude/local-agent-mode-sessions/[account_id]/[org_id]/ I'm not on a Mac, so I asked Claude CLI to find the Windows equivalent. Then got it to pull the conversation titles and number them so I could ask it to delete the ones I wanted to. I then made it a skill (/delete-old-cowork): Discovers the sessions folder at runtime on macOS, Windows, or Linux; reads each local_<uuid>.json sidecar to extract safe metadata only (never transcript content); lists sessions with stable numbers; deletes in explicit user-confirmed batches; refuses to touch anything outside the discovered sessions folder (in particular agent/, cowork-gb-cache.json, or any non-local_* file). Guardrails include: never printing transcript content, never hard-coding account/org UUIDs, always showing a dry-run list before deletion, and never fetching anything over the network.
Cowork 本地会话越攒越肥?他把 Anthropic 支持回复写成了一个跨平台清理 Skill
作者发现 Cowork 在本地的沙盒越滚越大、Archive 操作并不会真的删文件。他先是自作主张让 Claude 清理 23GB 沙盒——结果把 Cowork 弄坏了,靠 Codex + Claude CLI 才修好。吃了教训后他发邮件问 Anthropic 支持,拿到了会话目录的真实路径;因为他不是 Mac 用户,就让 Claude CLI 去找 Windows 等价路径,再让它按名称编号列出全部会话供他选。最后把整个流程写成了 /delete-old-cowork 技能:跨平台运行、只读元数据不触碰对话内容、按用户确认的批次删除、绝不动 agent/ 和 cowork-gb-cache.json 等基础设施文件——给后来人一把安全刀
Built a portable skill for listing and selectively deleting old Claude Cowork session files
使用场景
Cowork 的本地对话记录会持续积累,Archive 功能只是把会话从界面里隐藏,沙盒文件依然占用硬盘。作者最先想当然地让 Claude 去清理 23GB 沙盒,结果直接弄坏了 Cowork。联系 Anthropic 支持后他明白:要安全清理的是存在专门目录下的 local_<uuid>.json 及其对应文件夹(「会话记录」),而不是沙盒本身。但这条路径分散在 macOS / Windows / Linux 不同位置、还嵌套了 account_id / org_id 两层 UUID,普通用户很难找。
提示词
Help me list and selectively delete my Claude desktop Cowork (local agent-mode) session records. Each record is a local_<uuid>.json sidecar plus a matching local_<uuid>/ folder. Guardrails you must follow: (1) discover the sessions folder at runtime for my OS — do not hard-code the path; (2) read only safe metadata fields from the sidecar (title, created-at, size) — never open or print transcript content; (3) show a numbered dry-run list grouped by rule ("archived", "older than 30d", etc.) and wait for my explicit confirmation before deleting; (4) never touch anything outside the sessions folder, especially agent/ and cowork-gb-cache.json; (5) stay fully local — no network calls. 预期结果
作者把教训抽成一个 /delete-old-cowork 技能,结构如下: - **跨平台路径发现**:运行时从 macOS / Windows / Linux 各自探出 local-agent-mode-sessions 目录,不写死路径 - **只读元数据**:只从 sidecar JSON 里取标题 / 时间 / 大小等安全字段,绝不打开或打印 `initialMessage` 等对话内容 - **编号干运行**:按「已归档 / 超过 N 天 / 标题匹配」等规则分组列出,等用户明确点号或说「删这些」 - **批量确认删除**:每次删除都基于显式规则,而非模糊指令 - **白名单式保护**:绝不触碰 `agent/`、`cowork-gb-cache.json` 或任何非 `local_*` 文件——那些是 Cowork 运行基础设施,不是对话 - **不打扰计划任务**:计划任务的定义在别处(`~/OneDrive/Documents/Claude/Scheduled/` 或应用内),技能会提醒用户这点 - **完全离线**:不访问网络,不上传任何文件 **吃过的亏:** 作者也诚实承认,目前这套技能清不掉 23GB 的沙盒目录本身——那是另一个问题,他已经再次联系 Anthropic。所以这个技能的定位不是万能减肥药,而是一把「安全清理会话记录」的小刀,给碰到同样问题的人少走弯路。