wrkpanel 0.0.0-stage → 0.3.1

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 ADDED
@@ -0,0 +1,62 @@
1
+ # Changelog
2
+
3
+ ## 0.3.1 — 2026-12-06
4
+
5
+ - **▶ Start** in the Task dialog starts the session without opening a new tab, like a draft's ▶ Start.
6
+ The session's card shows first in the project; click it to open the session.
7
+ - Long project and session paths keep their leading `~/` at the start when they're cut short with an ellipsis.
8
+
9
+ ## 0.3.0 — 2026-12-05
10
+
11
+ - **Try it with `npx wrkpanel`**, or keep it with `npm install -g wrkpanel` and run `wrkpanel`. No clone or
12
+ build, and on macOS no compiler (node-pty ships prebuilt). `wrkpanel --port <n>` and `--no-open`;
13
+ `--help` lists them. An old Node gets a clear message instead of a `node:sqlite` error.
14
+ - Sessions get `--settings` from a copy of `claude-hooks.json` in `~/.config/wrkpanel/claude-settings/`
15
+ also without a Claude theme, so clearing npm's cache never takes the hooks away from running sessions.
16
+ - **Sessions and todos are now one thing: a Task.** **+ Task** replaces both **+ Todo** and
17
+ **+ New session**. Its dialog's main button **▶ Start** (Enter) saves the task and starts a session
18
+ with it as Claude's first message, opening it in a new tab. **Save Draft** parks it as a draft card to
19
+ start later. Every session now starts from a task; a title alone is sent as the first message.
20
+ - **Continue last conversation in this folder** (`claude --continue`) moved into the Task dialog. It
21
+ applies to that start only.
22
+ - Todo types are now **Task types**. Cards, ⓘ, the project page ("Drafts · N") and messages say task
23
+ or draft instead of todo. The API, code and database keep the old names.
24
+ - `POST /api/sessions` (start a session without a task) is gone; `POST /api/todos/<id>/start` takes
25
+ `continue`.
26
+
27
+ ## 0.2.0 — 2026-12-02
28
+
29
+ - **The default port is now 8855** (was 7777). Open http://localhost:8855, or keep the old port with
30
+ `WRKPANEL_PORT=7777 npm start`.
31
+ - Appearance (◐ on the list page and in the terminal bar): terminal color presets that follow the
32
+ system's dark or light setting (wrkpanel Dark and Light, Warm Graphite, Solarized Dark and Light),
33
+ font size and cursor style, previewed live. New sessions start Claude Code with a theme that matches
34
+ the terminal, or with its ANSI theme, or with your own /theme.
35
+ - The terminal follows your system's light or dark setting by default. Before, it was always dark.
36
+ - View an ended session: its name on the project page opens what was said, read from Claude's transcript,
37
+ without starting anything. **Resume** (on the row or in the view) starts it again with
38
+ `claude --resume`, as the same card.
39
+ - Recurring todos: tick **Recurring** in the todo dialog and **▶ Start** leaves the todo in place (↻ on
40
+ its card), so it can start more sessions.
41
+ - New installs make Goal (plan, review, push) the default todo type instead of Goal (fire and forget).
42
+ Existing databases keep their current default.
43
+ - Session cards: a terminal icon with ×N shows how many terminals have the session open (wrkpanel tabs
44
+ and real terminals alike), instead of "open elsewhere". The status pill no longer shows how long; its
45
+ tooltip does. Pills don't wrap inside.
46
+
47
+ ## 0.1.0 — 2026-11-28
48
+
49
+ First public release.
50
+
51
+ - Sessions grouped by project; start one in any project folder, rename it or terminate it
52
+ - Each session opens as a full terminal in a browser tab (xterm.js); sessions keep running in tmux
53
+ - Status badges: working, waiting for you, needs approval, has a question
54
+ - Todos: park a session for later and start it with one click; todo types with prebuilt instructions
55
+ - Project page with running and ended sessions (terminated, exited, gone)
56
+ - Artifact links per session and per project, read from Claude's transcripts
57
+ - Plan usage meter: week and session limits as batteries
58
+ - Drag-and-drop card order
59
+ - Session records and all data in one SQLite file, `~/.config/wrkpanel/wrkpanel.db`
60
+ - Listens on 127.0.0.1 only, with Host and Origin checks
61
+
62
+ Tested on macOS with Claude Code 2.1.332, tmux 3.8 and Node 22. Linux is experimental.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Sanjay Vamja
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,321 @@
1
- # Temporary Holding Version
1
+ # wrkpanel
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ **Running five Claude Code sessions? See which one is waiting on you, from one quiet browser tab.**
4
+
5
+ wrkpanel puts every Claude Code session on your machine on one clean page: a card each, grouped by
6
+ project, with a badge that says **working**, **waiting for you** or **needs approval**. Click a card and
7
+ you're in that session's terminal. Answer, approve, close the tab. Sessions live in tmux, so closing the
8
+ tab or restarting wrkpanel never stops Claude.
9
+
10
+ <img width="1280" height="720" alt="wrkpanel demo" src="https://github.com/user-attachments/assets/2b059407-b760-4a43-a893-55d482e188dd" />
11
+
12
+ ```sh
13
+ npx wrkpanel # starts on http://localhost:8855 and opens the browser
14
+ ```
15
+
16
+ Needs Node.js 22.13+, tmux 3.2+ and the `claude` CLI ([Requirements](#requirements)). To keep it installed,
17
+ `npm install -g wrkpanel` and then run `wrkpanel`. `wrkpanel --help` lists the flags (`--port`, `--no-open`).
18
+ Ctrl+C stops the panel; your sessions keep running in tmux.
19
+
20
+ From source, to work on it:
21
+
22
+ ```sh
23
+ git clone https://github.com/svamja/wrkpanel && cd wrkpanel
24
+ npm install
25
+ npm start # builds, starts on http://localhost:8855 and opens the browser
26
+ ```
27
+
28
+ ```
29
+ browser (xterm.js) ──WebSocket──▶ wrkpanel server (Node) ──node-pty──▶ tmux attach ──▶ tmux -L wrkpanel ──▶ claude
30
+ ```
31
+
32
+ No login: it listens on `127.0.0.1:8855` only. Read [Trust model](#trust-model) before you change that.
33
+
34
+ wrkpanel is an independent project, not made by or affiliated with Anthropic.
35
+
36
+ ## How is it different?
37
+
38
+ Tools like [claude-squad](https://github.com/smtg-ai/claude-squad), [Crystal](https://github.com/stravu/crystal) (now Nimbalyst),
39
+ [Conductor](https://conductor.build) and [vibe-kanban](https://github.com/BloopAI/vibe-kanban) are built
40
+ around git worktrees: each task gets its own branch and checkout, with diffs and merging built in. That's
41
+ the right call when many agents edit the same repo. wrkpanel does less, on purpose:
42
+
43
+ - **A clean, quiet page.** Cards grouped by project, one status badge each. No board columns, diff panes
44
+ or git panel. Details (the task, artifacts, ended sessions) sit one click away, not on screen.
45
+ - **Claude Code's own terminal.** A card opens the real `claude` TUI in a browser tab: slash commands,
46
+ permission prompts and your status line work as they always do. There's no new chat UI to learn.
47
+ - **Your folders, your git.** A session starts in the folder you pick. wrkpanel never makes branches or
48
+ worktrees. If you want one, create it and add it as a project.
49
+ - **Sessions outlive the panel.** tmux holds them: close the tab, restart wrkpanel, or
50
+ `tmux -L wrkpanel attach` from any terminal.
51
+ - **Local and light.** One Node process on `127.0.0.1`: no account, no desktop app, nothing sent anywhere.
52
+ - **Made for Claude Code only**, which lets it use Claude's hooks, transcripts and status line for status
53
+ badges, plan-usage batteries, task types (plan or auto mode) and artifact links.
54
+
55
+ If you want a worktree per task with diff review built in, or to run Codex or other agents next to Claude,
56
+ one of the tools above will suit you better.
57
+
58
+ ## Requirements
59
+
60
+ - macOS. Linux is experimental: it builds in CI but hasn't been used day to day. On Linux, `node-pty`
61
+ compiles from source and needs python3, make and a C++ compiler.
62
+ - Node.js 22.13 or newer (`.nvmrc` pins 22)
63
+ - tmux 3.2 or newer (`brew install tmux`)
64
+ - Claude Code CLI (`claude`) on your PATH. Tested with Claude Code 2.1.332; see [Compatibility](#compatibility).
65
+ - `curl` and `bash` (the hooks and status line that report to wrkpanel use them)
66
+
67
+ ## Scripts
68
+
69
+ In a clone:
70
+
71
+ | Script | Does |
72
+ | --- | --- |
73
+ | `npm run dev` | Server with auto-reload on :8855 + Vite dev page on http://localhost:5173 |
74
+ | `npm run build` | Build page to `dist/web` and server to `dist/server` |
75
+ | `npm run serve` | Start the built server without opening a browser |
76
+ | `npm run typecheck` | Typecheck server and page |
77
+
78
+ Set `WRKPANEL_PORT` to use a different port. `WRKPANEL_SOCKET` picks a different tmux socket and
79
+ `WRKPANEL_DATA` a different data folder, for running a test server next to your real one without touching
80
+ its sessions or project list.
81
+
82
+ ## Using it
83
+
84
+ - **Add project**: pick a folder (suggestions come from your recent Claude projects). Sessions are grouped
85
+ under their project. The list is kept in `~/.config/wrkpanel/wrkpanel.db` (`WRKPANEL_DATA` moves it).
86
+ **Remove** only drops it from wrkpanel; the folder and any running sessions are left alone, and those
87
+ sessions show under **Other folders**.
88
+ - **Project page**: click a project's name (the **›** next to it) for its own page: its cards (running
89
+ sessions and draft tasks, in the same order as on the list), and the sessions that ended (latest 100, with how many there are in all). An ended row shows
90
+ how it ended (**terminated** in wrkpanel, **exited** when Claude quit, **gone** when killed outside
91
+ wrkpanel), when, how long it ran, its artifacts and **ⓘ** with its task. Ended sessions in a nested project show only on that
92
+ project's page, like running ones.
93
+ - **+ Task** in a project: a title and a note for Claude. **▶ Start** (or Enter) starts a new session
94
+ named after the title and sends the title and note as Claude's first message. It does not open the
95
+ session: its card shows first in the project; click it to open the session. A title alone is sent
96
+ as the message. **Save Draft** parks the task instead: it shows as a dashed **draft** card in the
97
+ project; click it to edit, ✕ to delete, and its **▶ Start** starts it later. Every session starts
98
+ from a task. Once started, the
99
+ task moves onto the session: an **ⓘ** on its card (and in the terminal bar) shows the original title
100
+ and note. Tick **Continue last conversation in this folder** to start with `claude --continue`, so
101
+ the task goes to the folder's last Claude conversation. This applies only to that **▶ Start** and is
102
+ not kept on a draft. Tasks are kept in `wrkpanel.db` (max 12 KB each: the prompt goes through tmux,
103
+ which refuses longer commands). Removing a project keeps its drafts; they show again if you add the
104
+ folder back. Tick **Recurring** in a task's dialog to keep it as a draft after **▶ Start** (its card
105
+ shows **↻**): each start opens a new session from it, for work you run again and again.
106
+ - **Task types**: prebuilt instructions that go with a task. A task's **Type** (in its dialog) adds the
107
+ type's instructions after the title and note when it starts, and starts Claude in the type's mode
108
+ (`--permission-mode plan`, `auto` or `acceptEdits`, or as usual). **Task types** (top of the page)
109
+ lists them: click one to edit it, **+ New type** adds one, ★ picks the type new tasks get (★ on
110
+ **None**: new tasks get no type, and Claude starts as usual). The first start seeds five: Goal (fire and forget) (auto mode),
111
+ Goal (plan, review, push) ★ (plan mode), Grilling session, Plan (plan mode) and Artifact creation. They
112
+ are ordinary types after that: edit or delete them as you like. A draft keeps only which type it has,
113
+ so editing a type changes the drafts not started yet; a started session keeps what it was sent (its
114
+ card shows the type, ⓘ the instructions). Deleting a type moves its drafts to None. The type's
115
+ instructions count toward the 12 KB limit.
116
+ - **Artifacts**: the claude.ai artifacts (pages and docs) a session published, updated, read or opened.
117
+ A card shows **N artifacts** (click for the links) and the terminal bar an **Artifacts · N** button.
118
+ Each project has an **Artifacts** list under its sessions: every artifact any session in its folder
119
+ ever touched, latest first. It keeps growing after the sessions end, and an artifact shows once per
120
+ project however many sessions touched it. Artifacts deleted with Claude's Artifact tool drop out.
121
+ The links are read from each session's Claude transcript (after every turn, while the page is open, and
122
+ before Terminate, and once more when a session ends) and kept in `wrkpanel.db`. Only sessions that report status
123
+ (started by wrkpanel since badges) have a transcript to read. Templates that Claude only looked at
124
+ (Artifact types, quickstart) are not listed.
125
+ - **Card order**: sessions and drafts share one order in each project, and nothing reorders them by
126
+ itself (not status, not activity). A new card goes last; a started task's session goes first (the
127
+ other cards keep their order). Drag a card onto another to move it there (left half: before it, right half: after it); Esc or
128
+ dropping outside the project puts it back. With a card focused, **Alt+←/→** (or ↑/↓) moves it one place.
129
+ The order is kept in `wrkpanel.db`.
130
+ - **Usage** (top of the page): your plan limits as four batteries that drain toward empty. **Week** and
131
+ **Session** sit side by side, each with its time battery over its quota battery so the bars line up.
132
+ **Week**: 7 bars of time (one a day) and 7 of quota left. **Session**: 5 bars of time (one an hour) and
133
+ 5 of quota left. The current bar fills partly; hover for exact numbers and the reset time. Quota bars are green on
134
+ pace, amber when usage runs ahead of elapsed time (it would run out before the reset), red at 90% used.
135
+ The numbers come from Claude Code's status-line input: `claude-hooks.json` sets a status line that
136
+ posts it to wrkpanel, then runs your own status line (from your settings, read when the session
137
+ starts), so it looks the same. They update while a session started by wrkpanel (after this was added)
138
+ talks to Claude; the last numbers are kept in `wrkpanel.db` and fade after 30 minutes without a report.
139
+ API-key sessions have no plan limits, so they report nothing.
140
+ - **Appearance** (◐ at the top of the page, or in a session's terminal bar): the terminal's colors,
141
+ font size and cursor, and Claude Code's theme for new sessions.
142
+ - **Terminal colors**: follow the system (the dark preset while your system is dark, the light one
143
+ while it is light), or always use one of them. Dark presets: wrkpanel Dark (the look before presets),
144
+ Warm Graphite, Solarized Dark. Light presets: wrkpanel Light, Solarized Light.
145
+ - **Preview**: in a session tab every change repaints the terminal behind the dialog; on the list page
146
+ the dialog shows a sample. **Cancel** puts back the saved look. **Save** keeps it in `wrkpanel.db` and
147
+ repaints every open session tab, as does your system switching between dark and light.
148
+ - **Claude Code colors**: *Match the terminal* (default) starts Claude with its `dark` or `light`
149
+ theme, whichever matches the terminal; *Use the preset's colors* starts it with `dark-ansi` or
150
+ `light-ansi`, so the preset's 16 colors color everything; *Leave it to your own /theme* passes no
151
+ theme, as before. The theme goes in the file wrkpanel passes to `claude --settings` (one per theme,
152
+ in `~/.config/wrkpanel/claude-settings/`); your `~/.claude/settings.json` is not touched. Claude
153
+ reads its theme when it starts, so this applies to sessions started after you save.
154
+ - A running session keeps the Claude theme it started with. When the terminal then switches between
155
+ dark and light, colors that would be too faint on the new background are adjusted to a 3:1
156
+ contrast (xterm.js `minimumContrastRatio`).
157
+ - **Rename** with ✎ on a card (shows on hover) or in the terminal bar. Only the shown name changes; the
158
+ session id and its URL stay the same.
159
+ - **Open** a card: the session opens in a new tab. **✕** in its bar (or closing the tab) detaches only
160
+ that view; Claude keeps working.
161
+ - **Terminate** runs `tmux kill-session`. Other open views show "Session ended".
162
+ - **View an ended session**: click its name on the project page. A new tab shows what was said, read from
163
+ Claude's transcript: your messages, Claude's replies, and each tool call with its output (collapsed).
164
+ This doesn't start anything. It isn't the terminal screen, because that is gone with the tmux
165
+ session. Claude deletes old transcripts after a while (`cleanupPeriodDays`, 30 days by default).
166
+ After that, an ended session can be neither viewed nor resumed.
167
+ - **Resume** (on an ended row, or in its view) starts the session again with `claude --resume` on its
168
+ last conversation, in the same folder. **Resume this conversation** in the view picks one when there
169
+ were several (after `/clear`). The row turns back into a running card with the same name, task and
170
+ artifacts, and the view's tab becomes its terminal.
171
+ - You can also attach from a real terminal: `tmux -L wrkpanel attach -t wp-<name>`.
172
+ - **Session records**: every session also gets a record in `wrkpanel.db` that outlives tmux: a stable uid
173
+ (`s-<hex>`, tmux option `@wp_uid`), name, folder, how it started (its task included), every Claude
174
+ conversation it ran (one per `/clear`), and how it ended: `terminated`, `exited` (Claude quit, with its
175
+ reason) or `gone` (killed outside wrkpanel). Sessions started before records existed are adopted on the
176
+ next list. The project page lists them; `GET /api/history[?project=<path>&limit=<n>]` returns them
177
+ (with `total`, and each one's artifacts),
178
+ `GET /api/history/<uid>` one record with its conversations' messages.
179
+ - **Data**: everything lives in one SQLite file, `~/.config/wrkpanel/wrkpanel.db` (Node's built-in
180
+ `node:sqlite`). The first start imports the old `projects.json`, `todos.json` and `artifacts.json`; they
181
+ are left in place and never read again.
182
+
183
+ ### Keyboard and mouse
184
+
185
+ - **Shift+Enter** inserts a newline (sent as `ESC CR`).
186
+ - **Mouse wheel** scrolls history (tmux copy-mode). Press `q` or `Esc` to leave copy-mode.
187
+ - **Select text**: hold **Option** and drag. Text selected in tmux copy-mode is copied to your clipboard (OSC 52).
188
+ - Browser shortcuts such as Cmd+W, Cmd+T and Ctrl+Tab never reach Claude. Installing the page as an app
189
+ window (Chrome: ⋮ → Cast, save and share → Install page as app) frees most of them.
190
+ - tmux has no prefix key on the wrkpanel socket, so Ctrl+B and friends go straight to Claude.
191
+
192
+ ### Status badges
193
+
194
+ Each card shows what its session is doing, and for how long:
195
+
196
+ | Badge | Means |
197
+ | --- | --- |
198
+ | **working** | Claude is busy |
199
+ | **waiting for you** | Claude finished its turn, or the session just started |
200
+ | **needs approval** / **has a question** | A permission prompt (hover for the tool) or a question is open |
201
+ | **no status** | Started before badges existed; new sessions report status |
202
+
203
+ wrkpanel starts Claude with `claude --settings` and a copy of `claude-hooks.json` (in
204
+ `~/.config/wrkpanel/claude-settings/`, so it outlives npm's cache under npx). Those hooks post each event to
205
+ `/api/hooks` with curl, and only for sessions wrkpanel starts. `~/.claude/settings.json` is never touched.
206
+ The state is stored as tmux options, so it survives a wrkpanel restart.
207
+
208
+ Two moments fire no hook, so the server fills them in each time the list refreshes:
209
+
210
+ - **Esc interrupts a turn.** It sees the interrupt in Claude's transcript, or, when Esc came before any
211
+ reply text, the missing `esc to interrupt` footer on screen for 3 s.
212
+ - **You approve a tool.** It sees `esc to interrupt` come back on screen, so the card says "working" while
213
+ the tool runs.
214
+
215
+ Both use Claude Code's internal transcript format and screen text. If a Claude update changes those, the
216
+ fallbacks stop working and a badge can stay on "working" after an Esc until your next prompt.
217
+
218
+ ## Trust model
219
+
220
+ In plain words: **anyone who can reach port 8855 as you can type into your Claude sessions**, and Claude
221
+ can run commands on your machine. wrkpanel only listens on `127.0.0.1` and checks every request so
222
+ that other websites in your browser can't get in. Don't expose it: no tunnels (ngrok, Cloudflare
223
+ Tunnel), no SSH port forwards for others, no reverse proxy on `0.0.0.0`. Remote access would need a
224
+ login, which wrkpanel doesn't have.
225
+
226
+ The details:
227
+
228
+ - Binds `127.0.0.1` only.
229
+ - Every request must carry `Host: localhost:8855` (or `127.0.0.1:8855`), which blocks DNS rebinding.
230
+ - A request with an `Origin` header must come from that same origin, and WebSocket upgrades and
231
+ POST/DELETE must send one. Other websites open in your browser can't read sessions or type into them.
232
+ - `POST /api/hooks` is the one mutating request allowed without `Origin`, because curl sends none. A browser
233
+ always sends `Origin` on a cross-site POST, so other websites still can't reach it. A local process could
234
+ set a wrong badge there, but it could also run tmux directly.
235
+ - tmux is always run with `execFile` and argument arrays. Session ids must match `^wp-[a-z0-9-]{1,40}$`, and the
236
+ folder must exist.
237
+
238
+ Anyone with a shell on your Mac as your user can still reach the port. That's the same trust level as tmux itself.
239
+
240
+ Found a hole? Please report it privately; see [SECURITY.md](SECURITY.md).
241
+
242
+ ## Compatibility
243
+
244
+ wrkpanel relies on parts of Claude Code that aren't a stable API: the hook events `PermissionRequest`,
245
+ `Elicitation`, `StopFailure` and `SessionEnd`, the status line's `rate_limits` field, the transcript
246
+ `.jsonl` format, and the `esc to interrupt` footer on screen. It was tested with Claude Code 2.1.332.
247
+
248
+ If a Claude update changes them, the terminal keeps working and what degrades is:
249
+
250
+ - **Badges** can stay on "working" after an Esc, or miss an approval, until your next prompt.
251
+ - **Artifact links** stop appearing for new sessions.
252
+ - **Usage** batteries fade out after 30 minutes without a report.
253
+
254
+ When you file a bug, include `claude --version`.
255
+
256
+ ## Troubleshooting
257
+
258
+ - **`posix_spawnp failed`** when opening a session: node-pty's `spawn-helper` lost its execute bit. The
259
+ `wrkpanel` command restores it at every start; in a clone, run `npm install` again (its postinstall
260
+ fixes it), or `chmod +x node_modules/node-pty/prebuilds/*/spawn-helper`.
261
+ - **`port 8855 is already in use`**: wrkpanel is probably already running. Open
262
+ http://localhost:8855, or start a second one with `npx wrkpanel --port 8856`
263
+ (`WRKPANEL_PORT=8856 npm start` in a clone).
264
+ - **`tmux … is too old`**: wrkpanel needs tmux 3.2 or newer (`brew upgrade tmux`).
265
+ - **`claude (Claude Code CLI) was not found`**: make sure `command -v claude` prints a path in the shell
266
+ you start wrkpanel from.
267
+ - **Badges say "no status"**: the session was started outside wrkpanel, or before badges existed. New
268
+ sessions report status.
269
+ - **`node:sqlite` errors at start**: your Node is older than 22.13 (`node -v`).
270
+
271
+ ## Uninstall
272
+
273
+ ```sh
274
+ tmux -L wrkpanel kill-server # ends every wrkpanel session (and the Claude in it)
275
+ rm -rf ~/.config/wrkpanel # projects, tasks, session records, artifact links
276
+ npm uninstall -g wrkpanel # if you installed it with -g (npx only keeps a copy in npm's cache)
277
+ rm -rf wrkpanel # or the clone
278
+ ```
279
+
280
+ wrkpanel never writes to `~/.claude`, so there's nothing to undo there.
281
+
282
+ ## Layout
283
+
284
+ ```
285
+ server/
286
+ index.ts HTTP + WebSocket routes, Origin/Host checks, static page, startup
287
+ tmux.ts tmux transport: list / create / rename / kill, binary lookup, folder suggestions
288
+ sessions.ts session records: start, terminate, hooks, reconcile (adopt / end), history
289
+ db.ts SQLite store (wrkpanel.db), migrations, one-time JSON import
290
+ projects.ts project list
291
+ todos.ts tasks (todos in code): a session to start or a draft per project, ▶ starts one
292
+ todoTypes.ts task types: instructions + start mode, the default one
293
+ todo-seeds.ts the task types a new database starts with
294
+ settings.ts Appearance setting; Claude's theme and its --settings file
295
+ order.ts card order per project
296
+ usage.ts plan usage from the status line, the user's own status line
297
+ artifacts.ts artifact links read from transcripts
298
+ attach.ts node-pty <-> WebSocket bridge
299
+ status.ts status badges: hook events -> state, interrupt / approval detection
300
+ config.ts port, socket name, paths
301
+ web/
302
+ main.ts router: "/" list, "/project?path=" project page, "/s/:id" terminal
303
+ list.ts sessions grouped by project, cards; the project page (running, drafts, ended)
304
+ dialogs.ts Add project / Task / Rename / Task types / Appearance dialogs
305
+ term.ts xterm.js view, ✕ / Terminate bar, reconnect
306
+ themes.ts terminal color presets; the saved Appearance, shared between tabs
307
+ usage.ts usage batteries
308
+ api.ts fetch helpers
309
+ tmux.conf config for the wrkpanel tmux socket only
310
+ claude-hooks.json Claude Code hooks passed to each session with --settings
311
+ bin/
312
+ wrkpanel.js the `wrkpanel` command (npx, npm -g): Node check, --port / --no-open, starts dist/server
313
+ scripts/
314
+ fix-node-pty.mjs postinstall and every start: restores node-pty's spawn-helper execute bit
315
+ ```
316
+
317
+ See [docs/design-notes.md](docs/design-notes.md) for why it works this way.
318
+
319
+ ## License
320
+
321
+ [MIT](LICENSE)
@@ -0,0 +1,55 @@
1
+ #!/usr/bin/env node
2
+ // The `wrkpanel` command (npx wrkpanel, or npm install -g wrkpanel). Checks Node, reads a few flags,
3
+ // then starts the built server in dist/server. Kept to syntax old Node versions can parse, so an old
4
+ // Node gets the version message instead of a syntax error.
5
+ import { readFileSync } from 'node:fs';
6
+
7
+ const pkg = JSON.parse(readFileSync(new URL('../package.json', import.meta.url), 'utf8'));
8
+ const args = process.argv.slice(2);
9
+
10
+ function has(flag) {
11
+ return args.indexOf(flag) !== -1;
12
+ }
13
+
14
+ if (has('--version') || has('-v')) {
15
+ console.log(pkg.version);
16
+ process.exit(0);
17
+ }
18
+
19
+ if (has('--help') || has('-h')) {
20
+ console.log(`wrkpanel ${pkg.version}: a browser panel for your Claude Code sessions, running in tmux
21
+
22
+ Usage: wrkpanel [--port <n>] [--no-open]
23
+
24
+ --port <n> listen on 127.0.0.1:<n> instead of 8855 (or set WRKPANEL_PORT)
25
+ --no-open don't open the browser
26
+ --version print the version
27
+ --help print this
28
+
29
+ Needs tmux 3.2+ and the claude CLI on your PATH. Data lives in ~/.config/wrkpanel.
30
+ Stop it with Ctrl+C: your sessions keep running in tmux (tmux -L wrkpanel ls).
31
+ More: ${pkg.homepage}`);
32
+ process.exit(0);
33
+ }
34
+
35
+ const [major, minor] = process.versions.node.split('.').map(Number);
36
+ if (major < 22 || (major === 22 && minor < 13)) {
37
+ console.error(`wrkpanel: needs Node.js 22.13 or newer (for node:sqlite); this is ${process.version}.`);
38
+ process.exit(1);
39
+ }
40
+
41
+ const portAt = args.indexOf('--port');
42
+ if (portAt !== -1) {
43
+ const port = Number(args[portAt + 1]);
44
+ if (!Number.isInteger(port) || port < 1 || port > 65535) {
45
+ console.error('wrkpanel: --port needs a port number, e.g. --port 8856');
46
+ process.exit(1);
47
+ }
48
+ process.env.WRKPANEL_PORT = String(port);
49
+ }
50
+
51
+ // The server reads --open from argv.
52
+ if (!has('--no-open')) process.argv.push('--open');
53
+
54
+ await import('../scripts/fix-node-pty.mjs');
55
+ await import('../dist/server/index.js');
@@ -0,0 +1,132 @@
1
+ {
2
+ "statusLine": {
3
+ "type": "command",
4
+ "command": "input=$(cat); case \"$input\" in *'\"rate_limits\"'*) printf '%s' \"$input\" | curl -s -m 2 -o /dev/null -H 'content-type: application/json' --data-binary @- \"$WRKPANEL_URL/api/usage?id=$WRKPANEL_ID\" >/dev/null 2>&1 & ;; esac; if [ -n \"$WRKPANEL_STATUSLINE\" ]; then printf '%s' \"$input\" | bash -c \"$WRKPANEL_STATUSLINE\"; fi"
5
+ },
6
+ "hooks": {
7
+ "SessionStart": [
8
+ {
9
+ "hooks": [
10
+ {
11
+ "type": "command",
12
+ "command": "curl -s -m 2 -o /dev/null -H 'content-type: application/json' --data-binary @- \"$WRKPANEL_URL/api/hooks?id=$WRKPANEL_ID\" || true",
13
+ "timeout": 5
14
+ }
15
+ ]
16
+ }
17
+ ],
18
+ "UserPromptSubmit": [
19
+ {
20
+ "hooks": [
21
+ {
22
+ "type": "command",
23
+ "command": "curl -s -m 2 -o /dev/null -H 'content-type: application/json' --data-binary @- \"$WRKPANEL_URL/api/hooks?id=$WRKPANEL_ID\" || true",
24
+ "timeout": 5
25
+ }
26
+ ]
27
+ }
28
+ ],
29
+ "PermissionRequest": [
30
+ {
31
+ "matcher": "*",
32
+ "hooks": [
33
+ {
34
+ "type": "command",
35
+ "command": "curl -s -m 2 -o /dev/null -H 'content-type: application/json' --data-binary @- \"$WRKPANEL_URL/api/hooks?id=$WRKPANEL_ID\" || true",
36
+ "timeout": 5
37
+ }
38
+ ]
39
+ }
40
+ ],
41
+ "PostToolUse": [
42
+ {
43
+ "matcher": "*",
44
+ "hooks": [
45
+ {
46
+ "type": "command",
47
+ "command": "curl -s -m 2 -o /dev/null -H 'content-type: application/json' --data-binary @- \"$WRKPANEL_URL/api/hooks?id=$WRKPANEL_ID\" || true",
48
+ "timeout": 5
49
+ }
50
+ ]
51
+ }
52
+ ],
53
+ "PostToolUseFailure": [
54
+ {
55
+ "matcher": "*",
56
+ "hooks": [
57
+ {
58
+ "type": "command",
59
+ "command": "curl -s -m 2 -o /dev/null -H 'content-type: application/json' --data-binary @- \"$WRKPANEL_URL/api/hooks?id=$WRKPANEL_ID\" || true",
60
+ "timeout": 5
61
+ }
62
+ ]
63
+ }
64
+ ],
65
+ "Notification": [
66
+ {
67
+ "hooks": [
68
+ {
69
+ "type": "command",
70
+ "command": "curl -s -m 2 -o /dev/null -H 'content-type: application/json' --data-binary @- \"$WRKPANEL_URL/api/hooks?id=$WRKPANEL_ID\" || true",
71
+ "timeout": 5
72
+ }
73
+ ]
74
+ }
75
+ ],
76
+ "Elicitation": [
77
+ {
78
+ "hooks": [
79
+ {
80
+ "type": "command",
81
+ "command": "curl -s -m 2 -o /dev/null -H 'content-type: application/json' --data-binary @- \"$WRKPANEL_URL/api/hooks?id=$WRKPANEL_ID\" || true",
82
+ "timeout": 5
83
+ }
84
+ ]
85
+ }
86
+ ],
87
+ "ElicitationResult": [
88
+ {
89
+ "hooks": [
90
+ {
91
+ "type": "command",
92
+ "command": "curl -s -m 2 -o /dev/null -H 'content-type: application/json' --data-binary @- \"$WRKPANEL_URL/api/hooks?id=$WRKPANEL_ID\" || true",
93
+ "timeout": 5
94
+ }
95
+ ]
96
+ }
97
+ ],
98
+ "Stop": [
99
+ {
100
+ "hooks": [
101
+ {
102
+ "type": "command",
103
+ "command": "curl -s -m 2 -o /dev/null -H 'content-type: application/json' --data-binary @- \"$WRKPANEL_URL/api/hooks?id=$WRKPANEL_ID\" || true",
104
+ "timeout": 5
105
+ }
106
+ ]
107
+ }
108
+ ],
109
+ "StopFailure": [
110
+ {
111
+ "hooks": [
112
+ {
113
+ "type": "command",
114
+ "command": "curl -s -m 2 -o /dev/null -H 'content-type: application/json' --data-binary @- \"$WRKPANEL_URL/api/hooks?id=$WRKPANEL_ID\" || true",
115
+ "timeout": 5
116
+ }
117
+ ]
118
+ }
119
+ ],
120
+ "SessionEnd": [
121
+ {
122
+ "hooks": [
123
+ {
124
+ "type": "command",
125
+ "command": "curl -s -m 2 -o /dev/null -H 'content-type: application/json' --data-binary @- \"$WRKPANEL_URL/api/hooks?id=$WRKPANEL_ID\" || true",
126
+ "timeout": 5
127
+ }
128
+ ]
129
+ }
130
+ ]
131
+ }
132
+ }