Claude Skill

pigeon

Inter-session pmail - send and receive messages between Claude Code sessions running in different project directories. Uses global SQLite database at ~/.claude/pmail.db. Triggers on: mail, pmail, send message, check mail, inbox, inter-session, message another session, pigeon.

LLM Mart · 0 points · 1 views 0 listing impressions 0 install-command copies
Download 0xDarkMatter-claude-mods-skills_pigeon-6aef525.zip · 34 KB

Install

skills CLI npx skills add https://github.com/0xDarkMatter/claude-mods/tree/main/skills/pigeon
Claude Code claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install 0xdarkmatter-claude-mods@llmmart
Git git clone https://github.com/0xDarkMatter/claude-mods.git

The skills CLI installs just this skill, for any of its supported agents. Claude Code installs the whole 0xdarkmatter/claude-mods collection as a plugin from our marketplace. Git is the plain clone.

Skill manifest

Pigeon

Inter-session messaging for Claude Code. Send and receive pmail between sessions running in different projects.

Quick Reference

All commands go through MAIL, a shorthand for bash "$HOME/.claude/pigeon/mail-db.sh".

Set this at the top of execution:

MAIL="$HOME/.claude/pigeon/mail-db.sh"

Then use it for all commands below.

Command Router

Parse the user's input after pigeon (or /pigeon) and run the matching command:

User says Run
pigeon read bash "$MAIL" read
pigeon read 42 bash "$MAIL" read 42
pigeon thread 42 bash "$MAIL" thread 42 (shows, does not mark read)
pigeon send <project> "<subject>" "<body>" bash "$MAIL" send "<project>" "<subject>" "<body>"
pigeon send --urgent <project> "<subject>" "<body>" bash "$MAIL" send --urgent "<project>" "<subject>" "<body>"
pigeon send --attach <path> <project> "<subject>" "<body>" bash "$MAIL" send --attach "<path>" "<project>" "<subject>" "<body>"
pigeon reply <id> "<body>" bash "$MAIL" reply <id> "<body>"
pigeon reply --attach <path> <id> "<body>" bash "$MAIL" reply --attach "<path>" <id> "<body>"
pigeon broadcast "<subject>" "<body>" bash "$MAIL" broadcast "<subject>" "<body>"
pigeon search <keyword> bash "$MAIL" search "<keyword>"
pigeon status bash "$MAIL" status
pigeon unread bash "$MAIL" unread
pigeon list bash "$MAIL" list
pigeon list 50 bash "$MAIL" list 50
pigeon projects bash "$MAIL" projects
pigeon clear bash "$MAIL" clear
pigeon clear 7 bash "$MAIL" clear 7
pigeon alias <old> <new> bash "$MAIL" alias "<old>" "<new>"
pigeon purge bash "$MAIL" purge
pigeon purge --all bash "$MAIL" purge --all
pigeon id bash "$MAIL" id
pigeon migrate bash "$MAIL" migrate
pigeon init bash "$MAIL" init

When the user just says "check mail", "read mail", "inbox", "any mail?", or "any pmail?" - run bash "$MAIL" read.

When the user says "send mail to X", "send pmail to X", or "message X" - parse out the project name, subject, and body, then run bash "$MAIL" send.

Project Identity

Each project gets a stable 6-character hash ID derived from its git root commit (the very first commit in the repo). This means:

  • IDs survive directory renames, moves, and clones
  • Case-insensitive filesystems (macOS) don't cause collisions
  • Every clone of the same repo shares the same identity

For non-git directories, falls back to a hash of the canonical path (pwd -P).

A repo's git worktrees share its root commit, so they share its ID: every session in the repo, the main checkout and each lane alike, reads one inbox. See Shared Inboxes.

Use pigeon id to see your project's name and hash:

claude-mods 7663d6

When sending messages, you can address projects by name, hash, or path - they all resolve to the same hash ID.

Identicons

Each project hash renders as a unique pixel-art identicon (11x11 symmetric grid using Unicode half-block characters). Run identicon.sh to see yours, or view all projects with pigeon projects.

Passive Notification (Hook)

A global PreToolUse hook checks for pmail on every tool call (no cooldown). Silent when inbox is empty. When mail is waiting it prints one JSON envelope, and Claude Code passes its additionalContext to the model:

