Crash: EPERM error when killing background shell process

Resolved 💬 8 comments Opened Dec 24, 2025 by jhinrichsen Closed Mar 1, 2026

Description

Claude Code crashed with an EPERM (permission error) when attempting to kill a background shell process.

Error Details

Error: kill EPERM
    at process.kill (node:internal/process/per_thread:281:13)
    at PM0 (file:///home/jot/.local/share/pnpm/global/5/.pnpm/@anthropic-ai+claude-code@2.0.29/node_modules/@anthropic-ai/claude-code/cli.js:195:2928)
    at file:///home/jot/.local/share/pnpm/global/5/.pnpm/@anthropic-ai+claude-code@2.0.29/node_modules/@anthropic-ai/claude-code/cli.js:195:2801
    at Array.forEach (<anonymous>)
    at file:///home/jot/.local/share/pnpm/global/5/.pnpm/@anthropic-ai+claude-code@2.0.29/node_modules/@anthropic-ai/claude-code/cli.js:195:2772
    at Array.forEach (<anonymous>)
    at TM0 (file:///home/jot/.local/share/pnpm/global/5/.pnpm/@anthropic-ai+claude-code@2.0.29/node_modules/@anthropic-ai/claude-code/cli.js:195:2744)
    at file:///home/jot/.local/share/pnpm/global/5/.pnpm/@anthropic-ai+claude-code@2.0.29/node_modules/@anthropic-ai/claude-code/cli.js:195:2675

Context

The crash occurred after:

  1. Running a background bash command: sudo libinput debug-events --show-keycodes 2>&1 | head -50
  2. Attempting to kill the background shell using the Kill Shell tool

Environment

  • Claude Code version: 2.0.29
  • Platform: Linux (Fedora 43)
  • Kernel: 6.17.11-300.fc43.x86_64
  • Installation method: pnpm global

Steps to Reproduce

  1. Run a background bash command with sudo
  2. Attempt to kill the background shell process
  3. Observe EPERM error and crash

Expected Behavior

Claude Code should handle permission errors gracefully when attempting to kill background processes, rather than crashing.

View original on GitHub ↗

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