claude-code - 💡(How to fix) Fix [BUG] Orphaned --resume process consumes tokens silently after WSL reconnect + extension update [1 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#54675Fetched 2026-04-30 06:39:07
View on GitHub
Comments
0
Participants
1
Timeline
5
Reactions
0
Participants
Timeline (top)
labeled ×5

After a machine sleep/wake cycle with WSL and the VS Code remote extension, Claude Code spawned a duplicate background process that silently consumed a significant amount of my monthly token usage with no UI indication.

Error Message

Error Messages/Logs

Root Cause

After a machine sleep/wake cycle with WSL and the VS Code remote extension, Claude Code spawned a duplicate background process that silently consumed a significant amount of my monthly token usage with no UI indication.

Code Example

35044  1.0  0.3  ...  09:52   7:57  claude --resume 9607039b-32fd-4571-9b78-9daf2ce4f5e5 ...
53234  1.3  0.9  ...  22:56   0:01  claude ...

---
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?

Summary

After a machine sleep/wake cycle with WSL and the VS Code remote extension, Claude Code spawned a duplicate background process that silently consumed a significant amount of my monthly token usage with no UI indication.

Environment

  • OS: WSL (Windows Subsystem for Linux)
  • Editor: VS Code with Claude Code remote extension
  • Extension versions involved: 2.1.120 (original session), 2.1.122 (after auto-update on reconnect)

Problem

Two claude processes running simultaneously:

  • The active session visible in the UI (v2.1.122, PID 53234)
  • A silent background process (v2.1.120, PID 35044) with --resume <session-id>, accumulating CPU time and burning tokens with no UI representation
35044  1.0  0.3  ...  09:52   7:57  claude --resume 9607039b-32fd-4571-9b78-9daf2ce4f5e5 ...
53234  1.3  0.9  ...  22:56   0:01  claude ...

The orphaned process (PID 35044) had been running since 09:52 — approximately 5 hours — with no user interaction and no visibility in the UI.

Impact

Usage went from an expected ~0% to 74% of my session allocation, discovered only by manually refreshing the usage page. There was no in-app warning, notification, or any indication that a background process was consuming tokens.

What Should Happen?

  • On reconnect, the extension should detect and terminate any pre-existing claude processes before spawning a new one
  • OR: orphaned background sessions should surface in the UI with an option to terminate them

Error Messages/Logs

Steps to Reproduce

  1. Start an active Claude Code session in VS Code (extension v2.1.120)
  2. Machine goes to sleep, dropping the WSL/VS Code remote connection
  3. The extension host dies abruptly without sending a clean shutdown signal to the claude subprocess
  4. On wake, VS Code reconnects to WSL and restarts the Claude Code extension — which has auto-updated to v2.1.122
  5. The new extension spawns a fresh session (new process) but also sees the previous incomplete session in state and issues a --resume <session-id> call

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

No response

Claude Code Version

2.1.199

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

WSL (Windows Subsystem for Linux)

Additional Information

No response

extent analysis

TL;DR

The issue can be mitigated by manually terminating the orphaned claude process after a machine sleep/wake cycle and before restarting the Claude Code extension.

Guidance

  • Verify if the issue persists after manually terminating the orphaned process and restarting the extension.
  • Check for any updates to the Claude Code extension that may address this issue, as the problem occurs after an auto-update.
  • Consider adding a script to automatically detect and terminate any pre-existing claude processes before spawning a new one on reconnect.
  • Investigate the extension's shutdown and reconnect logic to ensure it properly handles subprocesses and session state.

Example

No code snippet is provided as the issue is more related to the extension's behavior and subprocess management.

Notes

The root cause of the issue seems to be related to the extension's handling of subprocesses and session state after a machine sleep/wake cycle. The fact that the extension auto-updates and spawns a new process without properly terminating the previous one contributes to the problem.

Recommendation

Apply workaround: Manually terminate the orphaned claude process after a machine sleep/wake cycle and before restarting the Claude Code extension, as this is a more immediate solution to prevent token usage accumulation.

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

claude-code - 💡(How to fix) Fix [BUG] Orphaned --resume process consumes tokens silently after WSL reconnect + extension update [1 participants]