claude-code - 💡(How to fix) Fix [BUG] Subagent grep outlives its session, ate 11 GB of RAM

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…

Error Message

Error Messages/Logs

Root Cause

grep -o .{0,2000}Your order has been processed.{0,3000} ~/.claude/projects/<project>/<session>.jsonl It was grepping through its own conversation transcript with a huge regex context window, which made it buffer the whole file into memory. Only found it because RAM hit 92% and I went hunting with ps aux.

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?

A previous Claude Code session spawned a grep that kept running after the session ended. Found it casually using 38.8% of my RAM (11.4 GB on a 28 GB machine) and 99.9% CPU:

grep -o .{0,2000}Your order has been processed.{0,3000} ~/.claude/projects/<project>/<session>.jsonl It was grepping through its own conversation transcript with a huge regex context window, which made it buffer the whole file into memory. Only found it because RAM hit 92% and I went hunting with ps aux.

Child processes from subagents should get cleaned up when the session ends.

Claude Code VS Code extension v2.1.63, Linux

What Should Happen?

Child processes from subagents should get cleaned up when the session ends.

Error Messages/Logs

Steps to Reproduce

  1. Use Claude Code in VS Code with subagents over a long session
  2. End the session
  3. Check ps aux --sort=-%mem — orphaned grep process still running on the session's JSONL transcript
  4. Process consumes unbounded RAM (11.4 GB in this case)

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

No response

Claude Code Version

2.1.62 (Claude Code) / Extension 2.1.63

Platform

Anthropic API

Operating System

Other Linux

Terminal/Shell

VS Code integrated terminal

Additional Information

No response

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] Subagent grep outlives its session, ate 11 GB of RAM