anthropics / anthropics/claude-code
Desktop app: local-agent-mode task sandboxes (~300MB each) never get cleaned up, disk fills up daily
- 主要言語
- Python
- スター
- 145k
- フォーク
- 23.1k
- PR マージ指標
- PR 指標を取得中
説明
## Summary
`~/Library/Application Support/Claude/local-agent-mode-sessions///` accumulates one `local_` directory per subagent/task run in a Cowork-style session, and these are never deleted after the task completes.
Each `local_` directory is a full clone of `~/.claude` (dominated by `~/.claude/plugins`, ~300-310MB per copy). In a single active session, ~19 of these were created within a few hours of normal use, accounting for ~8GB. After manually deleting >100GB from this folder, the same session regenerated ~8.8GB again within about an hour of continued use — confirming this is an ongoing leak tied to task/subagent execution, not a one-time accumulation.
## Impact
Users doing regular subagent-heavy work (parallel agents, workflows, background tasks) see local disk usage grow by multiple GB per hour of active use, with no automatic cleanup, requiring manual deletion to avoid running out of disk space.
## Expected behavior
- The per-task sandbox clone should be deleted automatically when the task/subagent run finishes (success or failure), OR
- The sandbox should avoid a full copy of `~/.claude/plugins` per task (e.g. via a read-only bind mount, overlay/copy-on-write, or hardlinks) since the plugin set is identical across tasks in the same session.
## Environment
- Claude desktop app, macOS (Darwin 25.6.0)
- Observed under `~/Library/Application Support/Claude/local-agent-mode-sessions/`
## Workaround
Running a scheduled local cleanup script that removes `local_*` sandbox directories once no file inside them has been modified for 12+ hours, since the app itself does not appear to garbage-collect them.
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
調査の方向性
Reproduce by running subagent-heavy local-agent-mode work on macOS and watching ~/Library/Application Support/Claude/local-agent-mode-sessions/ for local_* directories. Then find the code that creates per-task sandboxes and the task completion path. Done means sandboxes are cleaned after success or failure, or the repeated full ~/.claude/plugins copies are avoided.
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- macos, python
- 領域
- ai-infra-agents, desktop, performance
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 活発
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 52/100