Apra-Labs

Claude Stop Agents — Development skill for Claude Code

Development community

Stop all running Claude Code background agents with one command (Windows, macOS, Linux).

How to install Claude Stop Agents

This entry records only its repository, not the path inside it, so there is no exact command to give. Open Apra-Labs/claude-stop-agents and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What Claude Stop Agents does

Stop all running Claude Code background agents with one command (Windows, macOS, Linux).

Alternatives in Development

  • Claude Code Zh Cn — Claude Code CLI 简体中文本地化 / 汉化插件;支持 macOS、Linux、WSL、Windows 与新版 native,一行安装,更新后自动修复 721 ★
  • SSH Skill — 面向 Codex 和 Claude Code 的跨平台 SSH 工作流 Skill,支持 Windows、macOS、Linux 488 ★
  • Quosparr — 🐦 Native menu bar & tray app for macOS, Windows and Linux: track Codex, Claude Code and Grok quotas, resets 288 ★

README

claude-stop-agents

Stop every running [Claude Code](https://github.com/anthropics/claude-code) background agent with one command.

Claude Code can stop background sessions one at a time (`claude stop `). This tool reads `claude agents --json` and stops each agent that still has a running process (one that has a `pid`). The conversations are kept, so `claude attach ` or `claude --resume` can reopen them.

Usage

The command and flags are the same on Windows, macOS and Linux:

stop-agents                      # list agents with a running process, confirm, stop them
stop-agents -y | --yes           # stop without asking
stop-agents -n | --dry-run       # only list what would be stopped
stop-agents -s blocked,working   # also restrict by state (or --state=blocked)
stop-agents -h | --help

Example:

$ stop-agents
Found 2 agent(s) with a running process:
ID        PID    STATE    STATUS  NAME
1a2b3c4d  17232  blocked  idle    refactor auth module
5e6f7a8b  26732  working  busy    fix flaky tests
Stop all of them? [y/N] y
Stopping 1a2b3c4d (refactor auth module)... ok
Stopping 5e6f7a8b (fix flaky tests)... ok
Done: 2 stopped, 0 failed.

If you run it from inside a Claude Code agent, that agent stops too.

Install

Put the files in a directory on your `PATH`. `~/.local/bin` works well because Claude Code's native installer puts `claude` there.

**macOS / Linux (bash or zsh)**: needs `jq` or `python3`.

cp stop-agents ~/.local/bin/ && chmod +x ~/.local/bin/stop-agents

**Windows (Command Prompt or PowerShell)**: copy both files. `stop-agents.cmd` runs `stop-agents.ps1` with Windows PowerShell.

copy stop-agents.cmd %USERPROFILE%\.local\bin\
copy stop-agents.ps1 %USERPROFILE%\.local\bin\

Files

File Platform
stop-agents macOS / Linux (bash, zsh)
stop-agents.cmd + stop-agents.ps1 Windows