abtop README

The project's README from github.com/graykode/abtop. As one markdown file: README.md.

abtop

Like btop, but for your AI coding agents.

See every Claude Code, Codex CLI, and OpenCode session at a glance — token usage, context window %, rate limits, child processes, open ports, and more. Claude Code, Codex CLI, and OpenCode sessions are discovered from local process/file state, so multiple active profiles are supported across macOS, Linux, and Windows.

demo

Why

All read-only. No API keys. No auth.

Install

macOS / Linux

[!IMPORTANT] On Linux, ensure sqlite3 is installed to enable monitoring for OpenCode sessions.

curl --proto '=https' --tlsv1.2 -LsSf https://github.com/graykode/abtop/releases/latest/download/abtop-installer.sh | sh

Cargo

cargo install abtop

Windows

Native support — no WSL required. Uses sysinfo for process info and host CPU/MEM metrics, and netstat -ano for listening ports. Windows has no load average, so LOAD is reported as 0. OpenCode session discovery additionally requires the sqlite3 CLI (winget install SQLite.SQLite); without it abtop prints a one-time warning to stderr.

powershell -c "irm https://github.com/graykode/abtop/releases/latest/download/abtop-installer.ps1 | iex"

Or cargo install abtop from any terminal with Git in PATH. Claude Code config is resolved automatically from %USERPROFILE%\.claude.

Other

Pre-built binaries for all platforms are available on the GitHub Releases page.

Usage

abtop                    # Launch TUI
abtop --once             # Print snapshot and exit
abtop --json             # Print one JSON snapshot and exit (for scripts/tools)
abtop --setup            # Install rate limit collection hook
abtop --theme dracula    # Launch with a specific theme
abtop --mouse            # Enable mouse click/scroll navigation

Recommended terminal size: 120x40 or larger. Minimum 80x24 — panels hide gracefully when small. Mouse capture is off by default so terminal drag selection and copy keep working. Launch with --mouse if you prefer click targets and wheel navigation.

Terminal Jump

Press Enter to focus the terminal running the selected agent. abtop supports cmux, tmux, and iTerm2 on macOS.

tmux new -s work
# pane 0: abtop
# pane 1: claude (project A)
# pane 2: claude (project B)
# → Enter on a session in abtop jumps to its pane

Supported Agents

Feature Claude Code Codex CLI OpenCode
Session Discovery ✅ ✅ ✅
Token Tracking ✅ ✅ ✅
Context Window % ✅ ✅ ❌
Status Detection ✅ ✅ ✅
Current Task ✅ ✅ ❌
Rate Limit ✅ ✅ ❌
Git Status ✅ ✅ ✅
Children / Ports ✅ ✅ ✅
Subagents ✅ ❌ ❌
Memory Status ✅ ❌ ❌

OpenCode support reads the local SQLite database at ~/.local/share/opencode/opencode.db (also the default location on Windows; %LOCALAPPDATA%\opencode and %APPDATA%\opencode are probed as fallbacks) and requires sqlite3 in PATH (on Windows: winget install SQLite.SQLite).

Themes

12 built-in themes, including 4 colorblind-friendly options (high-contrast, protanopia, deuteranopia, tritanopia). Press t to cycle at runtime, or launch with --theme <name>. Your choice is saved to ~/.config/abtop/config.toml.

btop (default) dracula catppuccin
btop dracula catppuccin
tokyo-night gruvbox nord
tokyo-night gruvbox nord

Colorblind-friendly themes:

high-contrast protanopia
high-contrast protanopia
deuteranopia tritanopia
deuteranopia tritanopia

Light themes (light — Solarized cream, white — GitHub-style pure white) for bright terminals:

light white
light white

Configuration

~/.config/abtop/config.toml supports:

theme = "btop"
# Hide specific agent CLIs from the TUI (case-insensitive).
# Useful if you only use one agent and want a cleaner view.
hidden_agents = ["codex"]
# Additional Claude Code profile roots to scan.
# abtop also auto-discovers ~/.claude and ~/.claude-* roots that contain
# both sessions/ and projects/.
claude_config_dirs = ["~/.claude-personal", "~/.claude-work-team"]
# UI language. Omit or leave empty to auto-detect from LANG.
language = "zh"

Supported Languages

Code Language
en English (default)
zh Simplified Chinese

When language is unset, abtop auto-detects from LANG — any value starting with zh switches to Simplified Chinese, otherwise English.

Key Bindings

Key Action
↑/↓ or k/j Select session
Enter Jump to session terminal
x Kill selected session
X Kill all orphan ports
t Cycle theme
1–5 Toggle panel visibility
Esc Open/close config page
q Quit
r Force refresh

Library / JSON snapshot

abtop is also a library crate, so local tools can reuse its data-collection layer in-process — no re-scanning, no subprocesses — and serialize the same state the TUI renders.

