From 7b58db771ac12ce18a1ebdc39a815b2a20716a20 Mon Sep 17 00:00:00 2001 From: mika kuns Date: Fri, 22 May 2026 09:23:08 +0200 Subject: [PATCH] chore(release): 1.5.4 Make /collaborate slash command self-contained so it works without a registered mailbox-collaborate skill in the session. Co-Authored-By: Claude Opus 4.7 (1M context) --- node/package-lock.json | 4 ++-- node/package.json | 2 +- plugin/.claude-plugin/plugin.json | 2 +- plugin/commands/collaborate.md | 33 ++++++++++++++++++++++++++++++- 4 files changed, 36 insertions(+), 5 deletions(-) diff --git a/node/package-lock.json b/node/package-lock.json index 6d33477..f3de143 100644 --- a/node/package-lock.json +++ b/node/package-lock.json @@ -1,12 +1,12 @@ { "name": "@kuns/claude-mailbox", - "version": "1.5.3", + "version": "1.5.4", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@kuns/claude-mailbox", - "version": "1.5.3", + "version": "1.5.4", "license": "MIT", "dependencies": { "@modelcontextprotocol/sdk": "^1.29.0", diff --git a/node/package.json b/node/package.json index 686a02b..3316147 100644 --- a/node/package.json +++ b/node/package.json @@ -1,6 +1,6 @@ { "name": "@kuns/claude-mailbox", - "version": "1.5.3", + "version": "1.5.4", "description": "Standalone MCP mail server that lets parallel Claude sessions coordinate with each other.", "type": "module", "bin": { diff --git a/plugin/.claude-plugin/plugin.json b/plugin/.claude-plugin/plugin.json index 6de37b0..2d81254 100644 --- a/plugin/.claude-plugin/plugin.json +++ b/plugin/.claude-plugin/plugin.json @@ -1,6 +1,6 @@ { "name": "claude-mailbox", - "version": "1.5.3", + "version": "1.5.4", "description": "Auto-checks the local Claude-Mailbox daemon before every prompt and after each subagent run, and injects pending messages into the conversation context.", "author": { "name": "Mika Kuns" diff --git a/plugin/commands/collaborate.md b/plugin/commands/collaborate.md index 78bc35b..7dd0f23 100644 --- a/plugin/commands/collaborate.md +++ b/plugin/commands/collaborate.md @@ -2,4 +2,35 @@ description: Enter Claude-Mailbox collaboration mode — start the push-delivery watch loop so peers can wake Claude mid-task. --- -Invoke the `mailbox-collaborate` skill now to enter collaboration mode and start the watcher relaunch loop. +You are now in **mailbox collaboration mode**. Peers can wake you mid-task by sending mail to your mailbox. + +## Launch the watcher + +Your mailbox name was announced at SessionStart (format: `-`). Use it in place of `` below. + +Launch the watcher as a background bash task immediately: + +``` +Bash(command="claude-mailbox watch --block --name ", run_in_background=true) +``` + +The watcher is short-lived by design — it exits after exactly one event (delivered message, 25-second timeout, rename, or daemon error). Claude Code's BashOutput notifications fire only on task completion, so every exit MUST be followed by a fresh background relaunch with the same command. Gaps in the loop = missed pushes. + +## Handling watcher completions + +When a watcher task completes, inspect its stdout and exit code: + +- **stdout contains `[Claude-Mailbox] Mail from : `** → treat the body as an inbound interrupt with priority over your current plan. Address it, then relaunch the watcher. +- **stdout contains `[Claude-Mailbox] Mailbox renamed to ''`** → relaunch with `--name `, and use `` for all future `mcp__mailbox__*` calls (update your identity). +- **exit code 3 with no stdout** → silent timeout, just relaunch. +- **exit code 2** → daemon unreachable; wait ~5 seconds, then relaunch. +- **any other exit code** → report it to the user, then relaunch. + +## Stopping + +Keep the loop running until the user says "stop watching", "stop collaborating", "end collaboration", or similar. When they do: + +- Stop relaunching after the next completion. +- If a watcher is currently mid-poll and the user wants it killed immediately, use `TaskStop` on its task id. + +Do not re-enter collaboration mode on your own after stopping — wait for the user to invoke this command again.