[BUG]
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'm not exactly sure what happened, but you were busy working and then the session got killed. I don't know where that kill signal came from, but it happened. Why don't you take a look at that?
Error: kill EPERM
at process.kill (node:internal/process/per_thread:235:13)
at hLA
(file:///mnt/nvme-data/home/carlos/.nvm/versions/node/v22.18.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:165:3109)
at
file:///mnt/nvme-data/home/carlos/.nvm/versions/node/v22.18.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:165:2982
at Array.forEach (<anonymous>)
at
file:///mnt/nvme-data/home/carlos/.nvm/versions/node/v22.18.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:165:2953
at Array.forEach (<anonymous>)
at fLA
(file:///mnt/nvme-data/home/carlos/.nvm/versions/node/v22.18.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:165:2925)
at
file:///mnt/nvme-data/home/carlos/.nvm/versions/node/v22.18.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:165:2856
at ChildProcess.W
(file:///mnt/nvme-data/home/carlos/.nvm/versions/node/v22.18.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:165:3341)
at ChildProcess.emit (node:events:518:28) {
errno: -1,
code: 'EPERM',
syscall: 'kill'
● Looking at this error, Claude Code attempted to kill a child process but got an EPERM (operation not permitted) error. Let me check what processes were running and investigate the system state.
● Bash(ps aux | grep claude)
⎿ claude 3224 0.0 0.0 10809976 45132 ? Ssl 02:58 0:06 node /usr/local/bin/serve -s dist -l 3000 --single
carlos 211320 3.3 37.6 569845756 297639764 ? Rl 09:31 19:51 claude
carlos 546316 13.0 0.0 32930592 268132 pts/6 Sl+ 19:16 0:04 claude
… +4 lines (ctrl+o to expand)
● Bash(pstree -p $(pgrep claude | head -1))
⎿ Error: /bin/bash: eval: line 1: syntax error near unexpected token ('pstree -p \$ ( pgrep claude < /dev/null | head -1 )'
/bin/bash: eval: line 1:
● Bash(sudo dmesg | tail -20)
⎿ sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure a
n askpass helper
sudo: a password is required
● Bash(journalctl --user -n 50 | grep -i "kill\|term\|signal")
⎿ No journal files were found.
● Bash(ls -la /proc/$(pgrep claude | head -1)/)
⎿ Error: /bin/bash: eval: line 1: syntax error near unexpected token ('ls -la /proc/\$ ( pgrep claude < /dev/null | head -1 ) /'
/bin/bash: eval: line 1:
● Bash(pgrep claude)
⎿ 211320
546316
● Bash(ls -la /proc/211320/)
⎿ total 0
dr-xr-xr-x 9 carlos carlos 0 Sep 21 09:31 .
dr-xr-xr-x 1396 root root 0 Sep 21 02:56 ..
… +57 lines (ctrl+o to expand)
● Bash(cat /proc/211320/status | head -20)
⎿ Name: claude
Umask: 0002
State: R (running)
… +17 lines (ctrl+o to expand)
● Bash(cat /proc/211320/cmdline)
⎿ claude
● The error indicates that Claude Code tried to kill a child process but received EPERM (permission denied). This suggests:
- Process ownership issue: The process Claude tried to kill might have been owned by a different user or elevated privileges
- System protection: The system prevented the kill operation for security reasons
- Resource constraints: Memory pressure (the main Claude process is using ~570GB virtual memory) might have triggered system protections
The stack trace shows the error occurred in Claude Code's cleanup/shutdown routine when trying to terminate child processes. The EPERM on a kill syscall typically means either:
- Trying to kill a process you don't own
- System security policies preventing the kill
- Process already in an uninterruptible state
● The kill EPERM error occurred when Claude Code tried to clean up child processes during session termination. This is likely due to:
- Memory pressure - Your main Claude process is using ~570GB virtual memory
- Process ownership conflicts - Child processes may have changed ownership or permissions
- System protection - Linux prevented the kill operation for security/stability
The session termination was probably triggered by system resource management rather than Claude Code itself. Consider restarting Claude Code if you continue experiencing issues.
Yeah, I actually did restart Cloud Code because it crashed, it just dumped the system. That process hogging almost 600 gigabytes of RAM is amazing. Now, my machine has more than that, but still, that's incredible. Is that actively ongoing, or is that an anomaly? What's up with that?
● Bash(ps aux --sort=-%mem | head -10)
⎿ USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
carlos 211320 3.8 65.4 569845756 517808468 ? Rl 09:31 22:45 claude
carlos 7000 0.2 0.1 55414812 1008184 ? Sl 02:59 2:16 /mnt/nvme-data/home/carlos/.vscode-server/cli/serve
… +23 lines (ctrl+o to expand)
● Bash(free -h)
⎿ total used free shared buff/cache available
Mem: 754Gi 509Gi 233Gi 42Mi 15Gi 244Gi
Swap: 8.0Gi 398Mi 7.6Gi
● Bash(cat /proc/211320/smaps_rollup | grep -E "Rss|Pss|Private")
⎿ Rss: 531698068 kB
Pss: 531694858 kB
Pss_Dirty: 531694396 kB
… +7 lines (ctrl+o to expand)
● This is actively ongoing and concerning. The Claude process (PID 211320) is using:
- Virtual Memory: ~570GB (VSZ)
- Physical Memory: ~518GB (RSS) - that's 65.4% of your 754GB system
- Private Memory: ~531GB of dirty pages
This is definitely a memory leak in the Claude Code process. The fact that it's using over half a terabyte of RAM
suggests either:
- Context accumulation - The process is holding onto massive amounts of conversation history/context
- Memory leak - Objects aren't being garbage collected properly
- Large file operations - Processing or caching extremely large files
Given your system has 754GB total RAM and Claude is using 518GB of it, this will eventually cause system instability. You should:
- Monitor closely - This process will likely continue growing
- Restart Claude Code regularly - Before it consumes all available memory
- Report this - This is a serious memory management bug in Claude Code
The current new Claude process (PID 546316) is using normal memory (~250MB), so restarting did reset it properly.
Can you give me the URL to the Anthropic Support website where I can report that?
● https://github.com/anthropics/claude-code/issues
This is the official GitHub repository for reporting Claude Code issues and bugs. You can create a new issue there with details about the memory leak you experienced.
What Should Happen?
No response required, simply reporting unusual behavior. Thanks.
Error Messages/Logs
Steps to Reproduce
I don't know if this is reproducible.
Claude Model
Sonnet (default)
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
1.0.120 (Claude Code)
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