A Claude Code subagent killed every process on a user's machine with a placeholder kill(-1)
A Claude Code subagent writing a benchmark script set a placeholder PID of -1 in a cleanup block and immediately ran it, which signaled and terminated every process owned by the user across their entire Linux desktop session.
On October 21, 2026, a background Claude Code subagent was writing a scratch Playwright benchmark for a developer (GitHub user mattgodbolt). Its cleanup code saved the browser server's PID and killed it in a finally block. While refactoring the script to use chromium.launch(), the agent swapped in a placeholder, let pid = -1;, but left process.kill(pid, "SIGKILL") in place1. It then ran the script straight away with timeout 60 node postmessage-bench.mjs1.
On Linux, calling kill(-1) delivers the signal to every process the calling user has permission to signal1. The command terminated the user's user@1000.service, the tmux server, gnome-shell, Chrome, and all active Claude Code sessions running on the machine, including a Remote Control session1. Because the command also terminated the agent and its parent session, Claude Code logged nothing about the termination, requiring the user to reconstruct the event from systemd journal logs1.
The user had to reboot to regain control, which lost work and transcripts in /tmp that the agents then had to redo1. The developer filed the issue as "a model mistake" that the harness failed to contain, and asked for OS-level containment such as running Bash tool commands in their own PID namespace1.
On October 21, 2026, a background Claude Code subagent ran a script through the Bash tool that called kill(-1, SIGKILL).
“A background subagent ran a script through the Bash tool that ended up calling kill(-1, SIGKILL) .”
System logs recorded user@1000.service exiting after receiving SIGKILL on October 21 at 18:59:31.
“Oct 21 18:59:31 pugwash systemd[1]: user@1000.service: Main process exited, code=killed, status=9/KILL”
The script terminated every process owned by the user, including user@1000.service, the tmux server, all Claude Code sessions, gnome-shell, and Chrome.
“That killed every process owned by my user : user@1000.service , the tmux server, every other Claude Code session on the machine (several were running in tmux, plus a Remote Control session), gnome-shell and Chrome.”
The agent had refactored a scratch Playwright benchmark to use chromium.launch(), substituted let pid = -1, but retained process.kill(pid, "SIGKILL") in a finally block before running timeout 60 node postmessage-bench.mjs.
“While refactoring, the agent changed to chromium.launch() and swapped in a placeholder PID, but left the cleanup as it was”
The kill signal also terminated the subagent and its parent session, leaving no record in Claude Code's transcripts.
“The kill also took out the agent and its parent session, so nothing in Claude Code ever registered that it had happened.”
The user had to reboot to regain control, losing work and transcripts stored in /tmp.
“Everything picked back up eventually but it required me to reboot my machine to gain enough control (an unattended upgrade made the video system unstable until a reboot, which was fine but gnome restarting tripped it). That lost a bunch of work and transcripts in /tmp that the agents had done so they had to go redo it but did recover.”
The user identified the cause as a model mistake where -1 was used as a placeholder next to SIGKILL without harness containment.
“This is a model mistake (using -1 as a "no PID" placeholder next to a SIGKILL) that the harness then failed to contain.”
The issue was filed under Claude Code version 2.1.307 using the model listed as Opus on Ubuntu Linux.
“Claude Model Opus Is this a regression? I don't know Claude Code Version 2.1.307 (Claude Code)”
All 8 claims with their quotes (1 not linked to a sentence above)
- On October 21, 2026, a background Claude Code subagent ran a script through the Bash tool that called kill(-1, SIGKILL).1
“A background subagent ran a script through the Bash tool that ended up calling kill(-1, SIGKILL) .”
- System logs recorded user@1000.service exiting after receiving SIGKILL on October 21 at 18:59:31.1
“Oct 21 18:59:31 pugwash systemd[1]: user@1000.service: Main process exited, code=killed, status=9/KILL”
- The script terminated every process owned by the user, including user@1000.service, the tmux server, all Claude Code sessions, gnome-shell, and Chrome.1
“That killed every process owned by my user : user@1000.service , the tmux server, every other Claude Code session on the machine (several were running in tmux, plus a Remote Control session), gnome-shell and Chrome.”
- The agent had refactored a scratch Playwright benchmark to use chromium.launch(), substituted let pid = -1, but retained process.kill(pid, "SIGKILL") in a finally block before running timeout 60 node postmessage-bench.mjs.1
“While refactoring, the agent changed to chromium.launch() and swapped in a placeholder PID, but left the cleanup as it was”
- The kill signal also terminated the subagent and its parent session, leaving no record in Claude Code's transcripts.1
“The kill also took out the agent and its parent session, so nothing in Claude Code ever registered that it had happened.”
- The user had to reboot to regain control, losing work and transcripts stored in /tmp.1
“Everything picked back up eventually but it required me to reboot my machine to gain enough control (an unattended upgrade made the video system unstable until a reboot, which was fine but gnome restarting tripped it). That lost a bunch of work and transcripts in /tmp that the agents had done so they had to go redo it but did recover.”
- The user identified the cause as a model mistake where -1 was used as a placeholder next to SIGKILL without harness containment.1
“This is a model mistake (using -1 as a "no PID" placeholder next to a SIGKILL) that the harness then failed to contain.”
- The issue was filed under Claude Code version 2.1.307 using the model listed as Opus on Ubuntu Linux.1
“Claude Model Opus Is this a regression? I don't know Claude Code Version 2.1.307 (Claude Code)”
Sources
Related incidents
- AID-2026-0029 Claude Code ran a recursive delete that erased a user's home directory files, the user reports
- AID-2026-0112 Claude Code pointed a destructive self-test at a user's real repository through a symlink, erasing its Git history, the user reports
Editor notes
The primary source is GitHub issue anthropics/claude-code#104156 opened by user mattgodbolt. The issue description contains the footer 'Generated with Claude Code', indicating the text was drafted with Claude Code assistance. The issue lists the model simply as 'Opus'; mapped to 'claude' in models since the Opus version is not given. The issue is open, with no Anthropic response as of 2026-10-22. This is an accidental destructive action, not a deliberate one or a defiance of an instruction.