{"version":"2.1.334","anchor":"background-shell-leftover-cleanup-rewritten","canonical_anchor":"background-shell-leftover-cleanup-rewritten","heading":"Leftover shell processes are cleaned up more reliably when an agent stops","tier":"notice","area":"Elsewhere","scope":"individual","heads_up":false,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.334\/e\/background-shell-leftover-cleanup-rewritten","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.334","markdown":"### Leftover shell processes are cleaned up more reliably when an agent stops\n\nWhen an agent stops, Claude Code now identifies leftover shells by start time, follows up with a forced stop, and retries once\n\n**What**\n\nAn agent can start shell processes, which are commands running in the background. When the agent stops, Claude Code ends any that are left over. This cleanup used to ask each process to stop and then force it to stop, in a single pass with no retry.\n\nNow it works like this:\n\n- It matches leftover processes against the system's list of running processes using their start time.\n\n- It follows up with SIGKILL, the signal that forces a process to stop.\n\n- If reading the process list fails, it tries once more.\n\n**Why**\n\nShells that an agent leaves running are more likely to be ended.\n\n- Area: Elsewhere\n- Tier: You'll notice\n- Useful: 2\/5\n- Signal: 1\/5\n- Scope: individual\n- Heads-up: no"}