ilkayGkbdk/cctop

ilkayGkbdk/cctop

cctop 是一個 htop 風格的 Claude Code mod,即時顯示 context window 使用量、5 小時和每週的 rate-limit window、token 即時速度、工作階段成本,以及每一個正在執行的 subagent。它以外掛目錄的形式安裝,提供 /cctop 面板和提示列上方的精簡工具帶,可設定 context 和 rate 警告,也能停止 subagent 和中止工作階段。
請先查看作者 README,確認 marketplace 與外掛名稱;指令可能隨儲存庫結構而變動。
claude plugin marketplace add ilkayGkbdk/cctop claude plugin install cctop
htop for Claude Code — see your context, rate limits and subagents live.

cctop 0.1 · opus-5-5 · ~/proj/api · up 42:17 ● streaming
CTX [|||||||||||||||||||||||||||| ] 112k/200k 56% compact @ 80%
5H [|||||||||| ] 27% resets 2h14m
WEEK [|||||||||||||||| ] 41% resets Thu
SPD [||||||||||||||||||||| ] 84 tok/s
$3.42 ▁▂▂▃▅▇▆▃▂▁▂▄▆█▅ last turn $0.31 · cache 91%
ID AGENT STATE TIME TOKENS TOOLS NOW
▶ main claude run 12:04 84.1k 37 Edit src/auth/AuthService.cs
a1 Explore run 0:41 12.7k 9 Grep "JwtOptions"
a2 code-reviewer wait 1:12 8.3k 4 Read tests/AuthTests.cs
cctop is a Claude Code mod: it runs inside Claude Code and reads the engine's own numbers (the /context breakdown, rate-limit windows, subagent ids, the live token stream). Nothing leaves your machine and nothing is written to disk.
Requires a Claude Code build with function-hooks mods (built and tested on 2.1.287).
git clone https://github.com/ilkayGkbdk/cctop ~/.claude/cctop
claude --plugin-dir ~/.claude/cctop
To load it in every session, add it to the env block of ~/.claude/settings.json:
{ "env": { "CLAUDE_CODE_PLUGIN_DIRS": "~/.claude/cctop" } }
| | |
| --- | --- |
| /cctop | open the panel (docked beside the transcript in fullscreen, above the prompt otherwise) |
| /cctop band | hide / show the one-line band above the prompt |

The band, while the panel is closed:
cctop CTX 56% ████░░░░ 5H 27% WK 41% 84 tok/s $3.42 ⑂ 3 agents
Keys in the panel:
| Key | Action |
| --- | --- |
| Tab / click | select an agent row; again to expand its last 20 tool calls |
| s | sort: start → tokens → time |
| x | stop the selected subagent (asks y/n) |
| a | abort the current turn (asks y/n) |
| c | run /compact (when no turn is running) |
| q / Esc | close |
Set with /config (or pluginConfigs.cctop.options in settings):
| Option | Default | |
| --- | --- | --- |
| band | true | show the band above the prompt |
| ctxWarnPercent | 80 | context toast, and where the bar turns red |
| rateWarnPercent | 90 | 5-hour window toast |
| mapPollMs | 2000 | context map refresh while the panel is open |
| Engine event | cctop uses it for |
| --- | --- |
| session.measure | context fill, rate-limit windows, session cost (push, only on change) |
| turn.start / turn.complete | turn id for abort, per-turn cost sparkline, cache share |
| turn.step (stream) | live tok/s, ● streaming, per-agent context size |
| agent.spawn | a new row per subagent |
| tool.call | each agent's current activity and history; denies a stopped subagent's calls |
| $.session.usage({ breakdown: 'summary' }) | the context map, only while the panel is open (local estimate, no API request) |
Every hook passes the event through unchanged — except tool calls of a subagent you stopped.
a aborts the whole turn.See CONTRIBUTING.md. Good first issues: themes, a file-radar tab.
MIT