anthropics / anthropics/claude-code
Desktop app: local-agent-mode task sandboxes (~300MB each) never get cleaned up, disk fills up daily
- Lenguaje dominante
- Python
- Estrellas
- 145k
- Forks
- 23.1k
- Métricas de merge de PR
- Métricas de PR pendientes
Descripción
## 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.
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- macos, python
- Área
- ai-infra-agents, desktop, performance
- Tipo de issue
- Error
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Activo
- Claridad
- Bastante claro
- Aptitud para principiantes
- 52/100