ctop-claude
v1.0.0
Published
Terminal UI for monitoring and managing Claude Code sessions
Downloads
20
Maintainers
Readme
CTOP — Claude Terminal Operations Panel
A terminal UI for monitoring and managing Claude Code sessions. Think htop, but for your Claude processes.
Track CPU, memory, token usage, context window saturation, active branches, and more — all from a single terminal pane.
Features
- Real-time process monitoring — CPU, memory, status, uptime for every Claude session
- Context window tracking — visual bar showing input, cache, output, and free context (out of 200k)
- Token breakdown — input, output, cache creation, and cache read token counts per session
- Session metadata — model, branch, slug, session ID, service tier, version
- Two view modes — list view (table) and pane view (card grid)
- Process control — kill individual or all sessions (graceful
SIGTERMor forceSIGKILL) - Vim-style navigation —
hjkl,g/G, arrow keys - Sort & filter — sort by CPU, memory, context %; filter by branch, model, directory, or slug
- Configurable — refresh interval, context limit, default view via
~/.ctoprcor CLI flags - Cross-platform — macOS and Linux (Windows planned)
- Zero dependencies — pure Node.js, no
npm installrequired - Auto-refresh — configurable interval (default 5s)
Installation
npm (recommended)
npm install -g ctop-claude
ctopOr run without installing:
npx ctop-claudeFrom source
git clone https://github.com/aakashadesara/ctop.git
chmod +x ctop/claude-manager
ln -s "$(pwd)/ctop/claude-manager" /usr/local/bin/ctopOne-liner
curl -o /usr/local/bin/ctop https://raw.githubusercontent.com/aakashadesara/ctop/main/claude-manager
chmod +x /usr/local/bin/ctopVerify
ctopIf no Claude processes are running, you'll see an empty state. Start a Claude Code session and ctop will pick it up on the next refresh.
Recommended aliases
Add these to your ~/.zshrc or ~/.bashrc:
# Launch ctop
alias ctop="/usr/local/bin/ctop"
# Quick-kill all Claude sessions (no TUI, just nuke them)
alias ckill="pkill -f 'claude'"Then reload:
source ~/.zshrcUsage
Keyboard shortcuts
| Key | Action |
|-----|--------|
| ↑ / k | Move selection up |
| ↓ / j | Move selection down |
| ← / h | Move left (pane mode) |
| → / l | Move right (pane mode) |
| g | Jump to first process |
| G | Jump to last process |
| P | Toggle list / pane view |
| s | Cycle sort: age → cpu → mem → context |
| S | Reverse sort order |
| / | Start filter (type to search, Enter to confirm) |
| ESC | Clear filter (or quit if no filter active) |
| r | Refresh process list |
| x | Kill selected process (SIGTERM) |
| X | Force kill selected process (SIGKILL) |
| K | Kill ALL Claude processes |
| A | Kill all stopped/zombie processes |
| ? | Show help |
| q | Quit |
Context window visualization
The context bar shows how much of the 200k token window is consumed:
[████████░░░░░░░░░░░░░░░░░░░░░░] 27% used
▲ green ▲ blue ▲ cyan ▲ yellow ▲ gray
input cache-w cache-r output freeColor coding:
- Green — 70%+ free (healthy)
- Yellow — 40–70% free
- Orange — 10–40% free (getting tight)
- Red — <10% free (near limit)
Detail pane
On wide terminals (140+ cols), a detail pane appears showing full session info: model, branch, slug, token breakdown, turn duration, session ID, and more.
Configuration
CLI flags
ctop --refresh 3 # Refresh every 3 seconds
ctop --context-limit 128000 # Set context window to 128k
ctop --pane # Start in pane/grid viewConfig file (~/.ctoprc)
{
"refreshInterval": 5000,
"contextLimit": 200000,
"defaultView": "list"
}CLI flags override config file values.
Requirements
- macOS or Linux (uses
ps+lsofon macOS,ps+/procon Linux) - Node.js 18+
- Claude Code installed and running sessions
How it works
ctop reads process info from ps, resolves working directories via lsof, and enriches each process with session metadata by parsing Claude Code's local .jsonl session files in ~/.claude/projects/. No network calls. No external dependencies. Everything stays local.
Roadmap
- [x] Linux support —
ps+/procbased process detection - [x] npm package —
npm install -g ctop-claude - [x] Configurable settings — refresh interval, context limit, default view
- [x] Sort — cycle through age, CPU, memory, context %
- [x] Filter — search by branch, model, directory, slug, title
- [ ] Windows support — PowerShell-based process detection
- [ ] Homebrew formula —
brew install ctop - [ ] Process log tailing — stream a session's output in a split pane
- [ ] Color themes — custom or preset color schemes
Contributing
PRs are welcome! This is a young project and there's plenty to improve.
# Fork & clone
git clone https://github.com/<your-username>/ctop.git
cd ctop
# The entire app is a single file — no build step
# Just edit and run:
./claude-managerA few areas where contributions would be especially helpful:
- Windows compatibility — the biggest gap right now
- Tests — there are none yet
- Linux testing — basic support is in, needs real-world validation
- Performance — profiling on systems with many Claude sessions
- UI polish — better responsive layouts, color themes
Please open an issue first for large changes so we can discuss the approach.
License
MIT — use it however you want.
