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の場合 ~/Library/Application Support/Claude/local-agent-mode-sessions/<account>/<org>/)を入手。WindowsユーザーのためClaude CLIに同等のパスを見つけさせ、全セッションをタイトルで番号付けして選択的に削除できるようにした。彼はこの流れを /delete-old-cowork というSkillにまとめた:クロスプラットフォームでパス検出、メタデータのみ読み取り(トランスクリプトは絶対に読まない)、ユーザー承認付きのバッチ削除、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 サイドカーと対応フォルダだ。しかしそのディレクトリはOSごと(macOS / Windows / Linux)にパスが異なり、さらに account_id / org_id という2階層の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 というSkillに凝縮した: - **クロスプラットフォームのパス検出**:macOS / Windows / Linux でランタイムに local-agent-mode-sessions ディレクトリを探す。パスはハードコードしない - **メタデータのみ読み取り**:各サイドカーJSONからタイトル/作成日時/サイズなどの安全なフィールドのみ取得。`initialMessage` などトランスクリプト内容は絶対に開かない・印字しない - **番号付きドライラン**:「アーカイブ済み」「N日以上経過」「タイトル一致」などのルールでセッションを分類して提示し、ユーザーの明示的な選択を待ってから削除 - **明示ルールでのバッチ削除**:削除は常にルール駆動で、曖昧な指示では実行しない - **インフラのallowlist**:`agent/`、`cowork-gb-cache.json`、`local_*` 以外のファイルには絶対触れない(これらはランタイム状態で会話ではない) - **スケジュールタスクは無関係**:タスク定義は別の場所(`~/OneDrive/Documents/Claude/Scheduled/` または アプリ内設定)に存在し、Skillはその点をユーザーに事前告知 - **完全ローカル**:ネットワークアクセスなし、何もアップロードしない **率直な守備範囲の注記:** このSkillは23GBのサンドボックス自体は縮小できない——それは別の問題で、著者は引き続きAnthropicにエスカレーション中。そのため、このSkillは「魔法のディスク掃除機」ではなく「セッション記録を安全に整理するためのメス」として位置づけられている。著者のようにCoworkを壊してしまう失敗を他の人が繰り返さないためのツールだ。