{"hookSpecificOutput":{"hookEventName":"PreToolUse","additionalContext":"=== INCOMING PMAIL (1 message(s)) ===\n..."}}

What the model reads:

=== INCOMING PMAIL (1 message(s)) ===

--- #42 from some-api (a1b2c3) @ 2026-09-30 10:12:04 ---
Subject: Auth endpoints ready
Login and refresh are live on staging.

=== ACTION REQUIRED: Inform the user about these messages and ask if they want to reply. ===
=== Then run: pigeon read (to mark as read) ===
=== To reply: pigeon reply <id> "message" ===

The JSON form is required. For PreToolUse, plain stdout goes to Claude Code's debug log and never reaches the model. Claude Code caps additionalContext at 10,000 chars, so the hook truncates message bodies at about 9,000 and points at pigeon read. The header and footer are always kept. Delivery does not mark mail read.

Each session is told about each message once. The signal file /tmp/pigeon_signal_<hash> is a timestamp that every send touches and nothing deletes. Each session keeps its own marker, /tmp/pigeon_seen_<hash>_<session_id>, holding the last message id it was shown. The fast path compares the two file times, so an empty inbox still costs one stat. The session id comes from the hook's stdin JSON; without one (a manual run), callers share an anon marker.

Shared Inboxes (Worktrees)

Every session in a project reads one inbox, and a repo's worktrees are the same project. That is what makes lane-to-coordinator reporting work (pigeon send claude-mods "READY lane/<x> <sha>" from a lane reaches the session in the main checkout), and pigeon keeps it safe:

  • You are never handed your own mail. Each message stores its sender's session (CLAUDE_CODE_SESSION_ID, the same id the hook gets). The hook and read, count, unread and status skip mail the calling session sent, so a lane's report waits for the others.
  • One session looking never hides mail from another. Delivery is tracked per session (above). Earlier versions cleared the shared signal on delivery, so the lane that sent a report consumed the coordinator's wake-up.
  • Reading is still shared. pigeon read marks mail read for the whole project. Inside a worktree the hook's footer says so: mark only mail meant for you, one at a time (pigeon read <id>); pigeon thread <id> shows a message without marking it.
  • Names can collide. A name is a directory basename, so two repos can share one. Pigeon then warns on stderr, lists each candidate hash, and uses the sender's own project if it is one of them. Send by hash to choose (pigeon projects lists them).

Concurrency

pmail.db is shared by every session on the machine, and the hook reads it on every tool call. Pigeon is built for that:

  • A failed write is safe to retry. send, reply and broadcast commit everything or nothing. A broadcast reaches every project or none, so retrying a failed one never delivers twice.
  • Queries wait for locks. Each one waits up to 5 s for another connection's lock (the hook 2 s) instead of failing at once with database is locked.
  • Readers never block writers. The database switches itself to WAL mode once, so a slow or stuck reader can't hold up a send. pmail.db-wal and pmail.db-shm sit beside it while sessions use it; on macOS they stay there between uses.
  • No query runs for long. Where GNU timeout is on PATH (Linux, Git Bash), a query is killed after 30 s, or 4 s in the hook, which runs under a 5 s hook timeout. The hook makes the same few queries however much mail is waiting.

Attachments

Send file references with --attach <path> (repeatable). Paths are resolved to absolute and stored as references - files are not copied.

# Send with one attachment
pigeon send --attach src/config.ts my-api "Config update" "Updated the auth config"

# Send with multiple attachments
pigeon send --attach src/schema.sql --attach docs/API.md my-api "Schema + docs" "See attached"

# Reply with attachment
pigeon reply --attach output/report.json 42 "Here's the analysis"

Recipients see attachment paths with file sizes and can read them directly with the Read tool. If a file has been moved or deleted since sending, it shows as (missing).

When to Send

  • You've completed work another session depends on
  • An API contract or shared interface changed
  • A shared branch (main) is broken or fixed
  • You need input from a session working on a different project

Per-Project Disable

touch .claude/pigeon.disable    # Disable hook notifications
rm .claude/pigeon.disable       # Re-enable

Only the hook is disabled - you can still send messages from the project.


Installation

Pigeon requires two things: scripts (the mail engine) and a hook (passive notifications). Both install globally - one setup, every project gets pmail.

Prerequisites

  • sqlite3 - ships with macOS, most Linux distros, and Git Bash on Windows. No install needed.
  • jq - the hook uses it to build the JSON envelope Claude Code requires (brew install jq, scoop install jq, apt install jq). Without jq the hook stays silent, and pigeon read still works.

