prune-agents

Terminate orphaned Claude subagent processes via a cleanup script.

26|2|Updated Jan 14, 2026
One-click install
npx skills add https://github.com/howells/arc --skill prune-agents
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: prune-agents
Source: https://github.com/howells/arc/tree/main/skills/prune-agents
Command: npx skills add https://github.com/howells/arc --skill prune-agents

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

Prune orphaned Claude subagent processes that didn't exit cleanly, freeing system resources and reducing background noise.

Core Features & Use Cases

  • Automated cleanup of orphaned Claude Code subagents.
  • Safe to run anytime; preserves active sessions.
  • Useful after long-running tasks or tool usage to prevent background CPU/memory consumption.

Quick Start

Run the prune-agents script to terminate orphaned processes. Use the provided cleanup script at ${CLAUDE_PLUGIN_ROOT}/scripts/cleanup-orphaned-agents.sh and report the number of terminated processes to the user.

Frequently Asked Questions about prune-agents

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

FAQPage Schema
How do I kill orphaned Claude subagents that didn't exit cleanly?

To kill orphaned Claude subagents, execute the cleanup script at ${CLAUDE_PLUGIN_ROOT}/scripts/cleanup-orphaned-agents.sh, which safely terminates lingering processes and reports the count of terminated subagents to free system resources.

Why does Claude Code leave background processes running after task completion?

Claude Code leaves background processes running when subagents fail to exit cleanly after task completion, causing lingering background CPU and memory consumption. Running a cleanup script safely terminates these orphaned subagent processes.

Can I safely terminate orphaned subagents without disrupting active Claude sessions?

Yes, you can safely terminate orphaned subagents without disrupting active sessions. The cleanup script specifically targets lingering processes that didn't exit cleanly, preserving active Claude Code sessions during the process cleanup.

When should I run a subagent cleanup script to reduce background resource consumption?

You should run a subagent cleanup script after long-running tasks or extensive tool usage to prevent background CPU and memory consumption. It is safe to run anytime to clear orphaned Claude Code processes.

What's the best way to clean up orphaned processes spawned by Claude Code?

The best way to clean up orphaned processes spawned by Claude Code is executing the cleanup-orphaned-agents.sh script, which safely terminates lingering subagents, reduces background noise, and reports the number of terminated processes.