{"slug": "ctop-terminal-pane-for-monitoring-ai-agents", "title": "CTOP – Terminal Pane for Monitoring AI Agents", "summary": "Developer Aakash Desai released CTOP, a terminal pane for monitoring AI coding agents including Claude Code, Codex CLI, OpenCode, and Devin, providing real-time CPU, memory, token usage, context window, cost estimation, and session control. The open-source tool, installable via Homebrew, npm, or npx, offers multi-agent monitoring, live log tailing, and a plugin system, aiming to improve developer workflow when running multiple AI coding sessions.", "body_md": "** htop for your AI coding agents.** Monitor Claude Code, Codex CLI, OpenCode, and Devin sessions — CPU, memory, tokens, context window, costs, branches — from a single terminal pane.\n\n**Multi-agent monitoring**— Claude Code + Codex CLI + OpenCode + Devin, real-time CPU/memory/status** Context window tracking**— visual bar with input, cache, output, and free segments** Cost estimation**— per-session and aggregate API cost (Claude + OpenAI pricing)** Token waveform**— real-time sparkline showing token activity pulse** Two view modes**— list view (table) and pane view (card grid), toggle with`P`\n\n**Live log tailing**— stream conversation in a split pane (`L`\n\n)**Sort, filter, search**— by CPU, memory, context, branch, model, or full-text (`F`\n\n)**Dashboard & history**— aggregate stats (`d`\n\n), 24-hour usage charts (`H`\n\n)**Process control**— kill sessions (graceful or force), bulk multi-select close, quick-jump to project dir** Desktop notifications**— get notified when sessions complete** 5 color themes**— default, minimal, dracula, solarized, monokai (+ custom)** Plugin system**— extend with custom columns via`~/.ctop/plugins/`\n\n**Compaction & rate limit detection**— flags compaction events and quota usage** CLI mode for agents**—`ctop ls`\n\n,`ctop whoami`\n\n,`ctop alerts`\n\n, … (see[CLI mode](#cli-mode-for-agents-and-scripts))\n\n```\n# Homebrew\nbrew tap aakashadesara/ctop && brew install ctop-claude\n\n# npm\nnpm install -g ctop-claude\n\n# npx (no install)\nnpx ctop-claude\n\n# From source\ngit clone https://github.com/aakashadesara/ctop.git\nchmod +x ctop/claude-manager\nln -s \"$(pwd)/ctop/claude-manager\" /usr/local/bin/ctop\n```\n\nThen run `ctop`\n\n. If no agents are running, you'll see an empty state — start a Claude Code, Codex, OpenCode, or Devin session and it'll appear on the next refresh.\n\n| Key | Action |\n|---|---|\n`j` /`k` or `↑` /`↓` |\nNavigate |\n`h` /`l` or `←` /`→` |\nNavigate (pane mode) |\n`g` / `G` |\nJump to first / last |\n`P` |\nToggle list / pane view |\n`p` |\nPin / unpin session (sticks it to the top) |\n`Space` |\nMark / unmark session (multi-select) |\n`Shift+↑` /`↓` or `V` |\nExtend / start a marked range |\n`a` |\nSelect all visible / clear |\n`s` / `S` |\nCycle sort / reverse |\n`/` |\nFilter |\n`F` |\nFull-text search conversations |\n`d` |\nToggle dashboard |\n`L` |\nToggle log pane |\n`H` |\nToggle 24-hour history |\n`W` |\nTimeline view |\n`T` |\nCycle color theme |\n`x` / `X` |\nKill (SIGTERM / SIGKILL) — bulk if rows are marked |\n`K` |\nKill ALL agents |\n`A` |\nKill ALL stopped/dead agents |\n`o` / `e` / `t` |\nOpen dir in Finder / editor / terminal |\n`n` |\nToggle notifications |\n`?` |\nHelp |\n`Esc` |\nClear selection (or filter / search) |\n`q` |\nQuit |\n\nMouse: click to select, scroll to navigate, click the `★`\n\ngutter to pin/unpin, `Shift`\n\n+click to mark (best-effort).\n\nKeep the sessions you care about in view. Press `p`\n\n(or click the `★`\n\nin a row's\ngutter, or the `Pin`\n\nfooter button) to pin the session under the cursor — it jumps\nto a yellow **★ Pinned** section at the top and stays there regardless of sort or\nfilter. Pinning works in list, group, and pane views. Pins are keyed by session\nidentity (not pid), so they survive refreshes, the session restarting, and quitting\nctop — persisted to `~/.ctop/pins.json`\n\n. Press `p`\n\nagain to unpin.\n\nMark several sessions and act on them at once. Press `Space`\n\nto mark the session\nunder the cursor, or hold `Shift`\n\nwhile pressing `↑`\n\n/`↓`\n\nto extend a range; press\n`V`\n\nfor vim-style range mode (then move to extend) and `a`\n\nto select all visible.\nWith sessions marked, `x`\n\n/ `X`\n\nclose the whole set after a confirmation prompt;\n`Esc`\n\nclears the selection. Works in list, pane, and group views.\n\nShift+click note:many terminals (Terminal.app, iTerm2, GNOME Terminal, …) reserve`Shift`\n\n+click for their own text selection and never forward it to the app, so`Shift`\n\n+click marking is best-effort. The keyboard path (`Space`\n\n/`Shift`\n\n+`↑`\n\n/`↓`\n\n/`V`\n\n) works everywhere.\n\nA self-contained [ ctop skill](/aakashadesara/ctop/blob/main/skills/ctop/SKILL.md) ships in this repo. Drop it into Claude Code so any agent learns when and how to call\n\n`ctop`\n\n:\n\n```\n# Per-project\nmkdir -p .claude/skills && cp -r skills/ctop .claude/skills/\n\n# Or user-wide\nmkdir -p ~/.claude/skills && cp -r skills/ctop ~/.claude/skills/\n```\n\nOnce installed, ask any Claude Code session things like *\"what other agents am I running\"*, *\"how much have my sessions cost\"*, *\"is my context about to compact\"* — the agent will reach for `ctop`\n\nautomatically.\n\nSkill files:\n\n— trigger sheet + common patterns`SKILL.md`\n\n— full per-command spec`reference.md`\n\n— copy-pasteable recipes`examples.md`\n\n`ctop`\n\nwith no args starts the interactive TUI. `ctop <subcommand>`\n\nruns a one-shot query and exits, so AI agents can introspect their own sessions and sister sessions from another terminal.\n\n```\nctop ls                          # Table of every running agent\nctop ls --json                   # Same, machine-parseable\nctop ls --agent claude           # Filter by backend\nctop ls --cwd ~/code/myproj      # Filter by directory\n\nctop get <pid> --json            # Full detail on one session\nctop log <pid> --tail 20         # Last 20 conversation messages\nctop search \"TODO\" --json        # Full-text search across sessions\nctop diff <pid>                  # Git diff for the session's cwd\nctop stats --json                # Aggregate cost / tokens / counts\n\nctop whoami                      # Detect which session you're in\nctop whoami --pid-only           # PID only, for scripting\nctop alerts                      # Low-context / idle / ghost warnings\nctop alerts --severity critical  # Only critical-level alerts\n\nctop kill <pid>                  # SIGTERM (must be your own user)\nctop kill <pid> --force          # SIGKILL\nctop notify \"title\" \"message\"    # Desktop notification\n```\n\n`whoami`\n\ndetects the calling session via `$CTOP_PID`\n\n→ parent-PID walk → `$PWD`\n\nmatch, with a `matchConfidence`\n\nlabel (`exact | ppid | cwd-guess | none`\n\n) so agents know how much to trust the answer.\n\nRead tools surface data that the user could read off disk anyway. `kill`\n\nenforces uid ownership and an agent-session check before sending the signal — there is no kill-all.\n\n```\n# Find sessions about to compact\nctop ls --json | jq '.[] | select(.contextPct != null and .contextPct < 20)'\n\n# Self-aware compaction (hook)\n[ \"$(ctop whoami --json | jq -r .session.contextPct)\" -lt 15 ] && \\\n  echo \"context low — consider /compact\"\n\n# Clean up ghost sessions\nctop alerts --json | jq -r '.[] | select(.kind==\"ghost\") | .pid' | \\\n  xargs -I {} ctop kill {} --force\nctop --refresh 3             # Refresh every 3 seconds\nctop --context-limit 128000  # Set context window to 128k\nctop --pane                  # Start in pane view\n{\n  \"refreshInterval\": 5000,\n  \"contextLimit\": 200000,\n  \"defaultView\": \"list\",\n  \"theme\": \"default\",\n  \"contextBarStyle\": \"block\",\n  \"notifications\": { \"enabled\": true, \"minDuration\": 30 }\n}\n```\n\nCLI flags override config file values.\n\nReads process info from `ps`\n\n(PowerShell on Windows), resolves working directories via `lsof`\n\n, and enriches each process with session metadata from local JSONL files (`~/.claude/projects/`\n\nfor Claude, `~/.codex/sessions/`\n\nfor Codex) and SQLite databases (`~/.local/share/opencode/`\n\nfor OpenCode, `~/.local/share/devin/cli/`\n\nfor Devin). No network calls, no external dependencies.\n\nExtend with custom columns. Create `.js`\n\nfiles in `~/.ctop/plugins/`\n\n:\n\n```\nmodule.exports = {\n  name: 'my-plugin',\n  column: {\n    header: 'CUSTOM',\n    width: 10,\n    getValue: (proc) => proc.cwd ? 'yes' : 'no',\n  },\n};\n```\n\nSee `examples/plugins/`\n\nfor more.\n\n**Node.js 18+****macOS, Linux, or Windows**— Windows uses PowerShell for process detection; CWD resolution is more limited than macOS/Linux.** Claude Code**,** Codex CLI**,** OpenCode**, and/or** Devin (terminal)**running sessionson PATH for OpenCode and Devin session reads (built-in on macOS; available via`sqlite3`\n\n`apt`\n\n/`brew`\n\non Linux)\n\nPRs welcome! Fork, clone, run `./claude-manager`\n\nto develop, `npm test`\n\nto test. Open an issue first for large changes.", "url": "https://wpnews.pro/news/ctop-terminal-pane-for-monitoring-ai-agents", "canonical_source": "https://github.com/aakashadesara/ctop", "published_at": "2026-07-04 14:14:35+00:00", "updated_at": "2026-07-04 14:50:10.920283+00:00", "lang": "en", "topics": ["developer-tools", "ai-agents", "ai-tools"], "entities": ["CTOP", "Claude Code", "Codex CLI", "OpenCode", "Devin", "Aakash Desai", "Homebrew", "npm"], "alternates": {"html": "https://wpnews.pro/news/ctop-terminal-pane-for-monitoring-ai-agents", "markdown": "https://wpnews.pro/news/ctop-terminal-pane-for-monitoring-ai-agents.md", "text": "https://wpnews.pro/news/ctop-terminal-pane-for-monitoring-ai-agents.txt", "jsonld": "https://wpnews.pro/news/ctop-terminal-pane-for-monitoring-ai-agents.jsonld"}}