Step 1: Copy Scripts

mkdir -p ~/.claude/pigeon
cp skills/pigeon/scripts/mail-db.sh ~/.claude/pigeon/
cp hooks/check-mail.sh ~/.claude/pigeon/
chmod +x ~/.claude/pigeon/mail-db.sh ~/.claude/pigeon/check-mail.sh

This gives you the pmail commands. You can now send and read messages manually:

bash ~/.claude/pigeon/mail-db.sh init      # Create database
bash ~/.claude/pigeon/mail-db.sh status    # Check it works

Step 2: Enable the Hook

Add a hooks block to ~/.claude/settings.json. This makes Claude check for pmail automatically on every tool call:

{
  "hooks": {
    "PreToolUse": [
      {
        "matcher": "*",
        "hooks": [
          {
            "type": "command",
            "command": "bash \"$HOME/.claude/pigeon/check-mail.sh\"",
            "timeout": 5
          }
        ]
      }
    ]
  }
}

Important: If you already have a hooks section in your settings, merge the PreToolUse entry into the existing array - don't replace the whole block.

Without this step, pigeon still works but you have to check manually (pigeon read). With the hook, unread pmail appears automatically.

What Gets Created

~/.claude/
  settings.json            # Hook config (you edit this)
  pmail.db                 # Message store (auto-created on first use)
  pmail.db-wal, -shm       # WAL files: present while in use (macOS keeps them)
  pigeon/
    mail-db.sh             # All pmail commands (send, read, reply, etc.)
    check-mail.sh          # PreToolUse hook (silent when inbox empty)

Verify

Run these in a terminal. Inside a Claude Code session, read skips mail that session sent, so a message to yourself stays unread.

# Check your project identity
bash ~/.claude/pigeon/mail-db.sh id

# Send yourself a test message (use your project name from above)
bash ~/.claude/pigeon/mail-db.sh send "my-project" "Test" "Hello from pigeon"

# Check it arrived
bash ~/.claude/pigeon/mail-db.sh read

# Clean up
bash ~/.claude/pigeon/mail-db.sh purge --all

Uninstall

rm -rf ~/.claude/pigeon ~/.claude/pmail.db ~/.claude/pmail.db-wal ~/.claude/pmail.db-shm
# Then remove the hooks.PreToolUse entry from ~/.claude/settings.json

Database

Single SQLite file at ~/.claude/pmail.db, in WAL mode (see Concurrency). Auto-created on first init or send. To copy it, use sqlite3 ~/.claude/pmail.db ".backup pmail-copy.db", not cp: the newest writes can still sit in pmail.db-wal.

CREATE TABLE messages (
    id INTEGER PRIMARY KEY AUTOINCREMENT,
    from_project TEXT NOT NULL,   -- 6-char hash ID
    to_project TEXT NOT NULL,     -- 6-char hash ID
    subject TEXT DEFAULT '',
    body TEXT NOT NULL,
    timestamp TEXT DEFAULT (datetime('now')),
    read INTEGER DEFAULT 0,
    priority TEXT DEFAULT 'normal',
    thread_id INTEGER REFERENCES messages(id),
    attachments TEXT DEFAULT '',  -- newline-separated absolute paths
    from_session TEXT DEFAULT ''  -- sender's CLAUDE_CODE_SESSION_ID, '' outside a session
);

CREATE TABLE projects (
    hash TEXT PRIMARY KEY,        -- 6-char ID (git root commit or path hash)
    name TEXT NOT NULL,           -- Display name (basename of project dir)
    path TEXT NOT NULL,           -- Canonical path
    registered TEXT DEFAULT (datetime('now'))
);

Troubleshooting

