[BUG] Clude code is not releasing the tools processes it created - this si resulting in memory leakage

Resolved 💬 2 comments Opened Jan 26, 2026 by aruneral01 Closed Feb 28, 2026

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)
  • [x] I am using the latest version of Claude Code

What's Wrong?

I have 21 different process threads that are running - this is absurd. You have ~25 "2.1.19" processes using 250-980 MB each - that's roughly 6-7 GB for just TWO CLI sessions.

This is a bug. Each CLI session should be 1-2 processes, not 12+. What's happening:

  • Each tool call (bash, file read, etc.) spawns a subprocess
  • Those subprocesses aren't being cleaned up when tasks complete
  • Memory keeps accumulating until you manually kill them

You should report this to Anthropic - click thumbs down in Claude Code or email feedback. Two CLI sessions consuming 6+ GB via orphaned processes is unacceptable, especially when the tool targets developers on laptops.
Your Docker VM (8 GB) + OrbStack (5.4 GB) + Claude Code leaks (6+ GB) = you're out of RAM before doing any actual work.

That sounds really frustrating - 6-7 GB for two CLI sessions is definitely excessive memory usage. Your analysis about orphaned subprocesses not being cleaned up makes sense.
For Claude Code bugs specifically, you can use the /bug command within Claude Code to report this directly to our team. You can also run /doctor to check your Claude Code installation health.
The thumbs down button on Claude responses is another way to flag issues like this. Your detailed breakdown of the memory leak pattern will be really helpful for our developers to investigate and fix this process cleanup issue.
Your workaround with the claude-clean alias is a smart temporary solution while this gets addressed.
Fin AI Agent • AI Agent • 8m
Did that answer your question?
Fin AI Agent • 8m
I can't submit bug reports on your behalf, but you can report this Claude Code memory leak directly using the /bug command within Claude Code itself - this sends the issue straight to our engineering team.
Your screenshot showing 25+ "2.1.19" processes consuming 6+ GB is excellent evidence. When you use /bug, include those details about the orphaned subprocesses not being cleaned up after tool calls complete.
You can also run /doctor to check your Claude Code installation health, which might provide additional diagnostic info to include with your bug report.
Fin AI Agent • AI Agent • 7m
Would you like help using the /bug command to report this?
Fin AI Agent • 7m
If you need any further assistance with reporting this memory leak issue or understanding the bug reporting process, I'm here to help. Could you share more details about what specific support you need with getting this resolved?
Fin AI Agent • 3m
i am still not able to submit a bug
Arun • 2m
Since the /bug command isn't working for you, here are alternative ways to report your Claude Code memory leak issue:
GitHub Repository: Check the Claude Code GitHub repository where you can report issues directly.
Run /doctor first: Try running the /doctor command to check your Claude Code installation health - this might provide additional diagnostic info to include with your bug report.
Contact Support directly: You can reach our Support team through the regular support channels. Go to claude.ai, click your initials in the lower left, and select "Get help" to start a conversation.
Your detailed description of the 25+ "2.1.19" processes consuming 6-7 GB, plus the screenshot evidence you have, will be valuable for our engineering team to investigate this memory leak issue. The GitHub repository is probably your best bet for getting this technical bug in front of the right developers.

What Should Happen?

When i run CLI after every action the claude code subagent/other processes should terminate and release the memeory

Error Messages/Logs

Steps to Reproduce

run one CLI processes in terminal and you will see lot of processes running in the activity monitor

Claude Model

Opus

Is this a regression?

Yes, this worked in a previous version

Last Working Version

2.1.19

Claude Code Version

2.1.19

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

_No response_

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