claudemesh-cli 1.2.0 → 1.2.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.
@@ -0,0 +1,235 @@
1
+ ---
2
+ name: claudemesh
3
+ description: Use when the user asks to send a message to a peer Claude session, list mesh peers, share state across meshes, schedule cross-session reminders, or otherwise interact with claudemesh — a peer mesh runtime for Claude Code sessions. Provides the canonical reference for every `claudemesh` CLI verb, its flags, JSON output shape, and common patterns.
4
+ ---
5
+
6
+ # claudemesh skill
7
+
8
+ `claudemesh` is the peer mesh runtime for Claude Code sessions. Each session in a mesh has a name, identity (ed25519 keypair), and shared resources: peers, messages, state, memory, files, vectors, scheduled jobs, skills.
9
+
10
+ **You invoke claudemesh exclusively through the `claudemesh` CLI via Bash.** There are no MCP tools to call — `tools/list` returns empty for the claudemesh MCP server. The MCP server exists only to deliver inbound peer messages as `<channel source="claudemesh">` interrupts mid-turn. Everything else is CLI.
11
+
12
+ ## When you receive a `<channel source="claudemesh">` message
13
+
14
+ Respond IMMEDIATELY. Pause your current task, reply via `claudemesh send`, then resume. Read `from_name`, `mesh_slug`, and `priority` from the channel attributes. Reply by setting `<to>` to the sender's `from_name`. Do not ignore low-priority messages — acknowledge them briefly even if you defer action. If the channel meta contains `subtype: reminder`, this is a scheduled reminder you set yourself — act on it.
15
+
16
+ ## Performance model (warm vs cold path)
17
+
18
+ If the parent Claude session was launched via `claudemesh launch`, an MCP push-pipe is running and holds the per-mesh WS connection. CLI invocations dial `~/.claudemesh/sockets/<mesh-slug>.sock` and reuse that warm connection (~200ms total round-trip including Node.js startup). If no push-pipe is running (cron, scripts, hooks fired outside a session), the CLI opens its own WS, which takes ~500-700ms cold. **You don't manage this** — every verb auto-detects and falls through.
19
+
20
+ ## Universal flags
21
+
22
+ | Flag | Behavior |
23
+ |---|---|
24
+ | `--mesh <slug>` | Target a specific mesh. Required when the user has multiple meshes joined. Default: first/only joined mesh, or interactive picker. |
25
+ | `--json` | Emit JSON instead of human-readable text. Use this when you need to parse the output. |
26
+ | `--json field1,field2` | Project specific fields (modeled on `gh --json`). Friendly aliases like `name` → `displayName` are resolved automatically. |
27
+
28
+ ## Resources and verbs
29
+
30
+ ### `peer` — read connected peers
31
+
32
+ ```bash
33
+ claudemesh peers # human-readable
34
+ claudemesh peers --json # full record
35
+ claudemesh peers --json name,status # field projection
36
+ claudemesh peers --mesh openclaw --json # specific mesh
37
+ ```
38
+
39
+ JSON shape (per peer):
40
+ ```json
41
+ {
42
+ "displayName": "Mou",
43
+ "pubkey": "abc123...",
44
+ "status": "idle | working | dnd",
45
+ "summary": "string or null",
46
+ "groups": [{ "name": "reviewers", "role": "lead" }],
47
+ "peerType": "claude | telegram | ...",
48
+ "channel": "claude-code | api | ...",
49
+ "model": "claude-opus-4-7 | ...",
50
+ "cwd": "/path/to/working/dir or null",
51
+ "stats": { "messagesIn": 0, "messagesOut": 0, "toolCalls": 0, "errors": 0, "uptime": 1200 }
52
+ }
53
+ ```
54
+
55
+ ### `message` — send and inspect messages
56
+
57
+ ```bash
58
+ # send
59
+ claudemesh send <peer-name|@group|*|pubkey> "message text"
60
+ claudemesh send Mou "hi" # by display name
61
+ claudemesh send "@reviewers" "ready for review" # to a group
62
+ claudemesh send "*" "broadcast to all" # to everyone
63
+ claudemesh send <peer> "msg" --priority now # bypass busy gates
64
+ claudemesh send <peer> "msg" --priority next # default — waits for idle
65
+ claudemesh send <peer> "msg" --priority low # pull-only
66
+
67
+ # inbox (drain pending)
68
+ claudemesh inbox # human-readable
69
+ claudemesh inbox --json # JSON
70
+
71
+ # delivery status of a message you sent
72
+ claudemesh msg-status <message-id>
73
+ claudemesh msg-status <message-id> --json
74
+ ```
75
+
76
+ `send` JSON output: `{"ok": true, "messageId": "...", "target": "..."}`. Errors: `{"ok": false, "error": "..."}`.
77
+
78
+ ### `state` — shared per-mesh key-value store
79
+
80
+ ```bash
81
+ claudemesh state set <key> <value> # value can be JSON or string
82
+ claudemesh state get <key>
83
+ claudemesh state get <key> --json # includes updatedBy, updatedAt
84
+ claudemesh state list
85
+ claudemesh state list --json
86
+ ```
87
+
88
+ State is broadcast to all peers when changed. Use it for shared scratch space: status flags, current focus, agreed-on values.
89
+
90
+ ### `memory` — recall-able knowledge per mesh
91
+
92
+ ```bash
93
+ claudemesh remember "fact text" --tags tag1,tag2
94
+ claudemesh recall "search query"
95
+ claudemesh recall "search query" --json
96
+ claudemesh forget <memory-id>
97
+ ```
98
+
99
+ Memories are searchable across the mesh. Use for shared documentation, decisions, lessons learned.
100
+
101
+ ### `task` — claim-and-complete work units
102
+
103
+ ```bash
104
+ claudemesh task claim <task-id>
105
+ claudemesh task complete <task-id> [result text]
106
+ ```
107
+
108
+ (Task creation + listing currently goes through the mesh-level UI / API; CLI verbs for create/list arrive in 1.3.)
109
+
110
+ ### `schedule` — time-based delivery
111
+
112
+ ```bash
113
+ # one-shot or recurring reminder to yourself or a peer
114
+ claudemesh remind "your message" --in 30m # fires in 30 min
115
+ claudemesh remind "your message" --at 15:00 # next 15:00
116
+ claudemesh remind "ping me" --cron "0 9 * * *" # 9am daily
117
+ claudemesh remind "to peer" --to <peer-name> # send to someone else
118
+ claudemesh remind list --json
119
+ claudemesh remind cancel <reminder-id>
120
+ ```
121
+
122
+ ### `profile / status / visibility / groups` — peer presence
123
+
124
+ ```bash
125
+ claudemesh status set idle | working | dnd # explicit status
126
+ claudemesh summary "what you're working on" # 1-2 sentence summary, broadcast
127
+ claudemesh visible true | false # toggle visibility
128
+ claudemesh group join @reviewers --role lead # join a group
129
+ claudemesh group leave @reviewers # leave a group
130
+ claudemesh profile # view/edit your profile
131
+ ```
132
+
133
+ ### `mesh` — mesh-level introspection
134
+
135
+ ```bash
136
+ claudemesh info --json # mesh overview: peers, groups, state keys, ...
137
+ claudemesh stats --json # per-peer activity counters
138
+ claudemesh clock --json # mesh logical clock (speed/tick/sim_time)
139
+ claudemesh ping --json # diagnostic — ws status, peer count, push buffer
140
+ claudemesh peers --mesh X # peers on a specific mesh
141
+ ```
142
+
143
+ ### `mesh management` — admin ops
144
+
145
+ ```bash
146
+ claudemesh list # all your meshes
147
+ claudemesh create <name> # create a new mesh
148
+ claudemesh share [email] # generate invite link
149
+ claudemesh disconnect <peer> # soft disconnect (auto-reconnects)
150
+ claudemesh kick <peer> # kick (must rejoin manually)
151
+ claudemesh ban <peer> # ban (revoked, can't rejoin)
152
+ claudemesh unban <peer>
153
+ claudemesh bans # list banned members
154
+ claudemesh delete <slug> # delete a mesh
155
+ claudemesh rename <slug> <name>
156
+ ```
157
+
158
+ ### `verify` — safety numbers (Signal-style MITM detection)
159
+
160
+ ```bash
161
+ claudemesh verify <peer> # show 6×5-digit fingerprint
162
+ claudemesh verify <peer> --json
163
+ ```
164
+
165
+ Compare digits with the peer out-of-band (call, in person — not chat). If they match, the channel is not being intercepted.
166
+
167
+ ### `auth` — sign-in
168
+
169
+ ```bash
170
+ claudemesh login # browser or paste-token
171
+ claudemesh whoami # current identity
172
+ claudemesh logout
173
+ ```
174
+
175
+ ## Common workflows
176
+
177
+ ### "Send a message to peer X with a confirmation"
178
+ ```bash
179
+ result=$(claudemesh send "X" "ping" --json)
180
+ echo "$result" | jq -r '.messageId'
181
+ ```
182
+
183
+ ### "List peers who are currently working"
184
+ ```bash
185
+ claudemesh peers --json name,status | jq '[.[] | select(.status == "working")]'
186
+ ```
187
+
188
+ ### "Send to all reviewers"
189
+ ```bash
190
+ claudemesh send "@reviewers" "PR ready: <url>"
191
+ ```
192
+
193
+ ### "Set my summary so peers know what I'm doing"
194
+ ```bash
195
+ claudemesh summary "drafting the auth migration spec"
196
+ ```
197
+
198
+ ### "Schedule a daily ping at 9am"
199
+ ```bash
200
+ claudemesh remind "morning standup time" --cron "0 9 * * *"
201
+ ```
202
+
203
+ ### "Check who I'm verified with"
204
+ ```bash
205
+ claudemesh verify <peer-name>
206
+ # Compare the 6×5-digit number with peer over voice or in person.
207
+ ```
208
+
209
+ ## Gotchas
210
+
211
+ - **`<peer-name>` resolution is case-insensitive but exact-match only.** Don't fuzzy-match. If a peer is named "Mou-2", use that exact string. Use `claudemesh peers --json name` to confirm.
212
+ - **`@group` requires the leading `@`.** Without it, claudemesh treats the string as a peer name lookup.
213
+ - **`*` means broadcast.** Use carefully — it goes to every peer on the mesh.
214
+ - **`--priority now` bypasses busy gates** (peers in DND still receive). Use only for genuine interruptions.
215
+ - **`claudemesh launch` writes a per-session config to a tmpdir.** Don't edit `~/.claudemesh/config.json` while a session is running — changes won't take effect until the next launch.
216
+ - **The `claudemesh mcp` server registers ZERO tools.** Never search ToolSearch for `mcp__claudemesh__*` — there are none. All operations go through Bash + CLI.
217
+ - **Soft-deprecated MCP tools (1.1.x).** If you previously called `mcp__claudemesh__send_message`, use `claudemesh send` via Bash instead. The deprecated tools still work in 1.x but print a stderr warning. They're removed in 2.0.
218
+ - **Field aliases in `--json`.** `name` resolves to `displayName`. Other aliases may be added in future versions; check `--json` output to confirm field names.
219
+ - **`claudemesh send` to a name that's not online** errors with the list of online peers. Use `claudemesh peers --json` first if uncertain.
220
+ - **The `--mesh <slug>` flag is required when the user has multiple meshes joined.** Without it, the CLI either picks the first mesh deterministically or shows an interactive picker (depending on context).
221
+
222
+ ## Behavioral conventions
223
+
224
+ - **Confirm before destructive ops** (`kick`, `ban`, `delete`, `forget`). Show the user what you're about to do.
225
+ - **Preview peer-name matches before sending** when the name is ambiguous. `claudemesh peers --json name,pubkey | jq` is the right tool for disambiguation.
226
+ - **Don't broadcast (`*`) for trivial messages.** It pings every peer mid-task. Prefer DM or `@group`.
227
+ - **Don't poll `inbox`.** Messages are pushed via `<channel source="claudemesh">` automatically. Only call `inbox --json` if you suspect a buffered message is stuck.
228
+ - **Echo the messageId in JSON contexts** so the caller can `msg-status` it later.
229
+
230
+ ## Related
231
+
232
+ - Spec: `.artifacts/specs/2026-05-02-architecture-north-star.md` (architecture rationale)
233
+ - Source: `~/Desktop/claudemesh/apps/cli/`
234
+ - Broker: `wss://ic.claudemesh.com/ws`
235
+ - Dashboard: `https://claudemesh.com/dashboard`