Issue Fix
sqlite3: not found Ships with macOS, Linux, and Git Bash on Windows. Run sqlite3 --version to check.
Hook not firing Ensure hooks block is in ~/.claude/settings.json (Step 2 above)
Hook fires but no notification Working as intended - hook is silent when inbox is empty
Mail is unread but Claude never mentions it The hook must print JSON additionalContext, because plain PreToolUse stdout only reaches the debug log. Reinstall check-mail.sh from this repo and check jq --version
Messages not arriving Target must be a known name, hash, or path. Use pigeon projects to see registered projects
A lane's report never reached the coordinator Install the current check-mail.sh and mail-db.sh together. Older hooks cleared the shared signal when the lane saw its own report, and an older read marked it read
Warning: 2 projects are named '...' Two directories share a basename. Send by the hash the warning lists
database is locked A connection held a lock past the 5 s wait. Look for a stuck sqlite3 (tasklist /FI "IMAGENAME eq sqlite3.exe" on Windows, pgrep -l sqlite3 elsewhere) or a database browser with pmail.db open. The failed command sent nothing, so retry it
~/.claude is on a network drive WAL needs shared memory that network filesystems don't provide. Switch back once with sqlite3 ~/.claude/pmail.db "PRAGMA journal_mode=DELETE"; pigeon won't switch it again. Never share one pmail.db between WSL and Windows
Upgraded from basename IDs Run pigeon migrate to convert old messages to hash-based IDs
Changed display name Use pigeon alias old-name new-name to update the project's display name
Want to disable for one project touch .claude/pigeon.disable in that project's root
Check your project ID Run pigeon id to see name and 6-char hash
Files (claude-mods)
  • assets
    • .gitkeep 0 B · in bundle
  • references
    • .gitkeep 0 B · in bundle
  • scripts
    • identicon.sh 4.9 KB
      Loading…
    • mail-db.sh 37.7 KB
      Loading…
    • test-mail.sh 25.7 KB
      Loading…
  • tests
    • run.sh 22.9 KB
      Loading…
  • SKILL.md 14 KB
    ---
    name: pigeon
    description: "Inter-session pmail - send and receive messages between Claude Code sessions running in different project directories. Triggers on: mail, pmail, send message, check mail, inbox, inter-session, message another session, pigeon."
    license: MIT
    allowed-tools: "Read Bash Grep"
    metadata:
      author: claude-mods
      related-skills: sqlite-ops
    ---
    
    # Pigeon
    
    Inter-session messaging for Claude Code. Send and receive pmail between sessions running in different projects.
    
    ## Quick Reference
    
    All commands go through `MAIL`, a shorthand for `bash "$HOME/.claude/pigeon/mail-db.sh"`.
    
    Set this at the top of execution:
    
    ```bash
    MAIL="$HOME/.claude/pigeon/mail-db.sh"
    ```
    
    Then use it for all commands below.
    
    ## Command Router
    
    Parse the user's input after `pigeon` (or `/pigeon`) and run the matching command:
    
    | User says | Run |
    |-----------|-----|
    | `pigeon read` | `bash "$MAIL" read` |
    | `pigeon read 42` | `bash "$MAIL" read 42` |
    | `pigeon thread 42` | `bash "$MAIL" thread 42` (shows, does not mark read) |
    | `pigeon send <project> "<subject>" "<body>"` | `bash "$MAIL" send "<project>" "<subject>" "<body>"` |
    | `pigeon send --urgent <project> "<subject>" "<body>"` | `bash "$MAIL" send --urgent "<project>" "<subject>" "<body>"` |
    | `pigeon send --attach <path> <project> "<subject>" "<body>"` | `bash "$MAIL" send --attach "<path>" "<project>" "<subject>" "<body>"` |
    | `pigeon reply <id> "<body>"` | `bash "$MAIL" reply <id> "<body>"` |
    | `pigeon reply --attach <path> <id> "<body>"` | `bash "$MAIL" reply --attach "<path>" <id> "<body>"` |
    | `pigeon broadcast "<subject>" "<body>"` | `bash "$MAIL" broadcast "<subject>" "<body>"` |
    | `pigeon search <keyword>` | `bash "$MAIL" search "<keyword>"` |
    | `pigeon status` | `bash "$MAIL" status` |
    | `pigeon unread` | `bash "$MAIL" unread` |
    | `pigeon list` | `bash "$MAIL" list` |
    | `pigeon list 50` | `bash "$MAIL" list 50` |
    | `pigeon projects` | `bash "$MAIL" projects` |
    | `pigeon clear` | `bash "$MAIL" clear` |
    | `pigeon clear 7` | `bash "$MAIL" clear 7` |
    | `pigeon alias <old> <new>` | `bash "$MAIL" alias "<old>" "<new>"` |
    | `pigeon purge` | `bash "$MAIL" purge` |
    | `pigeon purge --all` | `bash "$MAIL" purge --all` |
    | `pigeon id` | `bash "$MAIL" id` |
    | `pigeon migrate` | `bash "$MAIL" migrate` |
    | `pigeon init` | `bash "$MAIL" init` |
    
    When the user just says "check mail", "read mail", "inbox", "any mail?", or "any pmail?" - run `bash "$MAIL" read`.
    
    When the user says "send mail to X", "send pmail to X", or "message X" - parse out the project name, subject, and body, then run `bash "$MAIL" send`.
    
    ## Project Identity
    
    Each project gets a stable 6-character hash ID derived from its **git root commit** (the very first commit in the repo). This means:
    
    - IDs survive directory renames, moves, and clones
    - Case-insensitive filesystems (macOS) don't cause collisions
    - Every clone of the same repo shares the same identity
    
    For non-git directories, falls back to a hash of the canonical path (`pwd -P`).
    
    A repo's git worktrees share its root commit, so they share its ID: every session in the repo, the main checkout and each lane alike, reads one inbox. See [Shared Inboxes](#shared-inboxes-worktrees).
    
    Use `pigeon id` to see your project's name and hash:
    
    ```
    claude-mods 7663d6
    ```
    
    When sending messages, you can address projects by **name**, **hash**, or **path** - they all resolve to the same hash ID.
    
    ### Identicons
    
    Each project hash renders as a unique pixel-art identicon (11x11 symmetric grid using Unicode half-block characters). Run `identicon.sh` to see yours, or view all projects with `pigeon projects`.
    
    ## Passive Notification (Hook)
    
    A global PreToolUse hook checks for pmail on every tool call (no cooldown). Silent when inbox is empty. When mail is waiting it prints one JSON envelope, and Claude Code passes its `additionalContext` to the model:
    
    ```json
    {"hookSpecificOutput":{"hookEventName":"PreToolUse","additionalContext":"=== INCOMING PMAIL (1 message(s)) ===\n..."}}
    ```
    
    What the model reads:
    
    ```
    === INCOMING PMAIL (1 message(s)) ===
    
    --- #42 from some-api (a1b2c3) @ 2026-09-30 10:12:04 ---
    Subject: Auth endpoints ready
    Login and refresh are live on staging.
    
    === ACTION REQUIRED: Inform the user about these messages and ask if they want to reply. ===
    === Then run: pigeon read (to mark as read) ===
    === To reply: pigeon reply <id> "message" ===
    ```
    
    The JSON form is required. For PreToolUse, plain stdout goes to Claude Code's debug log and never reaches the model. Claude Code caps `additionalContext` at 10,000 chars, so the hook truncates message bodies at about 9,000 and points at `pigeon read`. The header and footer are always kept. Delivery does not mark mail read.
    
    Each session is told about each message once. The signal file `/tmp/pigeon_signal_<hash>` is a timestamp that every send touches and nothing deletes. Each session keeps its own marker, `/tmp/pigeon_seen_<hash>_<session_id>`, holding the last message id it was shown. The fast path compares the two file times, so an empty inbox still costs one stat. The session id comes from the hook's stdin JSON; without one (a manual run), callers share an `anon` marker.
    
    ## Shared Inboxes (Worktrees)
    
    Every session in a project reads one inbox, and a repo's worktrees are the same project. That is what makes lane-to-coordinator reporting work (`pigeon send claude-mods "READY lane/<x> <sha>"` from a lane reaches the session in the main checkout), and pigeon keeps it safe:
    
    - **You are never handed your own mail.** Each message stores its sender's session (`CLAUDE_CODE_SESSION_ID`, the same id the hook gets). The hook and `read`, `count`, `unread` and `status` skip mail the calling session sent, so a lane's report waits for the others.
    - **One session looking never hides mail from another.** Delivery is tracked per session (above). Earlier versions cleared the shared signal on delivery, so the lane that sent a report consumed the coordinator's wake-up.
    - **Reading is still shared.** `pigeon read` marks mail read for the whole project. Inside a worktree the hook's footer says so: mark only mail meant for you, one at a time (`pigeon read <id>`); `pigeon thread <id>` shows a message without marking it.
    - **Names can collide.** A name is a directory basename, so two repos can share one. Pigeon then warns on stderr, lists each candidate hash, and uses the sender's own project if it is one of them. Send by hash to choose (`pigeon projects` lists them).
    
    ## Concurrency
    
    `pmail.db` is shared by every session on the machine, and the hook reads it on every tool call. Pigeon is built for that:
    
    - **A failed write is safe to retry.** `send`, `reply` and `broadcast` commit everything or nothing. A broadcast reaches every project or none, so retrying a failed one never delivers twice.
    - **Queries wait for locks.** Each one waits up to 5 s for another connection's lock (the hook 2 s) instead of failing at once with `database is locked`.
    - **Readers never block writers.** The database switches itself to WAL mode once, so a slow or stuck reader can't hold up a send. `pmail.db-wal` and `pmail.db-shm` sit beside it while sessions use it; on macOS they stay there between uses.
    - **No query runs for long.** Where GNU `timeout` is on PATH (Linux, Git Bash), a query is killed after 30 s, or 4 s in the hook, which runs under a 5 s hook timeout. The hook makes the same few queries however much mail is waiting.
    
    ## Attachments
    
    Send file references with `--attach <path>` (repeatable). Paths are resolved to absolute and stored as references - files are not copied.
    
    ```bash
    # Send with one attachment
    pigeon send --attach src/config.ts my-api "Config update" "Updated the auth config"
    
    # Send with multiple attachments
    pigeon send --attach src/schema.sql --attach docs/API.md my-api "Schema + docs" "See attached"
    
    # Reply with attachment
    pigeon reply --attach output/report.json 42 "Here's the analysis"
    ```
    
    Recipients see attachment paths with file sizes and can read them directly with the Read tool. If a file has been moved or deleted since sending, it shows as `(missing)`.
    
    ## When to Send
    
    - You've completed work another session depends on
    - An API contract or shared interface changed
    - A shared branch (main) is broken or fixed
    - You need input from a session working on a different project
    
    ## Per-Project Disable
    
    ```bash
    touch .claude/pigeon.disable    # Disable hook notifications
    rm .claude/pigeon.disable       # Re-enable
    ```
    
    Only the hook is disabled - you can still send messages from the project.
    
    ---
    
    ## Installation
    
    Pigeon requires two things: **scripts** (the mail engine) and a **hook** (passive notifications). Both install globally - one setup, every project gets pmail.
    
    ### Prerequisites
    
    - `sqlite3` - ships with macOS, most Linux distros, and Git Bash on Windows. No install needed.
    - `jq` - the hook uses it to build the JSON envelope Claude Code requires (`brew install jq`, `scoop install jq`, `apt install jq`). Without `jq` the hook stays silent, and `pigeon read` still works.
    
    ### Step 1: Copy Scripts
    
    ```bash
    mkdir -p ~/.claude/pigeon
    cp skills/pigeon/scripts/mail-db.sh ~/.claude/pigeon/
    cp hooks/check-mail.sh ~/.claude/pigeon/
    chmod +x ~/.claude/pigeon/mail-db.sh ~/.claude/pigeon/check-mail.sh
    ```
    
    This gives you the pmail commands. You can now send and read messages manually:
    
    ```bash
    bash ~/.claude/pigeon/mail-db.sh init      # Create database
    bash ~/.claude/pigeon/mail-db.sh status    # Check it works
    ```
    
    ### Step 2: Enable the Hook
    
    Add a `hooks` block to `~/.claude/settings.json`. This makes Claude check for pmail automatically on every tool call:
    
    ```json
    {
      "hooks": {
        "PreToolUse": [
          {
            "matcher": "*",
            "hooks": [
              {
                "type": "command",
                "command": "bash \"$HOME/.claude/pigeon/check-mail.sh\"",
                "timeout": 5
              }
            ]
          }
        ]
      }
    }
    ```
    
    **Important:** If you already have a `hooks` section in your settings, merge the PreToolUse entry into the existing array - don't replace the whole block.
    
    Without this step, pigeon still works but you have to check manually (`pigeon read`). With the hook, unread pmail appears automatically.
    
    ### What Gets Created
    
    ```
    ~/.claude/
      settings.json            # Hook config (you edit this)
      pmail.db                 # Message store (auto-created on first use)
      pmail.db-wal, -shm       # WAL files: present while in use (macOS keeps them)
      pigeon/
        mail-db.sh             # All pmail commands (send, read, reply, etc.)
        check-mail.sh          # PreToolUse hook (silent when inbox empty)
    ```
    
    ### Verify
    
    Run these in a terminal. Inside a Claude Code session, `read` skips mail that session sent, so a message to yourself stays unread.
    
    ```bash
    # Check your project identity
    bash ~/.claude/pigeon/mail-db.sh id
    
    # Send yourself a test message (use your project name from above)
    bash ~/.claude/pigeon/mail-db.sh send "my-project" "Test" "Hello from pigeon"
    
    # Check it arrived
    bash ~/.claude/pigeon/mail-db.sh read
    
    # Clean up
    bash ~/.claude/pigeon/mail-db.sh purge --all
    ```
    
    ### Uninstall
    
    ```bash
    rm -rf ~/.claude/pigeon ~/.claude/pmail.db ~/.claude/pmail.db-wal ~/.claude/pmail.db-shm
    # Then remove the hooks.PreToolUse entry from ~/.claude/settings.json
    ```
    
    ## Database
    
    Single SQLite file at `~/.claude/pmail.db`, in WAL mode (see Concurrency). Auto-created on first `init` or `send`. To copy it, use `sqlite3 ~/.claude/pmail.db ".backup pmail-copy.db"`, not `cp`: the newest writes can still sit in `pmail.db-wal`.
    
    ```sql
    CREATE TABLE messages (
        id INTEGER PRIMARY KEY AUTOINCREMENT,
        from_project TEXT NOT NULL,   -- 6-char hash ID
        to_project TEXT NOT NULL,     -- 6-char hash ID
        subject TEXT DEFAULT '',
        body TEXT NOT NULL,
        timestamp TEXT DEFAULT (datetime('now')),
        read INTEGER DEFAULT 0,
        priority TEXT DEFAULT 'normal',
        thread_id INTEGER REFERENCES messages(id),
        attachments TEXT DEFAULT '',  -- newline-separated absolute paths
        from_session TEXT DEFAULT ''  -- sender's CLAUDE_CODE_SESSION_ID, '' outside a session
    );
    
    CREATE TABLE projects (
        hash TEXT PRIMARY KEY,        -- 6-char ID (git root commit or path hash)
        name TEXT NOT NULL,           -- Display name (basename of project dir)
        path TEXT NOT NULL,           -- Canonical path
        registered TEXT DEFAULT (datetime('now'))
    );
    ```
    
    ## Troubleshooting
    
    | Issue | Fix |
    |-------|-----|
    | `sqlite3: not found` | Ships with macOS, Linux, and Git Bash on Windows. Run `sqlite3 --version` to check. |
    | Hook not firing | Ensure `hooks` block is in `~/.claude/settings.json` (Step 2 above) |
    | Hook fires but no notification | Working as intended - hook is silent when inbox is empty |
    | Mail is unread but Claude never mentions it | The hook must print JSON `additionalContext`, because plain PreToolUse stdout only reaches the debug log. Reinstall `check-mail.sh` from this repo and check `jq --version` |
    | Messages not arriving | Target must be a known name, hash, or path. Use `pigeon projects` to see registered projects |
    | A lane's report never reached the coordinator | Install the current `check-mail.sh` and `mail-db.sh` together. Older hooks cleared the shared signal when the lane saw its own report, and an older `read` marked it read |
    | `Warning: 2 projects are named '...'` | Two directories share a basename. Send by the hash the warning lists |
    | `database is locked` | A connection held a lock past the 5 s wait. Look for a stuck `sqlite3` (`tasklist /FI "IMAGENAME eq sqlite3.exe"` on Windows, `pgrep -l sqlite3` elsewhere) or a database browser with `pmail.db` open. The failed command sent nothing, so retry it |
    | `~/.claude` is on a network drive | WAL needs shared memory that network filesystems don't provide. Switch back once with `sqlite3 ~/.claude/pmail.db "PRAGMA journal_mode=DELETE"`; pigeon won't switch it again. Never share one `pmail.db` between WSL and Windows |
    | Upgraded from basename IDs | Run `pigeon migrate` to convert old messages to hash-based IDs |
    | Changed display name | Use `pigeon alias old-name new-name` to update the project's display name |
    | Want to disable for one project | `touch .claude/pigeon.disable` in that project's root |
    | Check your project ID | Run `pigeon id` to see name and 6-char hash |
    

Comments (0)

Sign in to join the conversation.

No comments yet.

Reviews (0)

No reviews yet.