claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

[BUG] Claude code is killed by OOM killer due to subprocess issue

Open BarsMonster opened this issue 1 month ago • 4 comments

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?

When claude code is launching a program - it launches it in a way that Linux OOM killer targets claude code instead of subprocess. When claude code is working in tmux - session immediately terminates with "Pane is dead (signal 1" and it is getting not trivial to recover.

What Should Happen?

Subprocess is launched in a way that OOM killer only kills subprocess, and claude code correctly receives error message and can understand that process was killed by OOM killer.

Error Messages/Logs

No logs were generated. 
tmux pane terminates with "Pane is dead (signal 1"...

Steps to Reproduce

  1. Make claude code write a C++ program that malloc's memory in infinite cycle and run it
  2. Wait

Claude Model

Opus

Is this a regression?

No, this never worked

Last Working Version

No response

Claude Code Version

2.0.59 (Claude Code)

Platform

Anthropic API

Operating System

Ubuntu/Debian Linux

Terminal/Shell

Other

Additional Information

It might have worked sometimes in the past - I think I saw it noticing program termination and guessing it was killed by OOM killer. It is not unthinkable to get this error: if one runs 4 claude code's and they sometimes run heavy programs, one day you won't be lucky - they all will overlap and crash claude code. If it was gracefully failed - claude code would have been able to recover and proceed.

BarsMonster avatar Dec 05 '25 05:12 BarsMonster