PigeonAI
Send tasks from Slack to Claude Code agent teams running in tmux, and get their answers back as Slack DMs.
flowchart LR
U(["👤 You on Slack"])
subgraph A["Server A"]
B["pigeonai bot"]
WA["pigeonai watch backend"]
L["backend team-lead<br/>(tmux pane)"]
end
subgraph R["Server B"]
WB["pigeonai watch research"]
T["research team-lead<br/>(tmux pane)"]
end
N["pigeonai notify<br/>(Stop hook)"]
U -- "backend: fix the test" --> B
U -- "research: summarize" --> B
B --> WA
B --> WB
WA -- "tmux send-keys" --> L
WB -- "tmux send-keys" --> T
L -. "answer done" .-> N
T -. "answer done" .-> N
N -. "✅ DM with result" .-> U
Solid arrows carry commands. Dotted arrows carry results back.
- The bot receives Slack messages and drops each one into
inbox/<team>/in a directory all servers share. - A watcher on each server types the messages into the tmux panes of the teams running there.
- Only one Slack user (
ALLOWED_USER) can send commands.
Install
pip install pigeonai # or: uv pip install pigeonai
From source: pip install -e .
1. Create the Slack app
At https://api.slack.com/apps (in the browser, not the Slack client):
- Create an App → name it (e.g.
pigeonai) → pick your workspace. - Socket Mode: on. App-Level Token with scope
connections:write→ this isSLACK_APP_TOKEN(xapp-...). - OAuth & Permissions → Bot scopes:
chat:write,app_mentions:read,im:history. Leave user scopes empty. - Event Subscriptions → Bot events:
app_mention,message.im. - App Home: enable Messages Tab and tick Allow users to send Slash commands and messages.
- Install to Workspace → copy the Bot User OAuth Token →
SLACK_BOT_TOKEN(xoxb-...). - Your Member ID: Slack → your avatar → Profile → ⋮ → Copy member ID (
U0...) →ALLOWED_USER.
Keep token rotation off. Never share the tokens.
2. Configure
Pick a home directory that every server can see, then:
export PIGEONAI_HOME=/data/shared/pigeonai # or pass --home to every command
pigeonai init # creates .env, pigeonai.toml, inbox/
Fill in .env (created with mode 600):
SLACK_BOT_TOKEN=xoxb-...
SLACK_APP_TOKEN=xapp-...
ALLOWED_USER=U0...
List your teams in pigeonai.toml, one line each, wherever they run:
[teams]
backend = "agents:0.0" # tmux "session:window.pane"
research = "research:0.0"
Find pane names with tmux list-panes -a -F '#{session_name}:#{window_index}.#{pane_index} #{pane_current_command}'.
Test the token: pigeonai check → ok: connected as ....
3. Run
| Where | Command | Notes |
|---|---|---|
| One server only | pigeonai bot |
Run exactly one bot. Two bots on the same token split messages randomly. |
| Every server with teams | pigeonai watch backend |
List the teams whose pane is on that server, e.g. pigeonai watch backend frontend. |
Run both inside tmux so they keep running.
4. Send results back to Slack
Install the Stop hook once per team, on the team's server:
pigeonai hook /path/to/team-dir
Then restart that team-lead (/exit, claude --continue). Each finished answer now arrives as a Slack DM.
Optional test: echo '{"cwd":"/tmp/test","last_assistant_message":"hi"}' | pigeonai notify should DM you ✅ test.
Usage
DM the bot (or @mention it): backend: summarize today's progress.
The bot replies 📨 Sent to backend; when the team-lead finishes, you get ✅ backend with its answer.
Adding a team
- Add
name = "session:window.pane"under[teams]and restart the bot. - Add the name to
pigeonai watchon the server where the team runs. - Run
pigeonai hook <team-dir>on that server.
A new server only needs its own virtualenv with PigeonAI installed and access to the shared directory.
Servers without the shared directory
If a server can't mount the shared directory (no NFS, no SSH), its teams can receive messages through a private Slack channel instead. The server only needs internet access.
-
In the Slack app, add the bot scope
groups:historyand reinstall the app. -
Create a private channel (e.g.
#pigeonai-relay), run/invite @pigeonaithere, and copy its channel ID (channel name → About → bottom). -
In
pigeonai.toml, list those teams under[relay]too, then restart the bot:[teams] backend = "agents:0.0" cloud = "cloud:0.0" [relay] channel = "C0123456789" teams = ["cloud"]
-
On the new server: copy
.envandpigeonai.tomlinto a local folder, then runpigeonai watch cloud --home <that folder>andpigeonai hook <team-dir> --home <that folder>.
The watcher only delivers posts made by the bot itself and deletes each one after delivery.
Troubleshooting
| Symptom | Fix |
|---|---|
Missing ALLOWED_USER in .env |
Add your Member ID to .env. |
| Bot lists the wrong teams | Old code or two bots running. Stop extra bots, restart pigeonai bot. |
| No ✅ message comes back | Hook not loaded: /hooks says "no hooks yet" → /exit, claude --continue. Side questions (/btw) don't fire Stop. |
| Bot replies 📨 but the team gets nothing | The watcher on that server stopped, or the team isn't in its pigeonai watch list. |
| Text appears in Claude's box but isn't submitted | Enter arrived too fast; raise delay in pigeonai/tmux.py. |
| Slack says you can't message the app | Enable the Messages Tab (step 1.5). |
check times out |
The server can't reach Slack; enable your proxy. |
python: No such file or directory after a restart |
The virtualenv points to a Python that's gone (e.g. under a wiped /root). Recreate it, reinstall, and rerun pigeonai hook. |
Development
pip install -e '.[dev]' && pytest
License
MIT
Metadata
Release files for pigeonai 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pigeonai-1.0.1.tar.gz | 10.6 kB | Without provenance | Details for pigeonai-1.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pigeonai-1.0.1-py3-none-any.whl | Python 3 | none | any | Details for pigeonai-1.0.1-py3-none-any.whl |
Total release size: 23.1 kB
Release files / pigeonai-1.0.1.tar.gz
| Download URL | pigeonai-1.0.1.tar.gz |
|---|---|
| Size | 10.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4f898cea1f67b05f3f8810c4bfc189f4ec778d141be5736206dfb1acbbe65d68
|
|
BLAKE2b-256 checksum How to use checksums |
79ca812e10c932e72ecdffa413fcef38f096c8badf6c7da30b2182921d06ff2d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.18
|
Release files / pigeonai-1.0.1-py3-none-any.whl
| Download URL | pigeonai-1.0.1-py3-none-any.whl |
|---|---|
| Size | 12.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1656f44e5cf51b650d8e138a0d652b9e2d4dabba56fac8d93709aad7e6a0ec40
|
|
BLAKE2b-256 checksum How to use checksums |
ed522adb19d1231a829ddd946097ac1168a04a3e0a3cc67c3e2d1b031ba38a9a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.18
|
Security for pigeonai 1.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.