@logicseek/hello-cc 0.1.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/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,462 @@
1
+ # hello-cc
2
+
3
+ <p align="center">
4
+ <img src="assets/logo.svg" width="160" alt="hello-cc logo">
5
+ </p>
6
+
7
+ <p align="center">
8
+ <a href="https://github.com/Dullne/hello-cc"><img src="https://img.shields.io/github/stars/Dullne/hello-cc?style=flat-square&color=40c4aa" alt="GitHub stars"></a>
9
+ <a href="https://nodejs.org"><img src="https://img.shields.io/badge/node-%3E%3D24.0.0-brightgreen?style=flat-square" alt="node >=24"></a>
10
+ <a href="./LICENSE"><img src="https://img.shields.io/badge/license-Apache%202.0-blue?style=flat-square" alt="license Apache 2.0"></a>
11
+ </p>
12
+
13
+ <p align="center"><b>English</b> | <a href="README.zh-CN.md">中文</a></p>
14
+
15
+ `hello-cc` connects Claude Code, Codex, and other coding CLI sessions into a
16
+ project-local peer mesh. The command is `hcc`.
17
+
18
+ The default model is a flat peer mesh, not a fixed main/worker topology. Every
19
+ terminal session is a named peer that can see open tasks, receive directed
20
+ messages, hold locks, hand off progress, and be observed or operated from the
21
+ web console.
22
+
23
+ ```text
24
+ <project>/.hello-cc/mesh.db
25
+ ```
26
+
27
+ ## Install
28
+
29
+ **Node 24+ is required** because hello-cc uses built-in `node:sqlite`.
30
+
31
+ Install the CLI globally from npm:
32
+
33
+ ```bash
34
+ npm install -g @logicseek/hello-cc
35
+ ```
36
+
37
+ Or run it without a global install:
38
+
39
+ ```bash
40
+ npx @logicseek/hello-cc web
41
+ ```
42
+
43
+ For local development, run the CLI directly from the checkout:
44
+
45
+ ```bash
46
+ node ./bin/hcc.mjs web
47
+ ```
48
+
49
+ After a global install, both `hcc` and `hello-cc` are available. The examples
50
+ below use `hcc`.
51
+
52
+ ## Default Entry
53
+
54
+ Run one command in the project directory:
55
+
56
+ ```bash
57
+ cd /path/to/project
58
+ hcc web
59
+ ```
60
+
61
+ `hcc web` is the default entrypoint. It automatically:
62
+
63
+ 1. Initializes `.hello-cc/mesh.db` in the current directory
64
+ 2. Writes bounded guidance blocks: `.hello-cc/HCC.md`, `CLAUDE.md`, `AGENTS.md`
65
+ 3. Installs or refreshes Claude Code hooks: `~/.claude/settings.json`
66
+ 4. Installs or refreshes Codex hooks: `~/.codex/hooks.json`
67
+ 5. Installs `~/.hcc-shims/claude` and `~/.hcc-shims/codex`
68
+ 6. Adds `~/.hcc-shims` to the shell PATH
69
+ 7. Ensures `tmux` is available, with best-effort automatic install and a clear
70
+ install command if that fails
71
+ 8. Starts or reuses the global web console, registers the current project,
72
+ prints URL/PID/runtime/log, then returns the terminal to you
73
+
74
+ Example output:
75
+
76
+ ```text
77
+ hello-cc web started in background
78
+ pid: 12345
79
+ project: /path/to/project
80
+ database: /path/to/project/.hello-cc/mesh.db
81
+ runtime: /path/to/project/.hello-cc/runtime.json
82
+ log: /path/to/project/.hello-cc/web.log
83
+ open: http://<machine-ip>:8787/?project=%2Fpath%2Fto%2Fproject
84
+ local: http://127.0.0.1:8787/?project=%2Fpath%2Fto%2Fproject
85
+ shims: installed claude, codex
86
+ PATH updated in ~/.bashrc; open a new terminal or source it
87
+ stop: hcc down
88
+ ```
89
+
90
+ `hcc web` uses a single global web runtime. Running `hcc web` again from
91
+ another project directory does not open another port; it registers that project
92
+ with the same web console. The frontend Project selector switches between
93
+ registered roots. Each project still keeps its own `.hello-cc/mesh.db`, so
94
+ tasks, messages, locks, and peers stay isolated.
95
+
96
+ After the first shim install, open a new terminal or run:
97
+
98
+ ```bash
99
+ source ~/.bashrc
100
+ ```
101
+
102
+ Then direct project-local commands are wrapped automatically:
103
+
104
+ ```bash
105
+ claude
106
+ codex
107
+ claude --resume <session-id>
108
+ codex resume <session-id>
109
+ ```
110
+
111
+ The wrappers create or reuse **local persistent tmux terminals**:
112
+
113
+ - The local terminal attaches to the same tmux session and remains usable.
114
+ - The web console controls the same tmux pane, not a temporary browser-only
115
+ terminal.
116
+ - `hcc down` stops only the web runtime. It does not kill tmux sessions.
117
+ - Running `hcc web` again reattaches live recorded tmux panes.
118
+
119
+ For local coordination without Web or shims, use the lower-level command:
120
+
121
+ ```bash
122
+ hcc up
123
+ ```
124
+
125
+ Most users should start with `hcc web`.
126
+
127
+ ## Project Boundary
128
+
129
+ By default, the project boundary is the **current working directory**. If the
130
+ current directory has no `.hello-cc/mesh.db`, hello-cc creates one on first use:
131
+
132
+ ```text
133
+ /repo-a/.hello-cc/mesh.db
134
+ /repo-a/subdir/.hello-cc/mesh.db
135
+ ```
136
+
137
+ Those are two different projects by default. Sessions communicate naturally
138
+ when they start from the same project path.
139
+
140
+ To share one bus across paths or worktrees, opt in explicitly:
141
+
142
+ ```bash
143
+ hcc --root /path/to/project web
144
+ export HCC_ROOT=/path/to/project
145
+ export HCC_DB=/path/to/project/.hello-cc/mesh.db
146
+ ```
147
+
148
+ hello-cc does not automatically inherit a parent directory's bus. That avoids
149
+ subdirectory sessions joining a broader project by accident.
150
+
151
+ ## Communication Model
152
+
153
+ hello-cc is not point-to-point CLI messaging and does not require MCP. The core
154
+ is a project-local SQLite WAL bus:
155
+
156
+ ```text
157
+ Claude/Codex/plain shell
158
+ -> hooks / hcc commands / web runtime
159
+ -> .hello-cc/mesh.db
160
+ -> peers / tasks / messages / locks / handoffs / events
161
+ -> tmux-backed terminal control
162
+ ```
163
+
164
+ Tasks and messages have different read semantics:
165
+
166
+ - **Tasks** are project facts. Every peer sees tasks until they become `done`
167
+ or `abandoned`. A task does not disappear because one terminal read it.
168
+ - **Messages** are addressed mailbox items. `hcc msg inbox` defaults to unread
169
+ messages for the current peer, and `hcc msg ack` records per-peer read state.
170
+ - `ask` and `broadcast` write durable messages. With `--inject`, they also send
171
+ live input to runtime-attached terminals.
172
+ - Locks use SQLite transactions and TTLs. They are coordination locks, not a
173
+ filesystem sandbox.
174
+
175
+ ## How Claude/Codex Knows Other Sessions
176
+
177
+ The primary path is hook injection, not `CLAUDE.md`.
178
+
179
+ `hcc web` installs Claude Code and Codex hooks. On session start, user prompt
180
+ submit, tool events, and idle events, hooks inject the current hello-cc snapshot
181
+ into the model context:
182
+
183
+ - current peer identity
184
+ - active peer list
185
+ - open tasks
186
+ - unread messages for the current peer
187
+ - active locks
188
+ - suggested commands such as `hcc status`, `hcc peers`, `hcc task list`,
189
+ `hcc msg inbox`, and `hcc lock list`
190
+
191
+ So when an attached Claude/Codex session is asked what other sessions are doing,
192
+ it should answer from the latest hello-cc state instead of generic isolation
193
+ knowledge.
194
+
195
+ If a session still says it cannot know, likely causes are:
196
+
197
+ - `hcc web` has not been run in the project directory
198
+ - the terminal has not loaded `~/.hcc-shims` into PATH
199
+ - Codex hooks are not enabled or the installed hook has not been trusted in
200
+ Codex's hook review flow
201
+ - the CLI was started in a different project directory
202
+ - the session was an already-open raw terminal before hello-cc was installed
203
+ - the provider CLI version did not fire the expected hook
204
+
205
+ To verify Claude Code hook injection directly, run a one-shot debug call from
206
+ the same project:
207
+
208
+ ```bash
209
+ claude -p 'Do you see hello-cc open tasks?' --debug hooks --debug-file /tmp/hcc-claude-hooks.log
210
+ ```
211
+
212
+ The debug log should contain `Hook UserPromptSubmit ... provided
213
+ additionalContext` and the `hello-cc coordination` block. If that is present but
214
+ the model still answers from generic isolation knowledge, restart/resume the
215
+ session through the shim and ask again; hello-cc injects a stronger instruction
216
+ on every new user prompt.
217
+
218
+ ## Web Console
219
+
220
+ Start local and LAN-visible control:
221
+
222
+ ```bash
223
+ hcc web
224
+ ```
225
+
226
+ Use a token only when you want one:
227
+
228
+ ```bash
229
+ HCC_WEB_TOKEN='choose-a-long-token' hcc web --host 0.0.0.0 --port 8787
230
+ ```
231
+
232
+ Open from another machine on the same network:
233
+
234
+ ```text
235
+ http://<machine-ip>:8787/
236
+ ```
237
+
238
+ The web console can:
239
+
240
+ - switch between multiple registered project roots on one port
241
+ - register another project path from the browser and switch to it without
242
+ starting another web server
243
+ - show project state: peers, tasks, messages, locks, handoffs, events
244
+ - operate local terminals: start Claude/Codex/shell, send keyboard input, view
245
+ output, detach runtime control
246
+ - start a new session by choosing only its kind; the browser form generates the
247
+ next project-local alias, uses the selected Project root as the working
248
+ directory, and runs the default command for that kind
249
+
250
+ Browser-controlled sessions are local tmux terminals:
251
+
252
+ - sessions started by the web form: tmux-backed
253
+ - sessions started by `hcc peer start`: tmux-backed
254
+ - direct `claude` / `codex` sessions started through shims: tmux-backed
255
+ - existing tmux panes attached with `hcc peer attach`: tmux-backed
256
+
257
+ Already-open raw terminals cannot be captured or controlled unconditionally
258
+ unless they started under tmux, screen, or a hello-cc shim. They can still
259
+ participate in tasks, messages, and locks through hooks and `hcc` commands.
260
+
261
+ ## Common Commands
262
+
263
+ ```text
264
+ # Default entry
265
+ hcc web [--host HOST] [--port N] [--token TEXT] [--local] [--no-discover] [--no-guidance]
266
+ hcc down
267
+
268
+ # Local coordination without Web
269
+ hcc up [--no-discover] [--no-guidance]
270
+
271
+ # Peers and status
272
+ hcc peers
273
+ hcc status [--peer ID]
274
+ hcc scan [--register]
275
+ hcc prompt --peer ID [--kind codex|claude|shell|other] [--role ROLE]
276
+ hcc join --peer ID [--kind codex|claude|shell|other] [--role ROLE]
277
+ hcc env --peer ID
278
+ hcc heartbeat [--peer ID] [--renew-locks --ttl 900]
279
+ hcc run --peer ID --kind codex|claude|shell --role ROLE -- COMMAND [ARGS...]
280
+
281
+ # Browser-controllable terminals
282
+ hcc peer list
283
+ hcc peer start PEER [--kind K] [--role R] [--cwd DIR] [--restart-env] -- COMMAND [ARGS...]
284
+ hcc peer start PEER --kind codex --resume SESSION_ID [--restart-env]
285
+ hcc peer start PEER --kind codex --last
286
+ hcc peer start PEER --kind claude --resume SESSION_ID [--restart-env]
287
+ hcc peer start PEER --kind claude --continue
288
+ hcc peer attach PEER [--pane PANE] [--kind K] [--role R] [--cwd DIR]
289
+ hcc peer stop PEER
290
+ hcc inject PEER TEXT [--no-enter]
291
+
292
+ # Messages
293
+ hcc msg send [--from ID] [--to ID|all] --body TEXT [--task N] [--kind note|task|handoff]
294
+ hcc msg inbox [--peer ID] [--wait SEC] [--all] [--limit N]
295
+ hcc msg ack [--peer ID] --id N
296
+ hcc ask PEER MESSAGE [--from ID] [--task N] [--inject]
297
+ hcc broadcast MESSAGE [--from ID] [--task N] [--inject]
298
+
299
+ # Tasks
300
+ hcc task create --title TEXT [--body TEXT] [--from ID] [--to ID] [--priority N]
301
+ hcc task list [--status S] [--peer ID] [--all]
302
+ hcc task claim [--peer ID] --id N
303
+ hcc task next [--peer ID]
304
+ hcc task update [--peer ID] --id N --status running|review|blocked|done|abandoned [--summary TEXT] [--body TEXT] [--to ID]
305
+ hcc task done [--peer ID] --id N --summary TEXT
306
+
307
+ # Locks and handoffs
308
+ hcc lock acquire [--peer ID] --resource PATH [--task N] [--ttl SEC] [--reason TEXT]
309
+ hcc lock renew [--peer ID] --resource PATH [--ttl SEC]
310
+ hcc lock release [--peer ID] --resource PATH [--force]
311
+ hcc lock list [--all]
312
+ hcc handoff create [--from ID] --summary TEXT [--task N] [--to ID] [--changed-files JSON_OR_CSV] [--tests TEXT] [--risks TEXT]
313
+ hcc handoff list [--task N] [--limit N]
314
+ hcc event tail [--limit N]
315
+ hcc gc [--older-than DAYS] [--yes]
316
+ ```
317
+
318
+ ## Stable Peer Identity
319
+
320
+ hello-cc tries to keep peer IDs stable across resumed sessions:
321
+
322
+ | Launch pattern | Peer ID |
323
+ |---|---|
324
+ | `claude --resume abc12345...` | `claude-abc12345` |
325
+ | `claude --session-id abc12345...` | `claude-abc12345` |
326
+ | `claude --continue` | terminal-derived ID first, then hooks record real session metadata |
327
+ | `claude --fork-session --resume abc12345...` | terminal-derived ID first, then hooks record new session metadata |
328
+ | `codex resume abc12345...` | `codex-abc12345` |
329
+ | `codex resume --last` | terminal-derived ID first, then discovery records real session metadata |
330
+ | plain shell | `shell-<terminal>` |
331
+ | manual `HCC_PEER=xxx` | uses `xxx` |
332
+
333
+ Known resume IDs keep the same peer ID after restart. Launch modes that do not
334
+ expose the real provider session ID before startup use a terminal-derived ID
335
+ first, then record provider metadata after hooks or discovery run.
336
+
337
+ ## Typical Workflow
338
+
339
+ Create a task:
340
+
341
+ ```bash
342
+ hcc task create --title "Refactor router diagnostics" \
343
+ --body "Keep changes scoped." --priority 20
344
+ ```
345
+
346
+ Claim and lock:
347
+
348
+ ```bash
349
+ hcc task next
350
+ hcc lock acquire --resource vllm/router --ttl 900 --reason "implement diagnostics"
351
+ ```
352
+
353
+ Message or inject:
354
+
355
+ ```bash
356
+ hcc msg send --to claude-a --body "Implementation is ready for review."
357
+ hcc ask claude-a "Please review the current implementation." --inject
358
+ hcc broadcast "Pause edits under vllm/router until this task finishes." --inject
359
+ ```
360
+
361
+ Finish with a handoff:
362
+
363
+ ```bash
364
+ hcc handoff create --to claude-a \
365
+ --summary "Implemented router diagnostics changes." \
366
+ --tests "pytest tests/router" \
367
+ --risks "Full benchmark not run"
368
+
369
+ hcc task done --id 1 --summary "Done and handed off."
370
+ hcc lock release --resource vllm/router
371
+ ```
372
+
373
+ ## Stack
374
+
375
+ ```text
376
+ Node.js >= 24
377
+ node:sqlite + SQLite WAL
378
+ Node HTTP server
379
+ ws WebSocket
380
+ xterm.js
381
+ tmux create/capture/send
382
+ Claude Code hooks
383
+ Codex hooks
384
+ shell shim wrappers
385
+ ```
386
+
387
+ A2A and MCP are not required for the core. A2A is better suited to remote agent
388
+ interoperability, and MCP can be added later as a tool layer. Local multi-CLI
389
+ coordination uses hooks + SQLite + tmux.
390
+
391
+ ## Testing
392
+
393
+ ```bash
394
+ npm test
395
+ ```
396
+
397
+ The regression creates a temporary project, temporary `HOME`, fake
398
+ `claude`/`codex` binaries, a temporary runtime port, and temporary tmux
399
+ sessions. It covers `hcc web` bootstrap, single-port multi-project
400
+ registration, hooks/shims, SQLite coordination, tmux-backed `peer start`
401
+ creation and restore, shim-launched tmux peers, tmux attach, WebSocket terminal
402
+ streaming, terminal injection, runtime shutdown, package dry-run, and old-name
403
+ scanning.
404
+
405
+ ## Architecture
406
+
407
+ ```text
408
+ hcc CLI
409
+ ├── lib/discover.mjs Claude/Codex session discovery
410
+ ├── lib/setup.mjs hooks, shims, PATH installation
411
+ ├── bin/hcc.mjs CLI, SQLite, web runtime, tmux control
412
+ └── .hello-cc/
413
+ ├── mesh.db coordination state
414
+ ├── HCC.md project guidance rules
415
+ ├── runtime.json web runtime discovery file
416
+ └── web.log web runtime log
417
+ ```
418
+
419
+ ## Environment Variables
420
+
421
+ | Variable | Purpose |
422
+ |---|---|
423
+ | `HCC_PEER` | default peer identity |
424
+ | `HCC_ROOT` | override project root |
425
+ | `HCC_DB` | override database path |
426
+ | `HCC_WEB_TOKEN` | optional token for web access |
427
+ | `HCC_RUNTIME_URL` | direct runtime URL |
428
+ | `HCC_NO_AUTO_INSTALL_TMUX=1` | disable tmux auto-install, mainly for tests |
429
+
430
+ The `claude` / `codex` shims and `hcc peer start` create tmux-backed sessions
431
+ from the environment of the **local terminal that launched them**, not from the
432
+ older environment of the background web runtime. This lets you open a new
433
+ terminal, export provider variables such as `ANTHROPIC_*` or
434
+ `CLAUDE_CODE_*`, then run `claude` / `codex`.
435
+
436
+ An already-running CLI process cannot have its environment changed in place by
437
+ the operating system. The `claude` / `codex` shims call `hcc peer start` with
438
+ `--restart-env`, so hello-cc records a launch environment fingerprint for the
439
+ same resume/session peer. If you start that peer again from a new terminal and
440
+ the environment changed, hello-cc automatically restarts the tmux session with
441
+ the new environment when there are no attached tmux clients or Web clients. If
442
+ the session is actively attached, hello-cc asks you to detach/close Web clients
443
+ or run `hcc peer stop <peer>` before starting it again.
444
+
445
+ When you call `hcc peer start` directly, add `--restart-env` if you want the
446
+ same restart-on-environment-change behavior.
447
+
448
+ The shims only manage interactive terminal sessions. Metadata and maintenance
449
+ commands pass through to the real provider CLI, including `claude --help`,
450
+ `claude --version`, `claude --print`, `claude --bare`, `claude --safe-mode`,
451
+ `codex --help`, `codex --version`, and non-interactive Codex subcommands such as
452
+ `codex exec`, `codex review`, `codex doctor`, and `codex mcp`. Interactive
453
+ `claude`, `claude --resume ...`, `codex`, `codex resume ...`, and `codex fork
454
+ ...` are tmux-backed and visible in the Web console.
455
+
456
+ ---
457
+
458
+ <p align="center">
459
+ <a href="https://star-history.com/#Dullne/hello-cc&Date">
460
+ <img src="https://api.star-history.com/svg?repos=Dullne/hello-cc&type=Date" width="600" alt="Star History Chart">
461
+ </a>
462
+ </p>