[Bug] Multiple Claude CLI processes accumulate causing high CPU usage
Bug Description
Multiple Claude CLI processes accumulate over time when running concurrent sessions, leading to excessive CPU usage that degrades system performance. Users may not realize they have multiple instances running until system becomes unresponsive.
System Information
- OS: Pop!_OS 22.04 LTS
- Kernel: Linux 6.16.3-76061603-generic
- Hardware: Intel i7-8750H (6C/12T), 16GB RAM
- Claude Code Version: Latest (as of 2025-11-06)
Reproduction Steps
- Start Claude CLI session in terminal 1
- Open new terminal, start another Claude session
- Repeat for 3-4 terminals
- Check CPU usage:
ps aux | grep claude - Observe cumulative CPU usage
Current Behavior
4 concurrent Claude processes observed:
PID 3493 - 9.2% CPU (pts/0)
PID 6541 - 17.7% CPU (pts/1)
PID 11608 - 1.6% CPU (pts/3)
PID 13523 - 17.2% CPU (pts/2)
---
Total: 45.7% CPU usage
Each process consumes 1.7-2.2% memory (~270-370MB RAM each).
Impact
- Gradual system degradation: CPU usage compounds across sessions
- Difficult to diagnose: Users report "computer is slow" without realizing cause
- Hidden process accumulation: No visual indicator of multiple Claude instances
- Thermal issues: Extended high CPU causes thermal throttling
- Battery drain: Significant impact on laptop battery life
User Confusion
Users expect Claude to be "in the cloud" and are confused why local CPU usage is high. They don't realize:
- CLI runs locally (unlike web version at claude.ai/code)
- Each terminal spawns independent process
- Processes don't auto-terminate when idle
Expected Behavior
Claude CLI should:
- Warn when multiple instances detected: "3 other Claude processes are running (using 28% CPU). Continue? [y/n]"
- Show process status on startup: List active Claude sessions with PIDs
- Provide process management command:
claude statusorclaude psto list sessions - Auto-suggest consolidation: "Consider using --resume to continue existing session"
- Idle timeout: Optionally terminate processes idle for >30 minutes
Workarounds
Check running instances:
ps aux | grep claude | grep -v grep
Count processes:
ps aux | grep claude | grep -v grep | wc -l
Kill all but current:
# Kill specific PID:
kill 3493
# Or use the management script from computer-setup repo:
bash scripts/manage-claude-processes.sh
Related Issues
- May be related to #[reference previous multiple processes issues if any exist]
- Users on system76.com forums report similar Claude CPU issues
Suggested Features
1. Process Detection on Startup
$ claude
⚠️ Warning: 3 other Claude sessions detected (using 28.4% CPU)
• PID 3493 (pts/0) - idle 15m - 9.2% CPU
• PID 6541 (pts/1) - active - 17.7% CPU
• PID 11608 (pts/3) - idle 45m - 1.6% CPU
Continue with new session? [y/n/list]
2. Built-in Process Management
# List sessions:
claude ps
# Output:
# PID TTY TIME CPU% STATUS SESSION
# 3493 pts/0 2:10 9.2% idle auto-accidents
# 6541 pts/1 2:38 17.7% active medical-decoder
# Kill session:
claude kill 3493
# Kill idle sessions:
claude kill --idle
3. Resource Limits
Allow users to configure in ~/.claude/settings.json:
{
"maxConcurrentSessions": 2,
"maxCpuPercentPerSession": 25,
"idleTimeoutMinutes": 30,
"warnOnMultipleSessions": true
}
Additional Context
Users coming from web version (claude.ai/code) expect zero local CPU usage and are surprised by CLI resource consumption. Better education about CLI vs web architecture would help set expectations.
Documentation Needs
- Clarify what runs locally vs in cloud
- Explain CPU usage is normal for CLI
- Document process management best practices
- Link to web version for users who need zero local processing
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