agenttop 0.10.6 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -6,6 +6,7 @@
6
6
  [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
7
7
  [![Node.js](https://img.shields.io/node/v/agenttop.svg)](https://nodejs.org)
8
8
  [![TypeScript](https://img.shields.io/badge/TypeScript-5.8-blue.svg)](https://www.typescriptlang.org/)
9
+ [![Platform](https://img.shields.io/badge/platform-Linux%20%7C%20macOS%20%7C%20Windows-blue.svg)](#platform-support)
9
10
  [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/wrxck/agenttop/pulls)
10
11
  [![GitHub code size](https://img.shields.io/github/languages/code-size/wrxck/agenttop)](https://github.com/wrxck/agenttop)
11
12
 
@@ -20,6 +21,7 @@ Read more about [why agenttop was built](https://blog.matthesketh.pro/blog/agent
20
21
  ## Table of contents
21
22
 
22
23
  - [Install](#install)
24
+ - [Platform support](#platform-support)
23
25
  - [Usage](#usage)
24
26
  - [Token usage](#token-usage)
25
27
  - [Session nicknames](#session-nicknames)
@@ -30,7 +32,10 @@ Read more about [why agenttop was built](https://blog.matthesketh.pro/blog/agent
30
32
  - [Themes](#themes)
31
33
  - [Streaming modes](#streaming-modes)
32
34
  - [Active protection](#active-protection)
35
+ - [Session status](#session-status)
36
+ - [Pinned sessions](#pinned-sessions)
33
37
  - [Security rules](#security-rules)
38
+ - [Custom alerts](#custom-alerts)
34
39
  - [MCP server](#mcp-server)
35
40
  - [Notifications](#notifications)
36
41
  - [Alert logging](#alert-logging)
@@ -45,6 +50,8 @@ Read more about [why agenttop was built](https://blog.matthesketh.pro/blog/agent
45
50
 
46
51
  ## Install
47
52
 
53
+ ### npm (all platforms)
54
+
48
55
  ```bash
49
56
  npx agenttop
50
57
  ```
@@ -55,16 +62,74 @@ Or install globally:
55
62
  npm install -g agenttop
56
63
  ```
57
64
 
65
+ ### Homebrew (macOS / Linux)
66
+
67
+ ```bash
68
+ brew tap wrxck/tap
69
+ brew install agenttop
70
+ ```
71
+
72
+ ### Scoop (Windows)
73
+
74
+ ```powershell
75
+ scoop bucket add wrxck https://github.com/wrxck/scoop-bucket
76
+ scoop install agenttop
77
+ ```
78
+
79
+ ### Winget (Windows)
80
+
81
+ ```powershell
82
+ winget install wrxck.agenttop
83
+ ```
84
+
85
+ ### AUR (Arch Linux)
86
+
87
+ ```bash
88
+ yay -S agenttop
89
+ ```
90
+
91
+ ### Nix
92
+
93
+ ```bash
94
+ nix run github:wrxck/agenttop
95
+ ```
96
+
97
+ ### Snap
98
+
99
+ ```bash
100
+ sudo snap install agenttop --classic
101
+ ```
102
+
103
+ ## Platform support
104
+
105
+ | Platform | Status | Notes |
106
+ |----------|--------|-------|
107
+ | **Linux** (Ubuntu, Debian, Fedora, Arch, etc.) | Fully supported | Primary development platform |
108
+ | **macOS** (Intel + Apple Silicon) | Fully supported | Uses `lsof` for process CWD resolution |
109
+ | **Windows** (10/11 + Windows Terminal) | Supported | Uses PowerShell for process discovery; `--all-users` not available |
110
+
111
+ Development and primary testing is done on Ubuntu. If you encounter issues on other platforms, please [open an issue](https://github.com/wrxck/agenttop/issues) or feel free to contribute a fix.
112
+
113
+ CI runs on all three platforms (Ubuntu, macOS, Windows) across Node.js 18, 20, and 22.
114
+
115
+ ### Platform-specific config paths
116
+
117
+ | Platform | Config path |
118
+ |----------|-------------|
119
+ | Linux | `~/.config/agenttop/config.json` (respects `XDG_CONFIG_HOME`) |
120
+ | macOS | `~/.config/agenttop/config.json` (respects `XDG_CONFIG_HOME`) |
121
+ | Windows | `%APPDATA%\agenttop\config.json` |
122
+
58
123
  ## Usage
59
124
 
60
125
  Run `agenttop` in one terminal while running Claude Code sessions in other tabs.
61
126
 
62
127
  ```
63
- -- agenttop v0.6.0 ---- 3 sessions ---- 14:32:08 ---------------------
128
+ -- agenttop v0.10.7 --- 3 sessions ---- 14:32:08 ---------------------
64
129
  | SESSIONS | ACTIVITY (cuddly-wiggling-sundae) |
65
130
  | | |
66
- | > cuddly-wiggling-sundae | 14:32:05 Bash ls /tmp/claude-0/ |
67
- | /home/matt | opus | 14:32:03 Read /root/.claude/CLAUDE.md |
131
+ | > cuddly-wiggling-sundae | 14:32:05 Bash ls -la |
132
+ | /home/matt | opus | 14:32:03 Read CLAUDE.md |
68
133
  | CPU 20% | 542MB | 3 ag | 14:31:58 Grep pattern="sessionId" |
69
134
  | 1.2k in | 340 out | 14:31:55 Write /home/matt/app/src/... |
70
135
  | | 14:31:52 Bash npm test |
@@ -82,7 +147,7 @@ Run `agenttop` in one terminal while running Claude Code sessions in other tabs.
82
147
  ```
83
148
  agenttop [options]
84
149
 
85
- --all-users Monitor all users (root only)
150
+ --all-users Monitor all users (root only, Linux/macOS)
86
151
  --no-security Disable security analysis
87
152
  --json Stream events as JSON lines (no TUI)
88
153
  --plain Stream events as plain text (no TUI)
@@ -118,7 +183,7 @@ Press `n` on a selected session to assign a nickname. The nickname replaces the
118
183
 
119
184
  Press `N` to clear a nickname.
120
185
 
121
- Nicknames are stored in `~/.config/agenttop/config.json`.
186
+ Nicknames are stored in your [config file](#configuration).
122
187
 
123
188
  ## Session filtering
124
189
 
@@ -147,6 +212,30 @@ Press `d` to delete a session. A confirmation prompt appears. On confirm, the se
147
212
 
148
213
  Sessions with a running process are shown in green. Inactive sessions (no process) are shown in red.
149
214
 
215
+ ## Session status
216
+
217
+ agenttop detects four session states:
218
+
219
+ | Status | Indicator | Meaning |
220
+ |--------|-----------|---------|
221
+ | Waiting | Yellow ● `[waiting]` | Claude has asked a question and is waiting for your input |
222
+ | Stale | Orange ● `[stale]` | Process is running but no output for the configured timeout |
223
+ | Active | Green ● | Actively processing |
224
+ | Inactive | Grey ○ | Process has ended |
225
+
226
+ Sessions sort by status priority: waiting > stale > active > inactive, then by last activity within each group.
227
+
228
+ The stale timeout (default 60s) can be adjusted in the Alert Rules menu (`r`).
229
+
230
+ ## Pinned sessions
231
+
232
+ Press `p` to pin a session to the top of the list. Pinned sessions always appear above non-pinned sessions, regardless of status.
233
+
234
+ - `p` — toggle pin on selected session
235
+ - `P` — move pinned session up in pin order
236
+
237
+ Pinned sessions show a `*` marker next to the status dot. Pin order persists across restarts.
238
+
150
239
  ## Session detail view
151
240
 
152
241
  Press `Enter` on a session to open the detail view, which shows:
@@ -174,9 +263,9 @@ Press `x` again to exit split mode and return to the single-panel layout.
174
263
 
175
264
  ## Themes
176
265
 
177
- agenttop ships with 15 built-in colour themes and a full theme management system. Open Settings (`s`) and select **Manage themes...** to access the theme menu.
266
+ agenttop ships with 27 built-in colour themes and a full theme management system. Open Settings (`s`) and select **Manage themes...** to access the theme menu.
178
267
 
179
- Built-in themes: One Dark (default), Dracula, Monokai Pro, Solarized Dark, Solarized Light, Nord, Gruvbox Dark, Tokyo Night, Catppuccin Mocha, Catppuccin Latte, Rose Pine, Rose Pine Moon, Pastel Dark, Kanagawa, and Everforest.
268
+ Built-in themes: One Dark (default), Dracula, Monokai Pro, Solarized Dark, Solarized Light, Nord, Gruvbox Dark, Tokyo Night, Catppuccin Mocha, Catppuccin Latte, Rose Pine, Rose Pine Moon, Pastel Dark, Kanagawa, Everforest, Hi Feline, Plumber Bros, Hedgehog Speed, Block Craft, Galaxy Conflicts, Pocket Creatures, Brick Wizard, Caped Knight, Web Crawler, Frozen Kingdom, Coral Reef, and Toy Ranch.
180
269
 
181
270
  In the theme menu:
182
271
 
@@ -188,7 +277,7 @@ In the theme menu:
188
277
  - **Delete** — press `d` to delete a custom theme
189
278
  - **Restore default** — press `Backspace` to reset to One Dark
190
279
 
191
- Custom themes are saved to `~/.config/agenttop/config.json` and persist across sessions.
280
+ Custom themes are saved to your [config file](#configuration) and persist across sessions.
192
281
 
193
282
  ## Streaming modes
194
283
 
@@ -217,7 +306,7 @@ agenttop --plain > session.log
217
306
  Output format:
218
307
  ```
219
308
  SESSION cuddly-wiggling-sundae | opus | /home/matt | CPU 20% | 542MB | 1.2k in / 340 out
220
- 14:32:05 cuddly-wiggling-sundae Bash ls /tmp/claude-0/
309
+ 14:32:05 cuddly-wiggling-sundae Bash ls -la
221
310
  ALERT 14:32:10 [warn] cuddly-wiggling-sundae: curl to external URL
222
311
  USAGE abc123 +100 in / +50 out
223
312
  ```
@@ -258,6 +347,38 @@ Individual rules can be disabled in the config file under `security.rules`.
258
347
 
259
348
  Alerts are deduplicated within a 30-second window.
260
349
 
350
+ ## Custom alerts
351
+
352
+ Define custom alert rules with regex patterns to match against tool activity.
353
+
354
+ Press `r` to open the Alert Rules menu where you can:
355
+
356
+ - Toggle built-in security rules on/off
357
+ - Add custom rules with regex patterns
358
+ - Choose what to match: tool input, output, tool name, or all
359
+ - Set severity level per rule
360
+ - Adjust the stale session timeout
361
+
362
+ Custom rules can also be defined in your config file:
363
+
364
+ ```json
365
+ {
366
+ "alerts": {
367
+ "staleTimeout": 60,
368
+ "custom": [
369
+ {
370
+ "name": "dangerous-rm",
371
+ "pattern": "rm\\s+-rf\\s+/",
372
+ "match": "input",
373
+ "severity": "high",
374
+ "message": "Dangerous recursive delete detected",
375
+ "enabled": true
376
+ }
377
+ ]
378
+ }
379
+ }
380
+ ```
381
+
261
382
  ## MCP server
262
383
 
263
384
  agenttop can run as an MCP server, letting Claude Code query session status, alerts, and usage directly:
@@ -275,6 +396,15 @@ Available tools:
275
396
  | `agenttop_alerts` | Get recent security alerts (filterable by severity) |
276
397
  | `agenttop_usage` | Get token usage for a session or all sessions |
277
398
  | `agenttop_activity` | Get recent tool calls for a session |
399
+ | `agenttop_waiting_sessions` | List sessions in waiting or stale state |
400
+ | `agenttop_session_status` | Get status for a specific session |
401
+ | `agenttop_custom_alerts` | List configured custom alert rules |
402
+ | `agenttop_set_custom_alert` | Add or update a custom alert rule |
403
+ | `agenttop_delete_custom_alert` | Delete a custom alert rule |
404
+ | `agenttop_alert_history` | Get recent alerts with severity filter |
405
+ | `agenttop_set_stale_timeout` | Set the stale timeout |
406
+ | `agenttop_pin_session` | Pin a session to the top |
407
+ | `agenttop_unpin_session` | Unpin a session |
278
408
 
279
409
  You can also run the MCP server directly via `agenttop-mcp` (installed as a separate bin).
280
410
 
@@ -283,15 +413,15 @@ You can also run the MCP server directly via `agenttop-mcp` (installed as a sepa
283
413
  When security alerts are raised:
284
414
 
285
415
  - **Terminal bell** — `\x07` on high/critical alerts (configurable)
286
- - **Desktop notification** — via `notify-send` (linux) or `osascript` (macOS) for critical alerts
416
+ - **Desktop notification** — via `notify-send` (Linux), `osascript` (macOS), or PowerShell toast (Windows)
287
417
 
288
418
  Rate-limited to max 1 desktop notification per 30 seconds.
289
419
 
290
- Configure in `config.json` under `notifications`, or disable entirely with `--no-notify`.
420
+ Configure in your [config file](#configuration) under `notifications`, or disable entirely with `--no-notify`.
291
421
 
292
422
  ## Alert logging
293
423
 
294
- Alerts are logged to `~/.config/agenttop/alerts.jsonl` by default. One JSON line per alert.
424
+ Alerts are logged to `alerts.jsonl` in your [config directory](#platform-specific-config-paths) by default. One JSON line per alert.
295
425
 
296
426
  The log file rotates when it exceeds 10MB (keeps 2 rotated files).
297
427
 
@@ -309,7 +439,7 @@ Disable with `--no-updates` or set `updates.checkOnLaunch: false` in config.
309
439
 
310
440
  ## Configuration
311
441
 
312
- Config file at `~/.config/agenttop/config.json` (respects `XDG_CONFIG_HOME`):
442
+ Config file location depends on your platform — see [platform-specific config paths](#platform-specific-config-paths).
313
443
 
314
444
  ```json
315
445
  {
@@ -324,7 +454,9 @@ Config file at `~/.config/agenttop/config.json` (respects `XDG_CONFIG_HOME`):
324
454
  },
325
455
  "alerts": {
326
456
  "logFile": "~/.config/agenttop/alerts.jsonl",
327
- "enabled": true
457
+ "enabled": true,
458
+ "staleTimeout": 60,
459
+ "custom": []
328
460
  },
329
461
  "updates": {
330
462
  "checkOnLaunch": true,
@@ -351,13 +483,17 @@ Config file at `~/.config/agenttop/config.json` (respects `XDG_CONFIG_HOME`):
351
483
  "pinLeft": "1",
352
484
  "pinRight": "2",
353
485
  "swapPanels": "S",
354
- "closePanel": "X"
486
+ "closePanel": "X",
487
+ "alertRules": "r",
488
+ "pin": "p",
489
+ "pinUp": "P"
355
490
  },
356
491
  "theme": "one-dark",
357
492
  "customThemes": {},
358
493
  "nicknames": {},
359
494
  "archived": {},
360
495
  "archiveExpiryDays": 0,
496
+ "pinnedSessions": [],
361
497
  "security": {
362
498
  "enabled": true,
363
499
  "rules": {
@@ -400,18 +536,21 @@ Default keybindings:
400
536
  | `1` / `2` | Pin session to left / right panel (split mode) |
401
537
  | `S` | Swap left and right panels (split mode) |
402
538
  | `X` | Close focused panel (split mode) |
539
+ | `r` | Open alert rules menu |
540
+ | `p` | Toggle pin on selected session |
541
+ | `P` | Move pinned session up |
403
542
  | `q` | Quit |
404
543
 
405
544
  ## How it works
406
545
 
407
- agenttop reads Claude Code's task output files from `/tmp/claude-<uid>/` using inotify-based file watching via [chokidar](https://github.com/paulmillr/chokidar). Each session writes JSONL events containing tool calls, tool results, and token usage, which agenttop parses and displays in real-time.
546
+ agenttop reads Claude Code's session output files using cross-platform file watching via [chokidar](https://github.com/paulmillr/chokidar) (inotify on Linux, FSEvents on macOS, ReadDirectoryChangesW on Windows). Each session writes JSONL events containing tool calls, tool results, and token usage, which agenttop parses and displays in real-time.
408
547
 
409
- Three runtime dependencies: [ink](https://github.com/vadimdemedes/ink) (React-based TUI), chokidar (file watching), and [@modelcontextprotocol/sdk](https://github.com/modelcontextprotocol/typescript-sdk) (MCP server). Everything else is Node built-ins.
548
+ Four runtime dependencies: [ink](https://github.com/vadimdemedes/ink) and [react](https://react.dev/) (React-based TUI), [chokidar](https://github.com/paulmillr/chokidar) (file watching), and [@modelcontextprotocol/sdk](https://github.com/modelcontextprotocol/typescript-sdk) (MCP server). Everything else is Node built-ins.
410
549
 
411
550
  ## Multi-user support
412
551
 
413
552
  - **Non-root** — monitors your own sessions only
414
- - **Root** — use `--all-users` to monitor all users' sessions on the machine
553
+ - **Root** — use `--all-users` to monitor all users' sessions on the machine (Linux/macOS only)
415
554
 
416
555
  ## Contributing
417
556
 
@@ -421,8 +560,7 @@ Ideas for contributions:
421
560
 
422
561
  - Support for additional agent platforms beyond Claude Code
423
562
  - New security rules
424
- - Themes and colour customisation
425
- - Windows support
563
+ - Platform-specific improvements
426
564
 
427
565
  ## Trademark notice
428
566