[BUG] Ghost sessions created with unexpected stdin content on Windows when using subagents
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] 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?
Multiple "ghost" sessions were created with C:/Program Files/Git/help as the first message, but I never typed this content. These sessions appeared in my resume list even though I didn't initiate them.
Key evidence:
4 independent sessions were created within a 2-hour window, all with identical first message C:/Program Files/Git/help:
| Session ID | Timestamp | File Size |
|------------|-----------|-----------|
| 12bd3669-b30d-4377-9a3b-d4d3d7857170 | 2026-05-09T07:01:28 | 6.6KB |
| 8a3ec0bf-9357-47ab-af7c-7b07f59ef857 | 2026-05-09T07:39:03 | 189KB |
| 79a0f413-e6ad-4162-ade8-a0980a162f99 | 2026-05-09T08:54:41 | 4.6KB |
| 228b9365-c7a5-4ae3-b989-5cb6ef7e61a1 | 2026-05-09T08:57:25 | 12.9KB |
What Should Happen?
Sessions should only be created when the user explicitly initiates them. No "ghost" sessions with unexpected content should appear.
Error Messages/Logs
Each problematic session's JSONL file shows:
{"type":"queue-operation","operation":"enqueue","timestamp":"2026-05-09T07:01:28.124Z","sessionId":"12bd3669-b30d-4377-9a3b-d4d3d7857170","content":"C:/Program Files/Git/help"}
{"type":"queue-operation","operation":"dequeue","timestamp":"2026-05-09T07:01:28.126Z","sessionId":"12bd3669-b30d-4377-9a3b-d4d3d7857170"}
{"parentUuid":null,"isSidechain":false,"type":"progress","data":{"type":"hook_progress","hookEvent":"SessionStart"...}
{"parentUuid":"...","isSidechain":false,"promptId":"...","type":"user","message":{"role":"user","content":"C:/Program Files/Git/help"}...}
Notable observations:
- The enqueue-dequeue interval is only 2ms - characteristic of programmatic input
- SessionStart hook log appears at
07:01:24.460Z, before the enqueue at07:01:28.124Z- message was enqueued during session initialization, not before
Steps to Reproduce
Unfortunately, I cannot reliably reproduce this issue. The conditions when it occurred:
- I was running a main session (
64e42eba-41ff-45be-8c81-dc17f63850d7) with heavy subagent usage (multiple Agent tool invocations, some withrun_in_background: true) - The ghost sessions appeared at different times during this session
- I have the superpowers plugin (v5.1.0) installed
- I was using Git Bash on Windows Terminal
Investigation findings:
- The ghost sessions are NOT child sessions of any Agent tool invocation (no
parentSessionIdlinking) - The
C:/Program Files/Git/helppath is NOT generated by any plugin hook code - The sessions have
userType: "external"andentrypoint: "cli"- appearing as normal CLI sessions - The path
C:/Program Files/Git/helpdoesn't exist as a valid directory
Claude Model
Other (using third-party API)
Is this a regression?
I don't know
Last Working Version
N/A
Claude Code Version
2.1.80 (Claude Code)
Platform
Other
Operating System
Windows
Terminal/Shell
Windows Terminal
Additional Information
Root cause analysis:
Key structural difference compared to normal sessions:
| Session Type | First Record in JSONL | Key Difference |
|--------------|----------------------|----------------|
| Normal session | SessionStart hook | User message processed directly, no queue-operation |
| Ghost session | queue-operation enqueue | Message was queued first (abnormal) |
This is the core anomaly: Normal sessions do NOT have queue-operation at the start. Something injected content into the queue before the session was ready.
The root cause is unknown. Based on the evidence, we can confirm:
- When: Content was injected into the queue during session startup
- What: The injected content was
C:/Program Files/Git/help - How fast: 2ms enqueue-dequeue interval indicates programmatic input
- Unknown: What process/component triggered this injection
Possible areas to investigate:
- stdin capture during session initialization
- Windows Terminal buffer behavior
Context when issue occurred:
- Heavy subagent usage (multiple Agent tool invocations)
- Windows Terminal with Git Bash
- superpowers plugin v5.1.0 installed
Why this is likely a bug:
- The path
C:/Program Files/Git/helpis not valid (actual Git help is inmingw64/share/git-core-doc) - No plugin code generates this path
- Queue-operation at session start is abnormal (normal sessions don't have this)
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