abtop --json    # one-shot JSON snapshot for scripts

For long-running consumers, build an App, refresh it with App::tick_no_summaries() (which never spawns claude --print, so it doesn't touch your Claude quota), and call App::to_snapshot(interval_ms) to get a JSON-serializable [Snapshot]:

use abtop::app::App;
use abtop::{config, theme::Theme};

let cfg = config::load_config();
let mut app = App::new_with_config_and_claude_dirs(
    Theme::default(), &cfg.hidden_agents, cfg.panels, &cfg.claude_config_dirs,
);
app.tick_no_summaries();
let json = serde_json::to_string(&app.to_snapshot(2_000)).unwrap();

App is not Send (it owns the collectors), so keep it on one thread and pass the serialized JSON elsewhere. abtop-web-ui is a reference consumer: a local-first web dashboard built on exactly this API.

Privacy

abtop reads local files and local process/open-file metadata only. No API keys, no auth. In the TUI and --once output, tool names and file paths are shown, but file contents and prompt text are never displayed. Session summaries are generated via claude --print, which makes its own API call — this is the only indirect network usage.

The JSON snapshot includes richer local dashboard data, including summary, chat_messages, working directories, config roots, tool-call previews, child process commands, token counts, and port metadata. Chat text is bounded and redacted by the collectors, but it is still derived from local transcripts and may contain sensitive project context. Treat JSON snapshots as local/private data and avoid writing them to shared logs or exposing them on a network without your own access controls.

Acknowledgements

Huge thanks to @tbouquet for driving much of abtop's recent shape — themes, config overlay and panel toggles, session filtering, subagent tree view, the context window gauge with compaction detection, plus a steady stream of fixes and security hardening along the way.

License

MIT

abtop (graykode/abtop)

Searching Database…

3.8K ·GitHub
这是什么?abtop 是一个终端仪表盘(类似 btop/htop),用于监控 AI 编程代理会话——Claude Code、Codex CLI 和 OpenCode,实时显示 token 用量、上下文窗口占比、速率限制、子进程和开放端口。
这是个监控仪表盘,还是编程代理本身?它是一个只读的终端界面监控器,不是代理本身。它从本地进程和文件状态中发现正在运行的 Claude Code、Codex CLI 和 OpenCode 会话,并把它们全部显示在一个屏幕上。
怎么安装和运行它?在 PATH 中包含 Git 的任意终端里用 'cargo install abtop' 安装,或从 GitHub Releases 页面下载适用于 macOS、Linux 和 Windows 的预编译二进制文件。
使用它需要 API 密钥或其他额外工具吗?不需要任何 API 密钥或认证。要监控 OpenCode 会话,需要安装 sqlite3 命令行工具(Windows 上通过 'winget install SQLite.SQLite' 安装);没有它,abtop 只会打印一条警告。
它对每个代理追踪的内容都一样吗?不一样,各代理的功能覆盖范围不同:上下文窗口占比、当前任务和速率限制只对 Claude Code 和 Codex CLI 显示,OpenCode 不支持;子代理树状视图和内存状态则只对 Claude Code 有效。
在 Windows 上运行需要 WSL 吗?不需要,abtop 原生支持 Windows,使用 sysinfo 获取进程和主机指标,用 netstat -ano 获取监听端口;由于 Windows 没有平均负载,LOAD 始终显示为 0。
abtop 会看到我的提示词或向网络发送东西吗?它只读取本地文件和进程/打开文件的元数据;文件内容和提示文本从不显示,只显示工具名称和文件路径。唯一的间接网络调用发生在它通过 'claude --print' 生成会话摘要时。
abtop 提供哪些主题?内置 12 款主题,包括 dracula、catppuccin、tokyo-night、gruvbox、nord、四种色盲友好变体和两款浅色主题;按 't' 键循环切换,或用 --theme 参数启动。
能从 abtop 直接跳进代理所在的终端吗?可以,按回车键会聚焦到运行所选会话的终端,在 macOS 上支持 cmux、tmux 和 iTerm2。
能基于 abtop 的数据构建自己的工具吗?可以,abtop 本身也是一个库 crate——你可以构建一个 App,通过 App::ticknosummaries() 在不消耗 Claude 配额的情况下刷新,并用 App::tosnapshot() 导出 JSON 快照;abtop-web-ui 就是这样构建的参考版网页仪表盘。
能在界面里终止卡住的会话或残留端口吗?可以,按 'x' 终止所选会话,按 'X' 终止它检测到的所有孤立端口。
What are similar projects?zoetrope, ratatui, tokscale, cost-xray, jcode, rataflow, sofka, hotpath-rs
Creator
graykode
Size
23.5 MB
Stars
3.8K
Age
6mo
Commits · 90 Days