Files
ClaudeMailbox/plugin/README.md
Mika Kuns 5c5843e62d feat(plugin): ship Claude Code plugin + marketplace manifest
Adds a /plugin marketplace at the repo root and a `claude-mailbox` plugin under
plugin/ that wires the UserPromptSubmit hook without needing the per-user
`install-hook` step. The hook command (`claude-mailbox check --hook`) now reads
the mailbox name from $CLAUDE_MAILBOX_NAME when --name is omitted and emits a
one-line setup hint when the daemon is unreachable, so a missing daemon is loud
instead of invisible.

The plugin only contains the Claude Code glue — the daemon binary is still a
separate prerequisite (`npm i -g @kuns/claude-mailbox` + install-autostart),
and the plugin/README plus main README spell out the three-step setup.
2026-05-19 10:49:36 +02:00

69 lines
1.9 KiB
Markdown

# claude-mailbox plugin
Lets Claude Code automatically pull unread messages from a local `claude-mailbox` daemon before every prompt and inject them into the conversation context.
## Three-step setup
The Claude Code plugin itself is just the glue — you still need the daemon binary on PATH and a mailbox name.
### 1. Install the daemon (one-time, per machine)
```sh
npm config set @kuns:registry=https://git.kuns.dev/api/packages/releases/npm/
npm install -g @kuns/claude-mailbox
claude-mailbox install-autostart # registers per-OS autostart (no admin needed by default)
```
Verify with:
```sh
claude-mailbox status # expect: Running
```
### 2. Install the plugin
In Claude Code:
```
/plugin marketplace add https://git.kuns.dev/releases/ClaudeMailbox
/plugin install claude-mailbox@claude-mailbox
```
### 3. Choose a mailbox name
Set the env var Claude Code will inherit (any unique name — your username, machine name, whatever):
```sh
# Windows (PowerShell, persistent)
setx CLAUDE_MAILBOX_NAME alice
# macOS / Linux (add to ~/.zshrc or ~/.bashrc)
export CLAUDE_MAILBOX_NAME=alice
```
Restart Claude Code so the new env var is picked up.
## What happens at runtime
Before every prompt the plugin runs `claude-mailbox check --hook`, which:
- prints unread mailbox messages in a Claude-friendly format and marks them delivered,
- stays **silent** when the inbox is empty or `CLAUDE_MAILBOX_NAME` is not set,
- emits a one-line setup hint when the daemon is unreachable (so missing step 1 is loud).
## Sending yourself a message (smoke test)
```sh
claude-mailbox send --from probe --to alice --body "hello from the CLI"
```
Then start a new Claude Code session — the message should appear in context before Claude's first reply.
## Uninstall
```
/plugin uninstall claude-mailbox@claude-mailbox
npm uninstall -g @kuns/claude-mailbox
claude-mailbox uninstall-autostart # if you used it
```