claude-code - 💡(How to fix) Fix Cowork Session Disk Accumulation Errors [2 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#56439Fetched 2026-05-06 06:28:00
View on GitHub
Comments
2
Participants
2
Timeline
6
Reactions
0
Timeline (top)
labeled ×4commented ×2

Error Message

The /sessions mount inside Cowork sandboxes does not garbage-collect old session directories. After approximately two months of regular Cowork usage, the disk fills to capacity (90%+) and new sessions fail to boot with a useradd: No space left on device error. The failure mode is opaque to end users — sessions simply cannot be created. Clearer error message when boot fails due to disk capacity, with a documented recovery path. The current useradd: No space left on device is opaque to a non-technical user. The /sessions mount inside Cowork sandboxes does not garbage-collect old session directories. After approximately two months of regular Cowork usage, the disk fills to capacity (90%+) and new sessions fail to boot with a useradd: No space left on device error. The failure mode is opaque to end users — sessions simply cannot be created. Clearer error message when boot fails due to disk capacity, with a documented recovery path. The current useradd: No space left on device is opaque to a non-technical user.

Error Messages/Logs

The /sessions mount inside Cowork sandboxes does not garbage-collect old session directories. After approximately two months of regular Cowork usage, the disk fills to capacity (90%+) and new sessions fail to boot with a useradd: No space left on device error. The failure mode is opaque to end users — sessions simply cannot be created. Clearer error message when boot fails due to disk capacity, with a documented recovery path. The current useradd: No space left on device is opaque to a non-technical user.

Fix Action

Fix / Workaround

Silent task failure. Without disk-level monitoring, scheduled tasks, agent automation, and Cowork sessions all fail invisibly when the disk is pinned. Users receive no warning before hitting the wall. Workarounds required. End users have to quit and restart the desktop app, which they should not need to know about. Recurring problem. With ~2 months of usage producing 195 directories, the trajectory suggests this will repeat every 2-3 months for any active Cowork user.

Silent task failure. Without disk-level monitoring, scheduled tasks, agent automation, and Cowork sessions all fail invisibly when the disk is pinned. Users receive no warning before hitting the wall. Workarounds required. End users have to quit and restart the desktop app, which they should not need to know about. Recurring problem. With ~2 months of usage producing 195 directories, the trajectory suggests this will repeat every 2-3 months for any active Cowork user.

Silent task failure. Without disk-level monitoring, scheduled tasks, agent automation, and Cowork sessions all fail invisibly when the disk is pinned. Users receive no warning before hitting the wall. Workarounds required. End users have to quit and restart the desktop app, which they should not need to know about. Recurring problem. With ~2 months of usage producing 195 directories, the trajectory suggests this will repeat every 2-3 months for any active Cowork user.

RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

Bug Report: Cowork Session Disk Accumulation Reporter: Brandon Wood ([email protected]) Date: 2026-05-05 Severity: High — causes hard session failures with no graceful degradation Summary The /sessions mount inside Cowork sandboxes does not garbage-collect old session directories. After approximately two months of regular Cowork usage, the disk fills to capacity (90%+) and new sessions fail to boot with a useradd: No space left on device error. The failure mode is opaque to end users — sessions simply cannot be created. What I Observed In a working Cowork session today (2026-05-05), I ran a diagnostic on the sandbox disk and found:

/sessions mount: 8.3G used / 9.8G total (90%) 195 leftover session directories under /sessions/, all owned by nobody:nogroup, dating back to 2026-03-11 My current session's actual footprint: 398M (so the rest is historical accumulation) Each session directory averages ~40MB and is unreadable to subsequent session users (permissions locked)

How I Hit the Failure Earlier today, attempting to run bash in a fresh Cowork conversation returned: useradd: /etc/passwd.164938: No space left on device useradd: cannot lock /etc/passwd; try again later. The conversation could not boot a sandbox at all. Restarting the Claude desktop app did not resolve it. Only after the app was fully quit and reopened did a new conversation get a different sandbox path that successfully booted. User Impact

Silent task failure. Without disk-level monitoring, scheduled tasks, agent automation, and Cowork sessions all fail invisibly when the disk is pinned. Users receive no warning before hitting the wall. Workarounds required. End users have to quit and restart the desktop app, which they should not need to know about. Recurring problem. With ~2 months of usage producing 195 directories, the trajectory suggests this will repeat every 2-3 months for any active Cowork user.

What Would Help I want to be explicit that I'm asking for conservative cleanup of sandbox state only — not deletion of any user-visible content. To my knowledge, the actual content I produce in Cowork (files in my Documents folder, auto-memory, outputs, scheduled task definitions, conversation history) is stored separately from the /sessions Linux sandbox state and would not be affected by this cleanup. If that assumption is wrong anywhere — i.e., if any user-visible content is stored inside the per-session directories rather than in user-storage paths — please flag that before any cleanup runs and let me know what would be at risk. Assuming user content is safe:

Garbage-collect inactive session directories — conservatively. Suggested approach: only sessions both (a) older than 30 days AND (b) when total /sessions usage exceeds 80% of capacity. That avoids touching anything recent and only acts when there's actual disk pressure. An even softer alternative: keep the most-recent N sessions regardless of age and delete only the surplus. Surface disk pressure to the user before failure — a warning indicator at 80% capacity or higher would let users self-trigger a cleanup or restart before hitting the boot-fail wall. Clearer error message when boot fails due to disk capacity, with a documented recovery path. The current useradd: No space left on device is opaque to a non-technical user. Optional: user-controlled cleanup. If automated GC is too risky to action quickly, a manual "clean up old sandboxes" button in settings would give users an explicit recovery path without requiring backend changes.

Reproduction Notes This is a usage-driven bug — there's no specific repro beyond "use Cowork actively for several weeks." Any account with sufficient session history will eventually hit it. The diagnostic command from inside a working sandbox is: bashdf -h /sessions ls /sessions/ | wc -l If /sessions is above ~80% capacity and the directory count is in the hundreds, the user is approaching the failure window.

What Should Happen?

Bug Report: Cowork Session Disk Accumulation Reporter: Brandon Wood ([email protected]) Date: 2026-05-05 Severity: High — causes hard session failures with no graceful degradation Summary The /sessions mount inside Cowork sandboxes does not garbage-collect old session directories. After approximately two months of regular Cowork usage, the disk fills to capacity (90%+) and new sessions fail to boot with a useradd: No space left on device error. The failure mode is opaque to end users — sessions simply cannot be created. What I Observed In a working Cowork session today (2026-05-05), I ran a diagnostic on the sandbox disk and found:

/sessions mount: 8.3G used / 9.8G total (90%) 195 leftover session directories under /sessions/, all owned by nobody:nogroup, dating back to 2026-03-11 My current session's actual footprint: 398M (so the rest is historical accumulation) Each session directory averages ~40MB and is unreadable to subsequent session users (permissions locked)

How I Hit the Failure Earlier today, attempting to run bash in a fresh Cowork conversation returned: useradd: /etc/passwd.164938: No space left on device useradd: cannot lock /etc/passwd; try again later. The conversation could not boot a sandbox at all. Restarting the Claude desktop app did not resolve it. Only after the app was fully quit and reopened did a new conversation get a different sandbox path that successfully booted. User Impact

Silent task failure. Without disk-level monitoring, scheduled tasks, agent automation, and Cowork sessions all fail invisibly when the disk is pinned. Users receive no warning before hitting the wall. Workarounds required. End users have to quit and restart the desktop app, which they should not need to know about. Recurring problem. With ~2 months of usage producing 195 directories, the trajectory suggests this will repeat every 2-3 months for any active Cowork user.

What Would Help I want to be explicit that I'm asking for conservative cleanup of sandbox state only — not deletion of any user-visible content. To my knowledge, the actual content I produce in Cowork (files in my Documents folder, auto-memory, outputs, scheduled task definitions, conversation history) is stored separately from the /sessions Linux sandbox state and would not be affected by this cleanup. If that assumption is wrong anywhere — i.e., if any user-visible content is stored inside the per-session directories rather than in user-storage paths — please flag that before any cleanup runs and let me know what would be at risk. Assuming user content is safe:

Garbage-collect inactive session directories — conservatively. Suggested approach: only sessions both (a) older than 30 days AND (b) when total /sessions usage exceeds 80% of capacity. That avoids touching anything recent and only acts when there's actual disk pressure. An even softer alternative: keep the most-recent N sessions regardless of age and delete only the surplus. Surface disk pressure to the user before failure — a warning indicator at 80% capacity or higher would let users self-trigger a cleanup or restart before hitting the boot-fail wall. Clearer error message when boot fails due to disk capacity, with a documented recovery path. The current useradd: No space left on device is opaque to a non-technical user. Optional: user-controlled cleanup. If automated GC is too risky to action quickly, a manual "clean up old sandboxes" button in settings would give users an explicit recovery path without requiring backend changes.

Reproduction Notes This is a usage-driven bug — there's no specific repro beyond "use Cowork actively for several weeks." Any account with sufficient session history will eventually hit it. The diagnostic command from inside a working sandbox is: bashdf -h /sessions ls /sessions/ | wc -l If /sessions is above ~80% capacity and the directory count is in the hundreds, the user is approaching the failure window.

Error Messages/Logs

Steps to Reproduce

Bug Report: Cowork Session Disk Accumulation Reporter: Brandon Wood ([email protected]) Date: 2026-05-05 Severity: High — causes hard session failures with no graceful degradation Summary The /sessions mount inside Cowork sandboxes does not garbage-collect old session directories. After approximately two months of regular Cowork usage, the disk fills to capacity (90%+) and new sessions fail to boot with a useradd: No space left on device error. The failure mode is opaque to end users — sessions simply cannot be created. What I Observed In a working Cowork session today (2026-05-05), I ran a diagnostic on the sandbox disk and found:

/sessions mount: 8.3G used / 9.8G total (90%) 195 leftover session directories under /sessions/, all owned by nobody:nogroup, dating back to 2026-03-11 My current session's actual footprint: 398M (so the rest is historical accumulation) Each session directory averages ~40MB and is unreadable to subsequent session users (permissions locked)

How I Hit the Failure Earlier today, attempting to run bash in a fresh Cowork conversation returned: useradd: /etc/passwd.164938: No space left on device useradd: cannot lock /etc/passwd; try again later. The conversation could not boot a sandbox at all. Restarting the Claude desktop app did not resolve it. Only after the app was fully quit and reopened did a new conversation get a different sandbox path that successfully booted. User Impact

Silent task failure. Without disk-level monitoring, scheduled tasks, agent automation, and Cowork sessions all fail invisibly when the disk is pinned. Users receive no warning before hitting the wall. Workarounds required. End users have to quit and restart the desktop app, which they should not need to know about. Recurring problem. With ~2 months of usage producing 195 directories, the trajectory suggests this will repeat every 2-3 months for any active Cowork user.

What Would Help I want to be explicit that I'm asking for conservative cleanup of sandbox state only — not deletion of any user-visible content. To my knowledge, the actual content I produce in Cowork (files in my Documents folder, auto-memory, outputs, scheduled task definitions, conversation history) is stored separately from the /sessions Linux sandbox state and would not be affected by this cleanup. If that assumption is wrong anywhere — i.e., if any user-visible content is stored inside the per-session directories rather than in user-storage paths — please flag that before any cleanup runs and let me know what would be at risk. Assuming user content is safe:

Garbage-collect inactive session directories — conservatively. Suggested approach: only sessions both (a) older than 30 days AND (b) when total /sessions usage exceeds 80% of capacity. That avoids touching anything recent and only acts when there's actual disk pressure. An even softer alternative: keep the most-recent N sessions regardless of age and delete only the surplus. Surface disk pressure to the user before failure — a warning indicator at 80% capacity or higher would let users self-trigger a cleanup or restart before hitting the boot-fail wall. Clearer error message when boot fails due to disk capacity, with a documented recovery path. The current useradd: No space left on device is opaque to a non-technical user. Optional: user-controlled cleanup. If automated GC is too risky to action quickly, a manual "clean up old sandboxes" button in settings would give users an explicit recovery path without requiring backend changes.

Reproduction Notes This is a usage-driven bug — there's no specific repro beyond "use Cowork actively for several weeks." Any account with sufficient session history will eventually hit it. The diagnostic command from inside a working sandbox is: bashdf -h /sessions ls /sessions/ | wc -l If /sessions is above ~80% capacity and the directory count is in the hundreds, the user is approaching the failure window.

Claude Model

None

Is this a regression?

Yes, this worked in a previous version

Last Working Version

No response

Claude Code Version

1.5354.0

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

No response

extent analysis

TL;DR

Implement a garbage collection mechanism to remove inactive session directories older than 30 days when the /sessions mount exceeds 80% capacity.

Guidance

  • Identify and remove inactive session directories using a script that checks the age and disk usage of each directory.
  • Consider implementing a warning system to alert users when the /sessions mount approaches 80% capacity.
  • Update the error message for disk capacity errors to provide a clearer recovery path for users.
  • Explore adding a manual "clean up old sandboxes" button in settings for user-controlled cleanup.

Example

A possible script to remove inactive session directories could be:

find /sessions -type d -mtime +30 -exec rm -rf {} \;

This script removes directories older than 30 days, but should be modified to also check the disk usage and only remove directories when the /sessions mount exceeds 80% capacity.

Notes

The provided solution assumes that user content is stored separately from the /sessions Linux sandbox state and will not be affected by the cleanup. However, it is essential to verify this assumption before implementing the solution.

Recommendation

Apply a workaround by implementing a garbage collection mechanism to remove inactive session directories, as this will help mitigate the issue until a more permanent fix can be developed.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING