@gigaflow/gmux 0.15.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.
Files changed (229) hide show
  1. package/CHANGELOG.md +654 -0
  2. package/LICENSE +21 -0
  3. package/README.md +351 -0
  4. package/dist/adapters/claude-code.d.ts +52 -0
  5. package/dist/adapters/claude-code.js +315 -0
  6. package/dist/adapters/claude-code.js.map +1 -0
  7. package/dist/adapters/codex.d.ts +39 -0
  8. package/dist/adapters/codex.js +233 -0
  9. package/dist/adapters/codex.js.map +1 -0
  10. package/dist/adapters/jsonl.d.ts +40 -0
  11. package/dist/adapters/jsonl.js +92 -0
  12. package/dist/adapters/jsonl.js.map +1 -0
  13. package/dist/adapters/registry.d.ts +11 -0
  14. package/dist/adapters/registry.js +21 -0
  15. package/dist/adapters/registry.js.map +1 -0
  16. package/dist/adapters/types.d.ts +43 -0
  17. package/dist/adapters/types.js +2 -0
  18. package/dist/adapters/types.js.map +1 -0
  19. package/dist/cli/border-client.d.ts +8 -0
  20. package/dist/cli/border-client.js +11 -0
  21. package/dist/cli/border-client.js.map +1 -0
  22. package/dist/cli/commands/__ask-cancel.d.ts +35 -0
  23. package/dist/cli/commands/__ask-cancel.js +91 -0
  24. package/dist/cli/commands/__ask-cancel.js.map +1 -0
  25. package/dist/cli/commands/__ask-refresh.d.ts +40 -0
  26. package/dist/cli/commands/__ask-refresh.js +54 -0
  27. package/dist/cli/commands/__ask-refresh.js.map +1 -0
  28. package/dist/cli/commands/__ask-run.d.ts +43 -0
  29. package/dist/cli/commands/__ask-run.js +126 -0
  30. package/dist/cli/commands/__ask-run.js.map +1 -0
  31. package/dist/cli/commands/__ask-send.d.ts +50 -0
  32. package/dist/cli/commands/__ask-send.js +138 -0
  33. package/dist/cli/commands/__ask-send.js.map +1 -0
  34. package/dist/cli/commands/__preview-card.d.ts +31 -0
  35. package/dist/cli/commands/__preview-card.js +72 -0
  36. package/dist/cli/commands/__preview-card.js.map +1 -0
  37. package/dist/cli/commands/ask.d.ts +50 -0
  38. package/dist/cli/commands/ask.js +240 -0
  39. package/dist/cli/commands/ask.js.map +1 -0
  40. package/dist/cli/commands/auto.d.ts +12 -0
  41. package/dist/cli/commands/auto.js +28 -0
  42. package/dist/cli/commands/auto.js.map +1 -0
  43. package/dist/cli/commands/cockpit.d.ts +14 -0
  44. package/dist/cli/commands/cockpit.js +52 -0
  45. package/dist/cli/commands/cockpit.js.map +1 -0
  46. package/dist/cli/commands/daemon.d.ts +75 -0
  47. package/dist/cli/commands/daemon.js +258 -0
  48. package/dist/cli/commands/daemon.js.map +1 -0
  49. package/dist/cli/commands/doctor.d.ts +6 -0
  50. package/dist/cli/commands/doctor.js +159 -0
  51. package/dist/cli/commands/doctor.js.map +1 -0
  52. package/dist/cli/commands/grep.d.ts +2 -0
  53. package/dist/cli/commands/grep.js +52 -0
  54. package/dist/cli/commands/grep.js.map +1 -0
  55. package/dist/cli/commands/index-cmd.d.ts +2 -0
  56. package/dist/cli/commands/index-cmd.js +29 -0
  57. package/dist/cli/commands/index-cmd.js.map +1 -0
  58. package/dist/cli/commands/ls.d.ts +30 -0
  59. package/dist/cli/commands/ls.js +95 -0
  60. package/dist/cli/commands/ls.js.map +1 -0
  61. package/dist/cli/commands/overlay.d.ts +26 -0
  62. package/dist/cli/commands/overlay.js +216 -0
  63. package/dist/cli/commands/overlay.js.map +1 -0
  64. package/dist/cli/commands/pick.d.ts +59 -0
  65. package/dist/cli/commands/pick.js +254 -0
  66. package/dist/cli/commands/pick.js.map +1 -0
  67. package/dist/cli/commands/picker-rows.d.ts +17 -0
  68. package/dist/cli/commands/picker-rows.js +47 -0
  69. package/dist/cli/commands/picker-rows.js.map +1 -0
  70. package/dist/cli/commands/resume.d.ts +25 -0
  71. package/dist/cli/commands/resume.js +88 -0
  72. package/dist/cli/commands/resume.js.map +1 -0
  73. package/dist/cli/commands/run.d.ts +13 -0
  74. package/dist/cli/commands/run.js +78 -0
  75. package/dist/cli/commands/run.js.map +1 -0
  76. package/dist/cli/commands/setup.d.ts +37 -0
  77. package/dist/cli/commands/setup.js +200 -0
  78. package/dist/cli/commands/setup.js.map +1 -0
  79. package/dist/cli/commands/show.d.ts +2 -0
  80. package/dist/cli/commands/show.js +24 -0
  81. package/dist/cli/commands/show.js.map +1 -0
  82. package/dist/cli/commands/summarize.d.ts +2 -0
  83. package/dist/cli/commands/summarize.js +59 -0
  84. package/dist/cli/commands/summarize.js.map +1 -0
  85. package/dist/cli/commands/tmux.d.ts +11 -0
  86. package/dist/cli/commands/tmux.js +90 -0
  87. package/dist/cli/commands/tmux.js.map +1 -0
  88. package/dist/cli/commands/watch.d.ts +2 -0
  89. package/dist/cli/commands/watch.js +76 -0
  90. package/dist/cli/commands/watch.js.map +1 -0
  91. package/dist/cli/format.d.ts +74 -0
  92. package/dist/cli/format.js +242 -0
  93. package/dist/cli/format.js.map +1 -0
  94. package/dist/cli/gmux-render.d.ts +11 -0
  95. package/dist/cli/gmux-render.js +60 -0
  96. package/dist/cli/gmux-render.js.map +1 -0
  97. package/dist/cli/main.d.ts +8 -0
  98. package/dist/cli/main.js +145 -0
  99. package/dist/cli/main.js.map +1 -0
  100. package/dist/cli/overlay-ask.d.ts +13 -0
  101. package/dist/cli/overlay-ask.js +32 -0
  102. package/dist/cli/overlay-ask.js.map +1 -0
  103. package/dist/cli/overlay.d.ts +26 -0
  104. package/dist/cli/overlay.js +149 -0
  105. package/dist/cli/overlay.js.map +1 -0
  106. package/dist/cli/picker.d.ts +308 -0
  107. package/dist/cli/picker.js +642 -0
  108. package/dist/cli/picker.js.map +1 -0
  109. package/dist/cli/preview.d.ts +87 -0
  110. package/dist/cli/preview.js +292 -0
  111. package/dist/cli/preview.js.map +1 -0
  112. package/dist/cli/tmux-label.d.ts +50 -0
  113. package/dist/cli/tmux-label.js +146 -0
  114. package/dist/cli/tmux-label.js.map +1 -0
  115. package/dist/core/errors.d.ts +54 -0
  116. package/dist/core/errors.js +91 -0
  117. package/dist/core/errors.js.map +1 -0
  118. package/dist/core/fingerprint.d.ts +21 -0
  119. package/dist/core/fingerprint.js +59 -0
  120. package/dist/core/fingerprint.js.map +1 -0
  121. package/dist/core/gmux-types.d.ts +102 -0
  122. package/dist/core/gmux-types.js +13 -0
  123. package/dist/core/gmux-types.js.map +1 -0
  124. package/dist/core/pane-state.d.ts +5 -0
  125. package/dist/core/pane-state.js +15 -0
  126. package/dist/core/pane-state.js.map +1 -0
  127. package/dist/core/paths.d.ts +68 -0
  128. package/dist/core/paths.js +106 -0
  129. package/dist/core/paths.js.map +1 -0
  130. package/dist/core/proc-tree.d.ts +9 -0
  131. package/dist/core/proc-tree.js +33 -0
  132. package/dist/core/proc-tree.js.map +1 -0
  133. package/dist/core/text.d.ts +34 -0
  134. package/dist/core/text.js +126 -0
  135. package/dist/core/text.js.map +1 -0
  136. package/dist/core/types.d.ts +322 -0
  137. package/dist/core/types.js +10 -0
  138. package/dist/core/types.js.map +1 -0
  139. package/dist/services/ask-transcript.d.ts +256 -0
  140. package/dist/services/ask-transcript.js +544 -0
  141. package/dist/services/ask-transcript.js.map +1 -0
  142. package/dist/services/ask.d.ts +54 -0
  143. package/dist/services/ask.js +161 -0
  144. package/dist/services/ask.js.map +1 -0
  145. package/dist/services/auto-summarize.d.ts +188 -0
  146. package/dist/services/auto-summarize.js +415 -0
  147. package/dist/services/auto-summarize.js.map +1 -0
  148. package/dist/services/concurrency.d.ts +2 -0
  149. package/dist/services/concurrency.js +16 -0
  150. package/dist/services/concurrency.js.map +1 -0
  151. package/dist/services/config.d.ts +131 -0
  152. package/dist/services/config.js +325 -0
  153. package/dist/services/config.js.map +1 -0
  154. package/dist/services/daemon-client.d.ts +9 -0
  155. package/dist/services/daemon-client.js +34 -0
  156. package/dist/services/daemon-client.js.map +1 -0
  157. package/dist/services/daemon-socket.d.ts +30 -0
  158. package/dist/services/daemon-socket.js +76 -0
  159. package/dist/services/daemon-socket.js.map +1 -0
  160. package/dist/services/daemon.d.ts +43 -0
  161. package/dist/services/daemon.js +106 -0
  162. package/dist/services/daemon.js.map +1 -0
  163. package/dist/services/distill.d.ts +39 -0
  164. package/dist/services/distill.js +93 -0
  165. package/dist/services/distill.js.map +1 -0
  166. package/dist/services/guardian.d.ts +26 -0
  167. package/dist/services/guardian.js +71 -0
  168. package/dist/services/guardian.js.map +1 -0
  169. package/dist/services/index-store.d.ts +36 -0
  170. package/dist/services/index-store.js +125 -0
  171. package/dist/services/index-store.js.map +1 -0
  172. package/dist/services/log-rotation.d.ts +3 -0
  173. package/dist/services/log-rotation.js +28 -0
  174. package/dist/services/log-rotation.js.map +1 -0
  175. package/dist/services/pane-links.d.ts +10 -0
  176. package/dist/services/pane-links.js +47 -0
  177. package/dist/services/pane-links.js.map +1 -0
  178. package/dist/services/pane-process.d.ts +95 -0
  179. package/dist/services/pane-process.js +183 -0
  180. package/dist/services/pane-process.js.map +1 -0
  181. package/dist/services/pane-registry.d.ts +24 -0
  182. package/dist/services/pane-registry.js +40 -0
  183. package/dist/services/pane-registry.js.map +1 -0
  184. package/dist/services/provider-process.d.ts +37 -0
  185. package/dist/services/provider-process.js +105 -0
  186. package/dist/services/provider-process.js.map +1 -0
  187. package/dist/services/providers.d.ts +76 -0
  188. package/dist/services/providers.js +104 -0
  189. package/dist/services/providers.js.map +1 -0
  190. package/dist/services/resolve.d.ts +3 -0
  191. package/dist/services/resolve.js +18 -0
  192. package/dist/services/resolve.js.map +1 -0
  193. package/dist/services/resources.d.ts +17 -0
  194. package/dist/services/resources.js +113 -0
  195. package/dist/services/resources.js.map +1 -0
  196. package/dist/services/search.d.ts +29 -0
  197. package/dist/services/search.js +135 -0
  198. package/dist/services/search.js.map +1 -0
  199. package/dist/services/semantic-gate.d.ts +13 -0
  200. package/dist/services/semantic-gate.js +23 -0
  201. package/dist/services/semantic-gate.js.map +1 -0
  202. package/dist/services/semantic.d.ts +113 -0
  203. package/dist/services/semantic.js +216 -0
  204. package/dist/services/semantic.js.map +1 -0
  205. package/dist/services/sensors.d.ts +92 -0
  206. package/dist/services/sensors.js +246 -0
  207. package/dist/services/sensors.js.map +1 -0
  208. package/dist/services/summarize.d.ts +84 -0
  209. package/dist/services/summarize.js +230 -0
  210. package/dist/services/summarize.js.map +1 -0
  211. package/dist/services/tmux-gateway.d.ts +17 -0
  212. package/dist/services/tmux-gateway.js +10 -0
  213. package/dist/services/tmux-gateway.js.map +1 -0
  214. package/dist/services/tmux-resolve.d.ts +54 -0
  215. package/dist/services/tmux-resolve.js +0 -0
  216. package/dist/services/tmux-resolve.js.map +1 -0
  217. package/dist/services/tmux.d.ts +32 -0
  218. package/dist/services/tmux.js +107 -0
  219. package/dist/services/tmux.js.map +1 -0
  220. package/dist/services/views.d.ts +7 -0
  221. package/dist/services/views.js +18 -0
  222. package/dist/services/views.js.map +1 -0
  223. package/dist/services/watch.d.ts +36 -0
  224. package/dist/services/watch.js +98 -0
  225. package/dist/services/watch.js.map +1 -0
  226. package/dist/services/workspace.d.ts +19 -0
  227. package/dist/services/workspace.js +88 -0
  228. package/dist/services/workspace.js.map +1 -0
  229. package/package.json +64 -0
package/README.md ADDED
@@ -0,0 +1,351 @@
1
+ # gmux
2
+
3
+ **gmux is the giga multiplexer for driving many AI coding agents in tmux —
4
+ always-on border labels and a live cockpit tell you what every pane is doing,
5
+ so you glance instead of checking each one.** Underneath, `gm` is also the CLI
6
+ that browses, searches, and resumes every agent session you've ever run —
7
+ Claude Code, Codex, and whatever you use next.
8
+
9
+ ## gmux: glance, don't check each pane
10
+
11
+ Running many agents across a tmux workspace has a high **attention tax**: to
12
+ know what any pane is doing — and which one needs you — you have to focus each
13
+ pane in turn. gmux removes that tax.
14
+
15
+ Start the daemon once. From then on:
16
+
17
+ - Every pane's **border** stays labelled with its state and what it's doing,
18
+ repainted continuously — no keypress needed.
19
+ - **ctrl+g** pulls up the **cockpit**: the whole workspace in one grid — state,
20
+ memory, one-liner, last activity — with any guardian alerts pinned at the
21
+ top.
22
+ - The **memory guardian** watches host memory pressure and, if it gets
23
+ critical, broadcasts a checkpoint-and-pause message into your agent panes
24
+ before the OS starts killing things — only with your consent, disclosed at
25
+ `gm setup`.
26
+
27
+ ### Quickstart
28
+
29
+ ```bash
30
+ gm tmux install # add the border + ctrl+g / ctrl+shift+g bindings to ~/.tmux.conf
31
+ tmux source-file ~/.tmux.conf
32
+
33
+ gm daemon # start the always-on workspace daemon
34
+ ```
35
+
36
+ `gm daemon` runs in the foreground — leave it in a pane, a background terminal,
37
+ or under whatever process supervisor you already use. It's a manual, opt-in
38
+ step on purpose: nothing autostarts behind your back. `gm daemon status` shows
39
+ whether it's running; `gm daemon stop` shuts it down.
40
+
41
+ Then just work. Borders update on their own; hit **ctrl+g** any time for the
42
+ full grid. `gm setup` is where the guardian's policy is disclosed and chosen —
43
+ `auto` (default), `notify`, or `off` — see
44
+ [the guardian section of `docs/gmux.md`](docs/gmux.md#the-guardian-one-action-explicit-consent).
45
+
46
+ ### What it looks like
47
+
48
+ This is real output from gmux's own renderers (`renderCockpit`,
49
+ `snapshotLabel`) against a representative workspace snapshot — not a mockup.
50
+
51
+ **The cockpit grid** (`gm cockpit`, bound to ctrl+g):
52
+
53
+ ```text
54
+ ⚠ host memory 92% — top consumer: window `webshop` (4.3 GB); checkpoint your work and pause non-essential tasks.
55
+
56
+ gmux — 3 panes
57
+ ○ webshop idle [4.3 GB] 10m ago
58
+ ● webshop wiring the checkout retry, tests going green [812 MB] 4s ago
59
+ ◔ billing webhook signature fix ready — awaiting your review [340 MB] 1m ago
60
+ unattributed: 2.1 GB (source outside tracked panes)
61
+ ```
62
+
63
+ <!-- screenshot: cockpit grid (drop PNG here) -->
64
+
65
+ **Pane border labels** — each pane's border shows this, all the time, no
66
+ keypress:
67
+
68
+ ```text
69
+ ● webshop — wiring the checkout retry, tests going green
70
+ ◔ billing — webhook signature fix ready — awaiting your review
71
+ ○ webshop — idle
72
+ ```
73
+
74
+ <!-- screenshot: pane border labels in a live tmux window (drop PNG here) -->
75
+
76
+ `●` working · `◔` waiting · `✗` error · `✓` done · `○` idle — the glyph is
77
+ instant (no LLM, every tick); the text after it catches up a beat later, once
78
+ the semantic layer summarizes.
79
+
80
+ Full architecture — the two-layer signal, the daemon, memory attribution and
81
+ its caveats, the guardian's exact rules — lives in
82
+ [`docs/gmux.md`](docs/gmux.md).
83
+
84
+ ## Two lanes: live cockpit vs. session history
85
+
86
+ gmux's cockpit and gigamanage's picker answer different questions over the
87
+ **same underlying data** — reach for whichever matches what you're asking:
88
+
89
+ | | **cockpit** — `ctrl+g` / `gm cockpit` | **picker** — `gm ls` / `gm` / `ctrl+shift+g` |
90
+ |---|---|---|
91
+ | Answers | *What's happening right now, across my live panes?* | *What did I run, and can I get back to it?* |
92
+ | Driven by | the daemon, ambient, continuously current | you, on demand |
93
+ | Scope | panes open in this tmux workspace | every session on disk, across time |
94
+ | Good for | glancing, triage, seeing the guardian log | browsing history, searching, resuming into a new window |
95
+
96
+ Reach for the cockpit first — it's the ambient layer, always on. Reach for the
97
+ picker to go back in time: resume a session from an hour or a month ago,
98
+ search across all of them, or check on one that isn't in a live pane right
99
+ now. Neither replaces the other.
100
+
101
+ ### The picker, in the same terms as the cockpit
102
+
103
+ Both of these are looking at one `webshop` repo with six recent sessions. The
104
+ built-in picker labels each one with the title Claude Code generated in its
105
+ opening seconds; `gmux ls` labels it with where the work actually ended up.
106
+
107
+ <table>
108
+ <tr>
109
+ <th width="50%"><code>claude --resume</code></th>
110
+ <th width="50%"><code>gmux ls</code></th>
111
+ </tr>
112
+ <tr>
113
+ <td valign="top"><img src="docs/media/claude-picker.png" alt="Claude Code's resume picker, listing six sessions by the title generated at the start of each one"></td>
114
+ <td valign="top"><img src="docs/media/gm-ls.png" alt="gmux ls, listing the same six sessions by where the work landed, with two flagged as ended mid-task"></td>
115
+ </tr>
116
+ <tr>
117
+ <td valign="top"><em>"webhook retries are flaky" is what you asked for four hours ago. Whether it got fixed is anyone's guess — and the two sessions that died mid-task look exactly like the four that didn't.</em></td>
118
+ <td valign="top"><em>The retry fix landed but the timestamp check never got written, and the Node 22 bump left the build red. Both are flagged <code>⚠</code>: they ended mid-task.</em></td>
119
+ </tr>
120
+ </table>
121
+
122
+ `gm` shows a full context card for the highlighted session alongside it — what
123
+ landed, what's still open, and the next concrete step. Hit enter and you're
124
+ back in the session, in the right harness and the right directory.
125
+
126
+ <p align="center">
127
+ <img src="docs/media/gm-picker.png" width="90%" alt="The gm fuzzy picker: session list on the left, and a preview pane on the right showing where the highlighted session landed, what is still open, and the next step">
128
+ </p>
129
+
130
+ ## What makes it different
131
+
132
+ **Summaries describe what the work became.** gigamanage reads each
133
+ transcript's *arc* — what you originally asked for, how the work moved, your
134
+ last instructions, the agent's final message, the files it touched, the last
135
+ command that failed — and writes four things: what the session is about, what
136
+ landed most recently, what's still open, and the next concrete step. The
137
+ harness title names the opening prompt and never revises it; this tells you
138
+ where the work actually is. That's the whole point of the tool, and it's what
139
+ both the picker and the cockpit's labels are built from.
140
+
141
+ **It knows when work was cut off.** Sessions that ended mid-task are flagged
142
+ `⚠`. Those are usually the ones you're looking for.
143
+
144
+ **It works across harnesses.** Claude Code and Codex today, with one small
145
+ interface for adding more. `gm resume` hands off to the right CLI — `claude
146
+ --resume` or `codex resume` — in the session's original directory.
147
+
148
+ **Agents can use it too.** Every read command takes `--json`. Your agent can
149
+ shell out to `gm grep "flaky test" --json` to find what you already tried,
150
+ instead of asking you.
151
+
152
+ ## Install
153
+
154
+ **From npm** (recommended):
155
+
156
+ ```bash
157
+ npm install -g @gigaflow/gmux
158
+ ```
159
+
160
+ The package is published as `@gigaflow/gmux` and installs a single command, `gmux`.
161
+
162
+ Or run it without installing anything:
163
+
164
+ ```bash
165
+ npx @gigaflow/gmux ls
166
+ ```
167
+
168
+ **From source** — for hacking on it, or to run an unreleased commit:
169
+
170
+ ```bash
171
+ git clone https://github.com/GigaFlowAI/gmux
172
+ cd gmux
173
+ npm install
174
+ npm run build
175
+ npm link # puts `gmux` on your PATH, pointing at this checkout
176
+ ```
177
+
178
+ With `npm link`, `gmux` tracks your working copy: re-run `npm run build` and the
179
+ next `gmux` picks it up. To run straight from TypeScript without building, use
180
+ `npm run dev -- ls`. To unlink later: `npm unlink -g @gigaflow/gmux`.
181
+
182
+ Requires Node 20+. Three optional companions, all surfaced by `gmux doctor`:
183
+
184
+ - **ripgrep** (`brew install ripgrep`) — needed for `gmux grep`.
185
+ - **fzf** (`brew install fzf`) — upgrades the picker to fuzzy search with a preview pane. Without it you get a numbered list.
186
+ - **tmux 3.2+** (`brew install tmux`) — needed for gmux (borders, cockpit) and the `ctrl+shift+g` picker popup; see [gmux](#gmux-glance-dont-check-each-pane) above.
187
+
188
+ Summaries are written by a model, so the first time you run `gm` it asks which
189
+ one to call — Claude Code, Codex, anything that reads a prompt on stdin, or
190
+ nothing at all. Change your mind any time with `gm setup` — the same wizard
191
+ also discloses and sets the [gmux guardian's policy](docs/gmux.md#the-guardian-one-action-explicit-consent).
192
+ `GIGAMANAGE_SUMMARY_CMD='codex exec'` overrides it for a one-off, and nothing
193
+ prompts when the output isn't a terminal, so `gm ls --json` stays safe to
194
+ script.
195
+
196
+ ## Usage
197
+
198
+ ```bash
199
+ gm # pick a recent session and resume it
200
+ gm ls # recent sessions, newest first
201
+ gm ls -p webshop -s 3d # ...in one project, from the last 3 days
202
+ gm show <id> # the full context card (id or any unique prefix)
203
+ gm grep "rate limit" # full-text search every transcript
204
+ gm ask # ask about your sessions — what to pick up, and why
205
+ gm resume <id> # jump back in, in the right harness and directory
206
+ gm summarize --recent 20 # write summaries for the 20 most recent sessions, now
207
+ gm setup # choose which harness gm calls, and the gmux guardian policy
208
+ gm doctor # what's installed, what's missing, how to fix it
209
+
210
+ gm tmux install # add the ctrl+g / ctrl+shift+g / alt-g tmux bindings
211
+ gm daemon # start the gmux workspace daemon (borders + cockpit)
212
+ gm cockpit # the live workspace grid — normally launched via ctrl+g
213
+ gm run claude # launch an agent gm can map to its pane exactly
214
+
215
+ gmux --no-auto-summarize ls # ...without kicking off background summaries
216
+ ```
217
+
218
+ Summaries are cached and only regenerate when a session actually changes, so
219
+ you pay for each one once.
220
+
221
+ By default the list hides two kinds of noise: **subagent transcripts**
222
+ (`--include-sidechains`) and **non-interactive runs** like `claude -p` or
223
+ `codex exec` (`--include-automated`).
224
+
225
+ ## Ask across your sessions
226
+
227
+ A list answers "what was I doing?" one row at a time. `gmux ask` answers the
228
+ question that spans them: *given all of it, where should I be looking?*
229
+
230
+ ```bash
231
+ gmux ask # a conversation; ctrl-d to leave
232
+ gmux ask "what's still broken?" # one-shot
233
+ gmux ask "what did I try for the retry?" --json # for your agents
234
+ ```
235
+
236
+ It starts from the summaries already on disk — so it costs one model call, not
237
+ a scan of half a gigabyte. When the summaries don't carry enough, it runs `gm
238
+ grep` against the real transcripts and reads what you actually said.
239
+
240
+ **In the picker, `ctrl-o` opens it** on the session you're highlighting: ask
241
+ "what's left here?", read the answer, and land back in the list exactly where
242
+ you were. (Without fzf, the numbered list spells it `a`.)
243
+
244
+ It isn't `shift+f` because fzf's query line eats plain letters — typing `F`
245
+ types an `F`. And it isn't `alt-a` because macOS sends `å`.
246
+
247
+ ## Summaries write themselves
248
+
249
+ Every `gm` command keeps **the sessions you just looked at** summarized. `gm
250
+ ls` shows 20 by default, so it keeps 20 written; `gm ls -n 50` keeps all
251
+ fifty. Any that are missing or stale are handed to a **detached background
252
+ process**, eight at a time, and the command returns immediately:
253
+
254
+ ```
255
+ $ gmux ls
256
+ a1b2c3d4 3m webshop/main Checkout spec + 8-task plan written; no tasks executed yet
257
+ e5f6a7b8 1h ◐ webshop/add-search add pagination to the search results page
258
+ c9d0e1f2 4h ⚠ billing/fix-webhooks Retry logic half-applied; signature test still red
259
+
260
+ ⚠ ended mid-task ◐ summarizing now (1)
261
+ summarizing 1 session in the background — marked ◐ below
262
+ ```
263
+
264
+ | marker | meaning |
265
+ |---|---|
266
+ | `◐` | being summarized right now |
267
+ | `○` | no summary yet, and nothing running |
268
+ | `⚠` | the session ended mid-task — usually the one you want |
269
+
270
+ The foreground command **never waits on a model**: it prints and exits, and
271
+ the summaries appear on your next run. Only one background pass runs at a time
272
+ — a lock in `~/.cache/gigamanage` means five `gm ls` in a row start one
273
+ summarizer, not five. A pass writes at most 50; the rest are picked up next
274
+ run, and it says so.
275
+
276
+ The notice goes to **stderr**, so `gm ls --json` stays clean for agents and
277
+ pipes.
278
+
279
+ Automated runs and sidechains are never summarized this way. That matters: the
280
+ summarizer *is* `claude -p`, which writes a session of its own — summarizing
281
+ those would put gigamanage in an infinite loop against your token budget.
282
+
283
+ **Turning it off.** Background model calls cost tokens. Either of these
284
+ switches them off:
285
+
286
+ ```bash
287
+ gmux --no-auto-summarize ls # once
288
+ export GMUX_AUTO_SUMMARIZE=0 # for good, in your shell profile
289
+ ```
290
+
291
+ It also stays quiet if no summary provider is installed — a missing `claude`
292
+ never breaks a read command. If a background pass fails, `gm doctor` shows you
293
+ the last error rather than leaving you to wonder why nothing appeared.
294
+
295
+ ## tmux bindings, in full
296
+
297
+ `gm tmux install` writes three bindings to `~/.tmux.conf` (`gm tmux uninstall`
298
+ removes them; reload with `tmux source-file ~/.tmux.conf` after either):
299
+
300
+ - **ctrl+g** — pulls up the gmux **cockpit** in a full-screen popup: every
301
+ pane's state, memory, headline, and last activity, with the guardian log at
302
+ the top. Reads the daemon's live socket while `gm daemon` is running, and
303
+ falls back to the last snapshot file (marked stale) when it isn't. Press
304
+ **ctrl+g** again (or Esc) to dismiss — the same key toggles it.
305
+ - **alt-g** — toggles a lighter-weight label loop that keeps pane borders
306
+ headlined from your cached session summaries, for when you're not running
307
+ `gm daemon`. With the daemon running, borders are already kept current from
308
+ the live workspace model — `gm daemon`'s output is the primary path
309
+ described in [gmux](#gmux-glance-dont-check-each-pane) above.
310
+ - **ctrl+shift+g** — opens the `gm` session picker in a popup; Enter resumes
311
+ your choice into a **new tmux window**, so the pane you were in stays
312
+ untouched. See [Two lanes](#two-lanes-live-cockpit-vs-session-history).
313
+
314
+ `gm` resolves which session a pane is running by reading the pane's own
315
+ process (the agent's command line carries its session id) — so it works with
316
+ panes you already have open, no setup. Launching through `gm run` records an
317
+ exact link for the rare cases the process can't be read:
318
+
319
+ ```bash
320
+ gmux run claude # instead of: claude
321
+ gmux run codex resume # instead of: codex resume
322
+ ```
323
+
324
+ This needs **tmux 3.2 or newer** (for `display-popup`); `gm doctor` reports
325
+ whether it's available and, if not, why.
326
+
327
+ ## How it works
328
+
329
+ ```
330
+ harness dirs → adapter → SessionRecord (hard facts, free)
331
+ → index cache (mtime-keyed; 1,100 sessions in ~60ms warm)
332
+ → distill arc → model → summary (cached)
333
+ ```
334
+
335
+ gigamanage is **read-only** over your session transcripts. It never writes to
336
+ a session file; it owns nothing but its own cache in `~/.cache/gigamanage` and
337
+ gmux's small daemon state.
338
+
339
+ See [`docs/architecture.md`](docs/architecture.md) for the layering,
340
+ [`docs/gmux.md`](docs/gmux.md) for gmux's daemon/model/surfaces design, and
341
+ [`docs/adding-a-harness.md`](docs/adding-a-harness.md) to add support for
342
+ another agent.
343
+
344
+ ## Contributing
345
+
346
+ Yes please — especially adapters for other harnesses. Start with
347
+ [`CONTRIBUTING.md`](CONTRIBUTING.md).
348
+
349
+ ## License
350
+
351
+ MIT
@@ -0,0 +1,52 @@
1
+ /**
2
+ * Claude Code adapter.
3
+ *
4
+ * Layout: ~/.claude/projects/<slugified-cwd>/<session-uuid>.jsonl
5
+ * Each line is a tagged record; the ones we care about are `user`, `assistant`,
6
+ * `ai-title`, `last-prompt` and `pr-link`.
7
+ *
8
+ * Note on `ai-title`: Claude Code writes it early and never revises it, so it
9
+ * describes where a session STARTED. We keep it as `title` for reference, but
10
+ * the summary layer is what tells you where the work LANDED.
11
+ */
12
+ import type { SessionRecord, SessionRef } from "../core/types.js";
13
+ import type { HarnessAdapter, ResumeCommand } from "./types.js";
14
+ export declare class ClaudeCodeAdapter implements HarnessAdapter {
15
+ readonly id = "claude-code";
16
+ readonly displayName = "Claude Code";
17
+ readonly processNames: readonly ["claude"];
18
+ readonly launchCommand = "claude";
19
+ private root;
20
+ isAvailable(): Promise<boolean>;
21
+ /**
22
+ * Discovery walks the whole tree, not just the top level.
23
+ *
24
+ * A project directory holds its top-level sessions as `<uuid>.jsonl`, but
25
+ * subagent transcripts live deeper, under `<uuid>/subagents/agent-*.jsonl`,
26
+ * and can nest again inside each other. Those are the sidechains: on this
27
+ * author's machine they outnumber real sessions roughly nine to one, which is
28
+ * exactly why they are hidden by default — and why they must still be found,
29
+ * so `--include-sidechains` and `gmux grep` can reach them.
30
+ */
31
+ listSessions(): Promise<SessionRef[]>;
32
+ private walk;
33
+ parseSession(ref: SessionRef): Promise<SessionRecord>;
34
+ resumeCommand(record: SessionRecord): ResumeCommand;
35
+ }
36
+ /**
37
+ * Display name for a session's project.
38
+ *
39
+ * Worktrees live at `<repo>/.claude/worktrees/<branch>`, which would otherwise
40
+ * show up as a project named after the branch. Attribute those to the repo.
41
+ */
42
+ export declare function projectName(cwd: string | null): string | null;
43
+ /**
44
+ * Text the human actually typed.
45
+ *
46
+ * Filters out the machinery Claude Code injects into `user` lines: tool results,
47
+ * slash-command envelopes, and `<system-reminder>` blocks. Those are not prompts,
48
+ * and letting them through would poison the summaries.
49
+ */
50
+ export declare function humanText(content: unknown): string | null;
51
+ /** Files the assistant edited, read off its `tool_use` blocks. */
52
+ export declare function editedFiles(content: unknown): string[];