A command-line utility to list, monitor, and manage processes spawned by Claude AI assistant in terminal environments, with additional system monitoring capabilities.
Current Status: โ
Installed and working at /Users/yanick/bin/claude-process-manager/ with symlink ~/bin/cproc
When using Claude in terminal applications, it often spawns background processes that can consume significant system resources. This tool helps you:
- ๐ List all Claude-spawned processes with their working directories
- ๐ Kill specific processes or all Claude processes at once
- ๐ Monitor system resource usage and active network listeners
- ๐ View working directories of any running process
While Claude may have a built-in claude process command, cproc offers several advantages:
| Feature | claude process |
cproc |
|---|---|---|
| Availability | May not exist or be limited | โ Always available as standalone tool |
| Working Directories | โ Not shown | โ Shows where each process is running from |
| Process Hierarchy | โ Limited | โ Shows parent-child relationships |
| System Monitoring | โ Claude-only | โ System-wide resource monitoring |
| Network Ports | โ Not included | โ Shows active development servers |
| Bulk Operations | โ Limited | โ Kill multiple processes or all at once |
| Cross-platform | โ Claude-dependent | โ Works independently |
| Customizable | โ No | โ Open source, modify as needed |
Key Differences:
- ๐๏ธ Directory Context:
cprocshows exactly which folder each process is running from - ๐ Process Tree: See parent shell processes and their children
- ๐ Resource Usage: Monitor memory consumption and system impact
- ๐ Network Awareness: Check which ports your development servers are using
- โก Bulk Management: Kill all Claude processes with one command
- ๐ง Standalone: Works even if Claude's built-in commands are unavailable
Example Comparison:
# If claude process shows:
# PID 12345: python3
# cproc shows:
# ๐ Shell Process (PID: 12340):
# Command: /bin/zsh -c -l source ~/.claude/shell-snapshots/...
# ๐ Working Directory: /Users/yanick/my-project
# ๐ถ Child processes:
# โโโ PID: 12345 - python3 launch.py --api --listen
# โ ๐ /Users/yanick/my-project-
Clone this repository:
git clone https://github.com/yanicklandry/claude-process-manager.git ~/bin/claude-process-manager -
Make the script executable:
chmod +x ~/bin/claude-process-manager/cproc.sh -
Make sure
~/binis in your PATH (add to~/.zshrcor~/.bashrcif needed):export PATH="$HOME/bin:$PATH"
-
Create a symlink for easy access:
ln -sf ~/bin/claude-process-manager/cproc.sh ~/bin/cproc
- Download
cproc.shand place it in a directory in your PATH - Make it executable:
chmod +x /path/to/cproc.sh
# List all Claude-spawned processes (default command)
cproc
cproc list
cproc ls
cproc l
# Kill specific process(es)
cproc kill 12345
cproc kill 12345 67890
cproc k 12345
# Kill ALL Claude processes
cproc kill all
cproc k all
# Show process status and resource usage
cproc status
cproc s
# Show working directory for process(es)
cproc cwd 12345
cproc pwd 12345 67890
# Show help
cproc help
cproc hList all Claude processes:
$ cproc list
๐ค Claude-spawned processes:
================================
๐ Shell Process (PID: 58288):
Command: /bin/zsh -c -l source ~/.claude/shell-snapshots/snapshot-zsh-...
๐ Working Directory: ~/Developer/2025/stable-diffusion-webui
๐ถ Child processes:
โโโ PID: 58301 - python3 launch.py --api --listen --skip-torch-cuda-test --use-cpu all
โ ๐ ~/Developer/2025/stable-diffusion-webui
๐ Summary:
Claude shells: 1Kill a memory-hungry process:
$ cproc kill 58301
๐ Killing PID 58301...
โ
PID 58301 killed.Check process status:
$ cproc status
๐ Process Status Summary:
==========================
๐ค Claude processes:
None found
๐ High-resource processes (>100MB RAM):
1234 5.2% 512MB python3
5678 3.1% 256MB node
๐ Active network listeners:
Port 3000: node 1234
Port 8080: python3 5678The tool identifies Claude-spawned processes by looking for shell processes that:
- Execute from
.claude/shell-snapshots/directories - Match the pattern
snapshot-zsh-*in their command line - Are spawned by Claude's session management system
Large applications and development tools can consume significant RAM. Use cproc to:
- Monitor which processes are using the most memory
- Quickly terminate resource-heavy processes when done
- Clean up orphaned processes that didn't shut down properly
When working with multiple Claude sessions:
- See what projects are currently running in the background
- Identify which directory each process is running from
- Clean up old development servers or background tasks
- Get a quick overview of all Claude-related system activity
- Check which development servers and services are running
- Monitor network port usage for web applications
- Troubleshoot processes that might be stuck or unresponsive
- macOS (uses
lsofandpscommands) - Bash 4.0+
- Claude AI running in a terminal environment (like Warp)
~/bin/claude-process-manager/ # or ~/bin/cproc/ for new installs
โโโ cproc.sh # Main script
โโโ README.md # This documentation
โโโ LICENSE # MIT license
โโโ .gitignore # Git ignore file
โโโ .git/ # Git repository
Current symlink: ~/bin/cproc -> ~/bin/claude-process-manager/cproc.sh
This is normal if:
- No Claude sessions are currently running background processes
- All previous processes have completed and terminated
- You're not running Claude in a terminal environment
Make sure the script is executable:
chmod +x ~/bin/claude-process-manager/cproc.sh # or ~/bin/cproc/cproc.sh for new installsEnsure ~/bin is in your PATH:
echo $PATH | grep -o "$HOME/bin"Feel free to submit issues, feature requests, or pull requests. This tool is designed to be simple and focused on Claude process management.
MIT License - Feel free to use, modify, and distribute.
Created to help manage resource-intensive AI processes spawned by Claude in terminal environments.