[BUG] huge memory leak
Resolved 💬 10 comments Opened Feb 11, 2026 by mkbula Closed Apr 10, 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?
Claude Code in ghostty is using 17.7 GB RAM. Seems like a huge memory leak, especially compared to alternatives like Codex, which uses maybe 50-200 MB.
Additionally, claude code get's extremly laggy, just after a few messages. Maybe due to wrong approach to repeated text rendering in the terminal?
<img width="1249" height="293" alt="Image" src="https://github.com/user-attachments/assets/2ce49860-9b34-41bd-b9a0-742c1ced06b1" />
What Should Happen?
Should not devour memory.
Error Messages/Logs
N/A
Steps to Reproduce
- Start CC session
- Try running it for a while, compact. Memory randomly spikes
Claude Model
Opus
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.39
Platform
Anthropic API
Operating System
Other Linux
Terminal/Shell
Other
Additional Information
<img width="1249" height="293" alt="Image" src="https://github.com/user-attachments/assets/84e770af-41ef-41a6-8234-6e7b639734b5" />
This issue has 10 comments on GitHub. Read the full discussion on GitHub ↗