claude-code - 💡(How to fix) Fix [BUG] Severe Resource Leak: 760GB Storage and 15GB RAM consumed after Sleep Mode [1 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#56340Fetched 2026-05-06 06:30:46
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
0
Author
Timeline (top)
labeled ×4commented ×1

Error Message

Error Messages/Logs

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?

After leaving a Claude Code session open overnight and putting the laptop into sleep mode, I discovered that the session had consumed 760GB of disk space and approximately 15GB of memory by the morning. The terminal remained open but the system was nearly unresponsive due to the extreme disk and memory pressure.

What Should Happen?

Claude Code should remain idle or enter a suspended state without continuous resource consumption during system sleep.

Error Messages/Logs

Steps to Reproduce

  1. Start a Claude Code session (CLI).
  2. Complete a set of tasks/interactions.
  3. Keep the terminal window active after the agent is done.
  4. Put the laptop into Sleep Mode overnight (for around 10 hours).
  5. Wake the laptop and observe system resource usage (Activity Monitor/Task Manager and disk utility).

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

No response

Claude Code Version

2.1.128

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

Other

Additional Information

I used git bash as a terminal, also I have generated a heap dump using /heapdump which is available upon request for the engineering team. I had to manually clear the storage to regain control of my machine.

The huge file was stored under: %TEMP%\claude<File-Path>\c9943489-d117-4eef-ae91-59785be1ed40\tasks\bpjcyiac0.output

extent analysis

TL;DR

The issue can be mitigated by properly closing or suspending the Claude Code session before putting the laptop into sleep mode.

Guidance

  • Verify that the Claude Code session is properly closed or suspended when not in use to prevent unnecessary resource consumption.
  • Consider implementing a timeout or idle detection mechanism to automatically suspend or close the session after a period of inactivity.
  • Review the heap dump generated using /heapdump to identify potential memory leaks or issues that may be contributing to the excessive memory consumption.
  • Investigate the Opus Claude Model configuration to see if there are any settings that can be adjusted to reduce resource usage during idle periods.

Example

No code snippet is provided as the issue does not imply a specific code-related fix.

Notes

The root cause of the issue is unclear, but it appears to be related to the Claude Code session remaining active and consuming resources even when the system is in sleep mode. Further investigation is needed to determine the exact cause and implement a permanent fix.

Recommendation

Apply workaround: Properly close or suspend the Claude Code session before putting the laptop into sleep mode to prevent unnecessary resource consumption. This is a temporary solution until the root cause can be identified and addressed.

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