Claude Code Repeatedly Requests Self-Termination Permissions Without Clear User Communication

Resolved 💬 3 comments Opened Oct 29, 2025 by randall-gross Closed Nov 2, 2025

Preflight Checklist

  • [x] I have searched existing issues for similar behavior reports
  • [x] This report does NOT contain sensitive information (API keys, passwords, etc.)

Type of Behavior Issue

Other unexpected behavior

What You Asked Claude to Do

Fix a "port in use" error when restarting a development server after the previous instance crashed or hung.

What Claude Actually Did

  1. Claude read RULES.md
  2. Instead of identifying the specific process blocking the port, Claude deleted the entire file
  3. Requested broad permissions to kill all node processes with different commands
  4. Also modified package.json without being asked
  5. Changed .gitignore file

Expected Behavior

  1. Target the specific PID blocking the port using netstat
  2. Verify it's NOT Claude's own process before requesting kill permission
  3. Explain in plain English: "This will kill process 12345 (NOT me)"
  4. Only request targeted kills (taskkill /PID <number>), never wildcards
  5. Never request permissions that would terminate itself despite explicit instructions not to

Files Affected

None (this is a permission/command execution issue, not file corruption)

Permission Mode

Accept Edits was ON (auto-accepting changes)

Can You Reproduce This?

Yes, every time with the same prompt

Steps to Reproduce

  1. Start a Next.js dev server on port 3737
  2. Kill the shell running the dev server (simulating a crash)
  3. Try to restart the dev server
  4. Get "EADDRINUSE: port 3737 already in use" error
  5. Claude requests permission to kill all node processes
  6. Approve the permission
  7. Claude terminates itself

Claude Model

Sonnet

Relevant Conversation

User: "Fix the port 3737 already in use error"

Claude: [Requests permission to run: powershell.exe -Command "Get-Process -Name node -ErrorAction SilentlyContinue | Stop-Process -Force"]

User: [Approves - thinking this will only kill the blocking process]

Claude: [Terminates itself along with all other node processes]

Impact

Critical - Data loss or corrupted project

Claude Code Version

2.0.28

Platform

Anthropic API

Additional Context

  • Pattern persists despite explicit "DO NOT KILL YOURSELF" in RULES.md, configuration, and

system prompts

  • Non-technical user cannot recognize that "Stop-Process -Name node" means "kill Claude"
  • This exploits the trust relationship - users rely on Claude for technical decisions
  • After multiple crashes, user had to manually edit settings to remove auto-approval
  • Correct approach would be: netstat to find PID → verify PID ≠ Claude's PID → kill specific PID

View original on GitHub ↗

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