claude-orphan-cleanup

Identify and terminate orphaned Claude Code CLI processes consuming excessive CPU.

39|7|Updated Dec 27, 2025
One-click install
npx skills add https://github.com/extractumio/extractum-skills --skill claude-orphan-cleanup
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: claude-orphan-cleanup
Source: https://github.com/extractumio/extractum-skills/tree/main/devops/claude-orphan-cleanup
Command: npx skills add https://github.com/extractumio/extractum-skills --skill claude-orphan-cleanup

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill automatically finds and terminates orphaned Claude Code CLI processes that are stuck running in the background and consuming excessive CPU resources.

Core Features & Use Cases

  • Orphaned Process Detection: Identifies background bash processes adopted by init (PID 1) after the main Claude process has crashed or been interrupted.
  • Resource Reclamation: Frees up CPU cycles and system resources by terminating these stuck processes.
  • Use Case: If your system's CPU usage is unexpectedly high after using Claude Code, this skill can quickly identify and remove the rogue processes.

Quick Start

Run the claude-cleanup command to find and terminate any orphaned Claude Code processes.

Frequently Asked Questions about claude-orphan-cleanup

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I terminate orphaned Claude Code processes consuming high CPU on macOS or Linux?

Orphaned Claude Code processes are background bash operations adopted by init (PID 1) after the main CLI crashes or gets interrupted. They continue running and consuming CPU cycles because the parent process is no longer managing them.

How do I identify stuck Claude Code CLI processes before killing them?

You can identify stuck Claude Code CLI processes by listing processes with PPID=1 and command-line patterns associated with Claude's internal operations like shell snapshots and SDK components. A dry-run option allows listing these processes before terminating them.

Does Claude orphan cleanup work on both macOS and Linux systems?

Yes, Claude orphan cleanup works on both macOS and Linux systems. It specifically targets processes with PPID=1 and command-line patterns associated with Claude's internal operations, providing compatible process detection and termination across both operating systems.

Can I force-kill stuck Claude Code processes for automated cleanup?

Yes, you can force-kill stuck Claude Code processes for automated cleanup. The skill provides options for dry-run listing, killing with confirmation, and force-killing, allowing you to automate the termination of rogue processes consuming excessive CPU resources.

Why does my system have high CPU usage after using Claude Code?

High CPU usage after using Claude Code is typically caused by orphaned CLI processes running in the background. When the main Claude process crashes or is interrupted, background bash processes are adopted by init and continue consuming resources, requiring cleanup to restore normal CPU levels.