@mkhuda/agent-ps 0.4.0 → 0.5.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/CHANGELOG.md +15 -0
- package/README.md +37 -55
- package/agent-ps +0 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.5.0
|
|
4
|
+
|
|
5
|
+
The token counts four agents were already writing.
|
|
6
|
+
|
|
7
|
+
- Token counts for Claude Code, Codex, Pi and CommandCode, which all record
|
|
8
|
+
what a turn spent and were simply never read. Seven of the eight agents now
|
|
9
|
+
report what a session cost.
|
|
10
|
+
- The counts are summed over a whole log, which is the one thing here that
|
|
11
|
+
reads a file end to end, so it happens only for the session whose detail
|
|
12
|
+
panel is open. Logs are append only, so a session that grew costs the bytes
|
|
13
|
+
it just wrote rather than all of it again.
|
|
14
|
+
- `agent-ps list` now says when `ps` or `lsof` failed even where the table came
|
|
15
|
+
back with rows, rather than only when it came back empty.
|
|
16
|
+
- The tests run in CI, across every supported interpreter.
|
|
17
|
+
|
|
3
18
|
## 0.4.0
|
|
4
19
|
|
|
5
20
|
Antigravity, and a legend that was lying about one of the colours.
|
package/README.md
CHANGED
|
@@ -28,7 +28,7 @@ curl -fsSL https://raw.githubusercontent.com/mkhuda/agent-ps/main/install.sh | s
|
|
|
28
28
|
`ps aux | grep claude` gives you PIDs. It will not tell you which one is the
|
|
29
29
|
session you are talking to, what model it is spending on, whether it has been
|
|
30
30
|
idle for three days, or which rows are background daemons that outlived the
|
|
31
|
-
terminal that started them. It also misses the other
|
|
31
|
+
terminal that started them. It also misses the other seven agents entirely.
|
|
32
32
|
|
|
33
33
|
agent-ps lists every session with its agent, model, working directory, uptime,
|
|
34
34
|
idle time and disk footprint, then stops one process tree, every background
|
|
@@ -68,8 +68,7 @@ pnpm dlx @mkhuda/agent-ps
|
|
|
68
68
|
bunx @mkhuda/agent-ps
|
|
69
69
|
```
|
|
70
70
|
|
|
71
|
-
|
|
72
|
-
one. Either way the command it gives you is `agent-ps`.
|
|
71
|
+
Either way the command it gives you is `agent-ps`.
|
|
73
72
|
|
|
74
73
|
### Just the file
|
|
75
74
|
|
|
@@ -98,7 +97,7 @@ looking at.
|
|
|
98
97
|
|
|
99
98
|
### What it needs, and how to remove it
|
|
100
99
|
|
|
101
|
-
Python 3.8 or later and nothing from PyPI. Tested on 3.8, 3.9, 3.
|
|
100
|
+
Python 3.8 or later and nothing from PyPI. Tested on 3.8, 3.9, 3.12 and 3.13.
|
|
102
101
|
macOS and Linux; Windows is out because `curses` is not in its standard library.
|
|
103
102
|
It shells out to `ps`, and on macOS to `lsof`, which is how a process is matched
|
|
104
103
|
to a session everywhere except Claude Code.
|
|
@@ -115,31 +114,23 @@ agent-ps only ever reads the agents' own files.
|
|
|
115
114
|
Each agent keeps its own colour in the table, and the same colours label the
|
|
116
115
|
legend above the keys.
|
|
117
116
|
|
|
118
|
-
| Agent | | Sessions in | Paired by |
|
|
119
|
-
|
|
120
|
-
| [Claude Code](https://claude.com/claude-code) |  | JSONL | the agent itself |
|
|
121
|
-
| [Pi](https://pi.dev) |  | JSONL | directory |
|
|
122
|
-
| CommandCode |  | JSONL | directory |
|
|
123
|
-
| [Codex CLI](https://github.com/openai/codex) |  | JSONL | directory |
|
|
124
|
-
| [OpenCode](https://github.com/sst/opencode) |  | SQLite | directory |
|
|
125
|
-
| Hermes |  | SQLite | directory |
|
|
126
|
-
| GitHub Copilot |  | VS Code storage | no process |
|
|
127
|
-
| Antigravity |  | SQLite per conversation | directory |
|
|
128
|
-
|
|
129
|
-
Only Claude Code records which process is running which session
|
|
130
|
-
pairing is matched on working directory and shown as a guess.
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
showing are inside protobuf blobs rather than columns, so they are read out one
|
|
136
|
-
at a time. Its steps carry the same status whether a turn is running or has
|
|
137
|
-
finished, so it is the one agent whose busy and idle cannot be told apart.
|
|
138
|
-
|
|
139
|
-
Copilot is the exception to everything. It runs inside the VS Code extension
|
|
140
|
-
host, so it has no process of its own: no PID, no uptime, no CPU or memory, and
|
|
141
|
-
nothing to stop. What it does have is the credits each turn spent, which the free
|
|
142
|
-
tier meters and nothing else surfaces. A chat counts as open while its workspace
|
|
117
|
+
| Agent | | Sessions in | Paired by | Reopened with |
|
|
118
|
+
|---|---|---|---|---|
|
|
119
|
+
| [Claude Code](https://claude.com/claude-code) |  | JSONL | the agent itself | `claude --resume` |
|
|
120
|
+
| [Pi](https://pi.dev) |  | JSONL | directory | `pi --session` |
|
|
121
|
+
| CommandCode |  | JSONL | directory | `cmd --resume` |
|
|
122
|
+
| [Codex CLI](https://github.com/openai/codex) |  | JSONL | directory | `codex resume` |
|
|
123
|
+
| [OpenCode](https://github.com/sst/opencode) |  | SQLite | directory | `opencode --session` |
|
|
124
|
+
| Hermes |  | SQLite | directory | `hermes --resume` |
|
|
125
|
+
| GitHub Copilot |  | VS Code storage | no process | in the editor |
|
|
126
|
+
| Antigravity |  | SQLite per conversation | directory | `agy --conversation` |
|
|
127
|
+
|
|
128
|
+
Only Claude Code records which process is running which session. Every other
|
|
129
|
+
pairing is matched on working directory and shown as a guess. Tokens and cost
|
|
130
|
+
appear in the detail panel.
|
|
131
|
+
|
|
132
|
+
Copilot is the exception: it runs inside the VS Code extension host, so it has no
|
|
133
|
+
process of its own and nothing to stop. A chat counts as open while its workspace
|
|
143
134
|
is open in the editor.
|
|
144
135
|
|
|
145
136
|
## Usage
|
|
@@ -176,9 +167,8 @@ screen in its own colour and, on the right, what the table is sorted by:
|
|
|
176
167
|
|
|
177
168
|

|
|
178
169
|
|
|
179
|
-
That middle line
|
|
180
|
-
|
|
181
|
-
and it is where a note appears for a few seconds after you act on something.
|
|
170
|
+
That middle line is the key to the colours, names the sort order in words, and
|
|
171
|
+
is where a note appears for a few seconds after you act on something.
|
|
182
172
|
|
|
183
173
|
Backspacing a filter down to nothing leaves filter mode, so the key bar comes
|
|
184
174
|
back without reaching for escape.
|
|
@@ -209,20 +199,17 @@ ended sessions, then `s` until DISK is marked.
|
|
|
209
199
|
|
|
210
200
|
### The detail panel
|
|
211
201
|
|
|
212
|
-
Enter on a live session opens everything known about it,
|
|
213
|
-
the
|
|
214
|
-
|
|
215
|
-
question.
|
|
202
|
+
Enter on a live session opens everything known about it, in four groups: what
|
|
203
|
+
the session is, what it is doing to the machine, what it has cost, and the
|
|
204
|
+
command line.
|
|
216
205
|
|
|
217
206
|
<img src="https://raw.githubusercontent.com/mkhuda/agent-ps/main/images/agent-ps-detail.jpg" width="620"
|
|
218
207
|
alt="The detail panel for a Claude Code session, in four groups. Session: agent, id, status, model, title and directory. Process: pid with its parent, uptime, and time since the last turn. Usage: cpu, memory, and a 41M disk total broken into 28M of transcript, 11M of subagent logs and 2M of file history. Command: the command line that started it.">
|
|
219
208
|
|
|
220
|
-
The disk total is broken down
|
|
221
|
-
|
|
222
|
-
different answers, and until you can see which it is there is nothing to decide.
|
|
209
|
+
The disk total is broken down by what is holding it, since transcript and file
|
|
210
|
+
history call for different answers.
|
|
223
211
|
|
|
224
|
-
|
|
225
|
-
cost, Copilot reports the credits a turn spent:
|
|
212
|
+
Tokens and cost are here too, and Copilot reports the credits a turn spent:
|
|
226
213
|
|
|
227
214
|
```
|
|
228
215
|
provider opencode-free
|
|
@@ -236,14 +223,13 @@ directory rather than reported, so you know before pressing `k` that the pairing
|
|
|
236
223
|
is a guess.
|
|
237
224
|
|
|
238
225
|
Enter on an ended session reopens it in a new terminal tab instead. Copilot
|
|
239
|
-
chats
|
|
226
|
+
chats reopen in the editor.
|
|
240
227
|
|
|
241
228
|
### The advisory line
|
|
242
229
|
|
|
243
230
|
A line above the keys points out whatever is worth a look: background helpers
|
|
244
231
|
left running, sessions untouched for a day, or ended sessions you could resume.
|
|
245
|
-
It names the key that acts on it, and
|
|
246
|
-
warnings teaches people to ignore the line.
|
|
232
|
+
It names the key that acts on it, and shows one thing at a time.
|
|
247
233
|
|
|
248
234
|
## Scripting
|
|
249
235
|
|
|
@@ -281,18 +267,14 @@ the table and exits.
|
|
|
281
267
|
| CPU, MEM | the same `ps` call |
|
|
282
268
|
| DISK | everything that session left on disk |
|
|
283
269
|
| DIR | the working directory |
|
|
284
|
-
| TITLE | the session title, or its opening prompt
|
|
270
|
+
| TITLE | the session title, or its opening prompt |
|
|
285
271
|
|
|
286
|
-
UPTIME and ACTIVE often disagree
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
so an ended session shows a dash under UPTIME and only ACTIVE says how stale it
|
|
290
|
-
is.
|
|
272
|
+
UPTIME and ACTIVE often disagree: a process can be five days old and have
|
|
273
|
+
answered a minute ago. UPTIME comes from the process table, ACTIVE from the log,
|
|
274
|
+
which is appended on every turn.
|
|
291
275
|
|
|
292
|
-
Each agent
|
|
293
|
-
|
|
294
|
-
palette. A selected row keeps its own highlight rather than being broken up, so
|
|
295
|
-
the cursor stays unmistakable. Terminals without colour fall back to plain text.
|
|
276
|
+
Each agent has its own colour, and the legend above the keys is the key to it.
|
|
277
|
+
Terminals without colour fall back to plain text.
|
|
296
278
|
|
|
297
279
|
## A PID marked with a question mark
|
|
298
280
|
|
|
@@ -366,7 +348,7 @@ install fetches. The build is reproducible: the same source always produces the
|
|
|
366
348
|
same bytes, so the committed executable can be checked against the tree.
|
|
367
349
|
|
|
368
350
|
```
|
|
369
|
-
|
|
351
|
+
d46f6f55086b25c4efab962d2945e70c2c486aa62931cf6e532cec2c16174496 agent-ps
|
|
370
352
|
```
|
|
371
353
|
|
|
372
354
|
Adding an agent takes one class and one line in the registry. See
|
package/agent-ps
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mkhuda/agent-ps",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "A process table for coding agent sessions. Claude Code, Codex, OpenCode, Hermes, Pi, CommandCode and Copilot in one view, with models, idle time, disk use and one key to stop them.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cli",
|