[BUG] Error: kill EPERM
Status Closed — not planned
Maintainer reply None cached
Workaround ✓ Mentioned in thread ↓
Activity 12 comments · opened Jun 20, 2025 · closed Jan 19, 2026
Environment
- Platform (select one):
- [ ] Anthropic API
- [ ] AWS Bedrock
- [X] Google Vertex AI
- [ ] Other: <!-- specify -->
- Claude CLI version: 1.0.30 (Claude Code)
- Operating System:
Linux ubuntu 5.15.148-tegra #1 SMP PREEMPT Tue Jan 7 17:14:38 PST 2025 aarch64 aarch64 aarch64 GNU/Linux - Terminal: putty
Bug Description
claude get killed with
Error: kill EPERM
at process.kill (node:internal/process/per_thread:277:13)
at XZ0 (file:///home/alessandro/.nvm/versions/node/v24.2.0/lib/node_modules/
at file:///home/alessandro/.nvm/versions/node/v24.2.0/lib/node_modules/@anth
at Array.forEach (<anonymous>)
at file:///home/alessandro/.nvm/versions/node/v24.2.0/lib/node_modules/@anth
at Array.forEach (<anonymous>)
at FZ0 (file:///home/alessandro/.nvm/versions/node/v24.2.0/lib/node_modules/
at file:///home/alessandro/.nvm/versions/node/v24.2.0/lib/node_modules/@anth
at ChildProcess.Y (file:///home/alessandro/.nvm/versions/node/v24.2.0/lib/no
at ChildProcess.emit (node:events:507:28) {
errno: -1,
code: 'EPERM',
syscall: 'kill'
}
Additional Context
● Bash(echo "pippo" | INSTALL_K3S_EXEC="--disable=servicelb --write-kubeconfig-mode 644" sudo -S ./install.sh)
⎿ Error: Command timed out after 2m 0.0s [sudo] password for alessandro:
[INFO] Finding release for channel stable
✶ Scrubbing… (120s · ↑ 316 tokens · esc to interrupt)
╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ > │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
? for shortcuts
Total cost: $0.2096
Total duration (API): 6m 50.9s
Total duration (wall): 6m 33.3s
Total code changes: 0 lines added, 0 lines removed
Token usage by model:
claude-3-5-haiku: 33.3k input, 1.1k output, 0 cache read, 0 cache write
claude-sonnet: 98 input, 2.3k output, 320.8k cache read, 12.7k cache write
file:///home/alessandro/.nvm/versions/node/v24.2.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:229
`)},"stackTraceWarning"),fa={warn:console.warn},HO4=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],_x1=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function pB0(A){let B=A.getUTCFullYear(),Q=A.getUTCMonth(),I=A.getUTCDay(),G=A.getUTCDate(),Z=A.getUTCHours(),D=A.getUTCMinutes(),Y=A.getUTCSeconds(),W=G<10?`0${G}`:`${G}`,J=Z<10?`0${Z}`:`${Z}`,F=D<10?`0${D}`:`${D}`,X=Y<10?`0${Y}`:`${Y}`;return`${HO4[I]}, ${W} ${_x1[Q]} ${B} ${J}:${F}:${X} GMT`}B2(pB0,"dateToUtcString");var zO4=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?[zZ]$/),wO4=B2((A)=>{if(A===null||A===void 0)return;if(typeof A!=="string")throw new TypeError("RFC-3339 date-times must be expressed as strings");let B=zO4.exec(A);if(!B)throw new TypeError("Invalid RFC-3339 date-time value");let[Q,I,G,Z,D
...
...
...
...
sync('ioreg -rd1 -c "IOPlatformExpertDevice"')).stdout.split(`
Error: kill EPERM
at process.kill (node:internal/process/per_thread:277:13)
at XZ0 (file:///home/alessandro/.nvm/versions/node/v24.2.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:229:161030)
at file:///home/alessandro/.nvm/versions/node/v24.2.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:229:160903
at Array.forEach (<anonymous>)
at file:///home/alessandro/.nvm/versions/node/v24.2.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:229:160874
at Array.forEach (<anonymous>)
at FZ0 (file:///home/alessandro/.nvm/versions/node/v24.2.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:229:160846)
at file:///home/alessandro/.nvm/versions/node/v24.2.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:229:160777
at ChildProcess.Y (file:///home/alessandro/.nvm/versions/node/v24.2.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:229:161262)
at ChildProcess.emit (node:events:507:28) {
errno: -1,
code: 'EPERM',
syscall: 'kill'
}
Node.js v24.2.0
12 Comments
I saw EPERM when running Claude Code in another project
I ran into a similar crash while migrating a linux http server to HTTPS:
Error: kill EPERM
at process.kill (node:internal/process/per_thread:235:13)
at Wq2 (file:///home/luisvillegas/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:414:8088)
at file:///home/luisvillegas/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:414:7961
at Array.forEach (<anonymous>)
at file:///home/luisvillegas/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:414:7932
at Array.forEach (<anonymous>)
at Yq2 (file:///home/luisvillegas/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:414:7904)
at file:///home/luisvillegas/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:414:7835
at ChildProcess.I (file:///home/luisvillegas/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:414:8320)
at ChildProcess.emit (node:events:518:28) {
errno: -1,
code: 'EPERM',
syscall: 'kill'
}
Node.js v22.18.0
This happened to me when Claude Code was running a Bash tool call with sudo that timed out. When claud code decides to kill the tool call, it throws the EPERM code and crashes.
same problem
I haven't seen this anymore. Although Claude's short memory has caused me some hassles lately. I haven't seen this error since that day and I've been working on the same project for a while. I assume it's a fluke and not reproducible. That's going to be a problem until someone can reproduce
I just had a sighting... it appears to be the same issue, and I believe it is reproducible.
Claude Code CLI Bug Report - Process Kill Permission Error
Summary
Claude Code CLI crashes with an unhandled
EPERM(permission denied) error when attempting to kill a child process. This crash is reproducible and occurs at the same point in multiple runs.Error Details
Environment
/home/bhamon/.nvm/versions/node/v22.17.1/lib/node_modules/@anthropic-ai/claude-code/cli.js/home/bhamon/code/tronContext
The crash occurred while Claude Code was executing Python scripts for model weight conversion:
bin/convert_gpt_oss_weights.py- Converting GPT-OSS-20B model weightsbin/regenerate_index.py- Regenerating index for converted weightsRoot Cause Analysis
The error indicates Claude Code is trying to kill a child process but lacks the necessary permissions. This could happen when:
sudo)Stack Trace Analysis
process.kill()functionsLB,aLB)Array.forEachcalls suggest iteration over a collection of processesReproducibility
Impact
Suggested Fix
The Claude Code CLI should:
process.kill()calls in try-catch blocksEPERMerrors gracefully (log warning instead of crashing)Workaround
Users may need to:
sudowith commands executed through Claude CodeReport Submission
This issue should be reported to: https://github.com/anthropics/claude-code/issues
Include:
This monkey-patch seems to work for me:
Invoke claude via
node -r patch-kill.js "$(which claude)"instead, wherepatch-kill.jsis:This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.
This happened to me several times in a row, and this is how to reproduce it:
Create shell script, 'test.sh' with contents:
Start claude agent with prompt, and approve the sudo command
Then, press the escape key to "interrupt" as suggested, program exits with return code 1 and following output:
Claude Code v2.0.59
"Opus 4.5 Claude Max"
This issue has been automatically closed due to 60 days of inactivity. If you're still experiencing this issue, please open a new issue with updated information.
This issue was closed incorrectly despite recent human comments. This behavior of the bot is reported at https://github.com/anthropics/claude-code/issues/16497. Please upvote that issue, so maybe it gets noticed.
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.