{"id":49242242,"url":"https://github.com/dbenn8/claude-slack","last_synced_at":"2026-04-24T20:02:41.146Z","repository":{"id":323578142,"uuid":"1093835612","full_name":"dbenn8/claude-slack","owner":"dbenn8","description":"Universal Slack integration for Claude Code - bidirectional communication, multi-session support, and real-time messaging","archived":false,"fork":false,"pushed_at":"2026-01-30T11:49:18.000Z","size":176,"stargazers_count":17,"open_issues_count":8,"forks_count":3,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-31T01:14:40.250Z","etag":null,"topics":["bidirectional","claude","claude-code","integration","python","real-time","slack","slack-bot","socket-mode"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dbenn8.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-11-10T22:51:47.000Z","updated_at":"2026-01-29T07:29:31.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/dbenn8/claude-slack","commit_stats":null,"previous_names":["dbenn8/claude-slack"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/dbenn8/claude-slack","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbenn8%2Fclaude-slack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbenn8%2Fclaude-slack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbenn8%2Fclaude-slack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbenn8%2Fclaude-slack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dbenn8","download_url":"https://codeload.github.com/dbenn8/claude-slack/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbenn8%2Fclaude-slack/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32238748,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-24T13:21:15.438Z","status":"ssl_error","status_checked_at":"2026-04-24T13:21:15.005Z","response_time":64,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bidirectional","claude","claude-code","integration","python","real-time","slack","slack-bot","socket-mode"],"created_at":"2026-04-24T20:02:40.257Z","updated_at":"2026-04-24T20:02:41.140Z","avatar_url":"https://github.com/dbenn8.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Slack Integration for Claude Code\n\nBidirectional Slack integration allowing you to:\n- **Claude → Slack**: Automatic notifications when Claude Code events occur\n- **Slack → Claude**: Send responses from mobile and use them in Claude Code\n\n## 📌 Choose Your Phase\n\n- **Phase 1 (This Guide)**: Manual `/check` command - Simple, stable, works immediately\n- **Phase 2 (Auto-Injection)**: Fully hands-free - See [PHASE2_README.md](PHASE2_README.md)\n\n## Architecture\n\n```\n┌──────────────────┐        Hooks          ┌───────────────┐\n│  Claude Code     │────────────────────────\u003e│     Slack     │\n│                  │    (auto-notify)        │   Workspace   │\n│                  │                         │               │\n│                  │\u003c────────────────────────│               │\n│                  │  /check (manual read)   └───────────────┘\n└──────────────────┘                                │\n                                                    │ WebSocket\n                                                    │ (Socket Mode)\n                                                    ▼\n                                         ┌─────────────────────┐\n                                         │  slack_listener.py  │\n                                         │  (runs separately)  │\n                                         │  Saves to:          │\n                                         │  slack_response.txt │\n                                         └─────────────────────┘\n```\n\n## Features\n\n### MVP (Phase 1) - Implemented ✅\n- ✅ Claude Code automatically sends messages to Slack on key events\n- ✅ You reply in Slack (mobile-friendly)\n- ✅ Type `/check` in Claude Code to retrieve response\n- ✅ Works with simple text responses: \"1\", \"2\", \"3\", or custom text\n- ✅ Slack bot acknowledges receipt with ✅ reaction\n\n### Phase 2 - Auto-Injection ✅\n- ✅ Automatic response injection (no manual `/check` needed)\n- ✅ Sub-second latency from Slack → Claude\n- ✅ Fully hands-free mobile control\n- 📖 See [PHASE2_README.md](PHASE2_README.md) for setup\n\n### Phase 2.5 - Multi-Session Support ✅\n- ✅ Unlimited concurrent Claude sessions\n- ✅ Thread-based organization in Slack\n- ✅ Session picker UI for mobile\n- ✅ Auto-routing by thread\n- ✅ VibeTunnel compatibility\n- ✅ Backward compatible with Phase 2\n- 📖 See [PHASE25_README.md](PHASE25_README.md) for full guide\n\n**Quick Start Phase 2.5**:\n```bash\n# Start registry + Slack bot (one time)\ncd slack_bot \u0026\u0026 ./start-all\n\n# Start multiple Claude sessions (separate terminals)\ncd /path/to/project1 \u0026\u0026 ./claude-slack\ncd /path/to/project2 \u0026\u0026 ./claude-slack\ncd /path/to/project3 \u0026\u0026 ./claude-slack\n\n# Use from mobile: Select thread in Slack, reply\n```\n\n### Future: Phase 3 🚧\n- Interactive buttons (1️⃣ 2️⃣ 3️⃣), session pause/resume, team collaboration\n\n## Prerequisites\n\n1. **Slack Workspace**: You must have admin access to create apps\n2. **Python 3.8+**: For running the Slack bot\n3. **Claude Code**: Installed and working\n\n## Setup Instructions\n\n### Step 1: Create Slack App (10 minutes)\n\n1. **Go to Slack API**: https://api.slack.com/apps\n2. **Create New App**:\n   - Click \"Create New App\"\n   - Choose \"From scratch\"\n   - App Name: \"Claude Code Bot\" (or any name)\n   - Select your workspace\n   - Click \"Create App\"\n\n3. **Enable Socket Mode**:\n   - In left sidebar → Settings → Socket Mode\n   - Toggle \"Enable Socket Mode\" → ON\n   - Click \"Generate an app-level token\"\n   - Token Name: \"Socket Mode Token\"\n   - Scope: `connections:write`\n   - Click \"Generate\"\n   - **COPY THE TOKEN** (starts with `xapp-`) → Save for later\n   - Click \"Done\"\n\n4. **Add Bot Token Scopes**:\n   - In left sidebar → Features → OAuth \u0026 Permissions\n   - Scroll to \"Scopes\" → \"Bot Token Scopes\"\n   - Click \"Add an OAuth Scope\" and add these:\n     - `app_mentions:read` - Read @mentions\n     - `channels:history` - Read channel messages\n     - `channels:read` - List channels\n     - `chat:write` - Send messages\n     - `im:history` - Read DMs\n     - `im:read` - Access DM info\n     - `im:write` - Send DMs\n     - `reactions:write` - Add emoji reactions\n\n5. **Install App to Workspace**:\n   - Scroll up on same page → \"OAuth Tokens for Your Workspace\"\n   - Click \"Install to Workspace\"\n   - Review permissions → Click \"Allow\"\n   - **COPY THE BOT TOKEN** (starts with `xoxb-`) → Save for later\n\n6. **Subscribe to Events**:\n   - In left sidebar → Features → Event Subscriptions\n   - Toggle \"Enable Events\" → ON\n   - Scroll to \"Subscribe to bot events\"\n   - Click \"Add Bot User Event\" and add:\n     - `app_mention` - When someone @mentions your bot\n     - `message.channels` - Messages in channels\n     - `message.im` - Direct messages\n   - Click \"Save Changes\"\n\n7. **Create Channel** (optional but recommended):\n   - In Slack, create a new channel: `#btcbot-claude`\n   - Invite the bot: Type `/invite @Claude Code Bot` in the channel\n   - This will be your dedicated channel for Claude notifications\n\n### Step 2: Configure Slack Bot (5 minutes)\n\n1. **Navigate to project**:\n   ```bash\n   cd /Users/danielbennett/codeNew/btcbot/slack_bot\n   ```\n\n2. **Install dependencies**:\n   ```bash\n   pip install -r requirements.txt\n   ```\n\n3. **Create .env file**:\n   ```bash\n   cp .env.example .env\n   ```\n\n4. **Edit .env file** with your tokens:\n   ```bash\n   # Open in your editor\n   nano .env\n   # Or\n   code .env\n   ```\n\n   Replace with your actual tokens:\n   ```\n   SLACK_BOT_TOKEN=xoxb-YOUR-ACTUAL-BOT-TOKEN\n   SLACK_APP_TOKEN=xapp-YOUR-ACTUAL-APP-TOKEN\n   SLACK_CHANNEL=#btcbot-claude\n   ```\n\n5. **Test the bot**:\n   ```bash\n   python3 slack_listener.py\n   ```\n\n   You should see:\n   ```\n   🚀 Starting Slack bot...\n   📁 Response file: /Users/danielbennett/codeNew/btcbot/slack_response.txt\n   ✅ Slack bot is running!\n      Listening for:\n      - @mentions in channels\n      - Direct messages\n      - Channel messages starting with / or !\n      - Single digit responses (1, 2, 3)\n\n      Press Ctrl+C to stop\n   ```\n\n6. **Test in Slack**:\n   - Go to `#btcbot-claude` channel\n   - Type: `@Claude Code Bot test`\n   - Bot should:\n     - Add ✅ reaction to your message\n     - Reply: \"✅ Got it! Saved response: test\"\n   - Check terminal: Should show \"📝 Saved mention...\"\n   - Check file exists: `ls -la ../slack_response.txt`\n\n7. **Keep bot running**:\n   - Open a new terminal tab/window for the bot\n   - Or use `tmux`/`screen` to run in background\n   - Or use `nohup python3 slack_listener.py \u0026`\n\n### Step 3: Configure Claude Code Hooks (5 minutes)\n\n1. **Navigate to project root**:\n   ```bash\n   cd /Users/danielbennett/codeNew/btcbot\n   ```\n\n2. **Create settings file**:\n   ```bash\n   cp .claude/settings.local.json.example .claude/settings.local.json\n   ```\n\n3. **Edit settings** with your bot token:\n   ```bash\n   nano .claude/settings.local.json\n   # Or\n   code .claude/settings.local.json\n   ```\n\n   Replace `xoxb-your-bot-token-here` with your actual bot token:\n   ```json\n   {\n     \"env\": {\n       \"SLACK_BOT_TOKEN\": \"xoxb-YOUR-ACTUAL-BOT-TOKEN\",\n       \"SLACK_CHANNEL\": \"#btcbot-claude\"\n     },\n     \"hooks\": { ... }\n   }\n   ```\n\n4. **Verify hook is executable**:\n   ```bash\n   ls -la .claude/hooks/slack_bidirectional.py\n   ```\n\n   Should show `-rwxr-xr-x` (x = executable)\n\n   If not:\n   ```bash\n   chmod +x .claude/hooks/slack_bidirectional.py\n   ```\n\n### Step 4: Test End-to-End (5 minutes)\n\n1. **Start Claude Code**:\n   ```bash\n   claude\n   ```\n\n2. **Send a test prompt**:\n   ```\n   You: \"Test Slack integration\"\n   ```\n\n3. **Check Slack**:\n   - Go to `#btcbot-claude` channel\n   - You should see a message like:\n     ```\n     📝 UserPromptSubmit\n     ```Session: abc12345\n     Project: btcbot\n\n     Prompt: Test Slack integration```\n\n     _Reply with: 1, 2, 3, or custom text_\n     ```\n\n4. **Reply in Slack** (from mobile or desktop):\n   ```\n   yes, proceed\n   ```\n\n5. **Check for response in Claude Code**:\n   ```\n   You: /check\n   ```\n\n   You should see:\n   ```\n   ============================================================\n   📱 SLACK RESPONSE:\n   ============================================================\n\n   yes, proceed\n\n   ============================================================\n\n   You can now type this response in Claude Code (or just press Enter to accept it)\n   ```\n\n6. **Type response in Claude Code**:\n   ```\n   You: yes, proceed\n   ```\n\n7. **Success!** 🎉 You now have bidirectional Slack integration\n\n## Usage Workflow\n\n### Normal Usage (Mobile Control)\n\n1. **Start Claude Code session** (on laptop):\n   ```bash\n   cd /Users/danielbennett/codeNew/btcbot\n   claude\n   ```\n\n2. **Work with Claude** - Claude will auto-notify Slack on:\n   - Every prompt you send (`UserPromptSubmit` event)\n   - When Claude finishes (`Stop` event)\n\n3. **Claude asks a question**:\n   ```\n   Claude: \"Should I proceed with this analysis? (y/n)\"\n   ```\n\n4. **Check Slack on mobile** - You'll see:\n   ```\n   ✅ Stop\n   Session: abc12345\n   Project: btcbot\n\n   Claude has finished processing.\n\n   Reply with: 1, 2, 3, or custom text\n   ```\n\n5. **Reply in Slack** (mobile):\n   - Type `1` (yes)\n   - Or `2` (always allow)\n   - Or `3` (no)\n   - Or any custom text: \"yes, use RSI 30\"\n\n6. **Back at laptop**, check for response:\n   ```\n   You: /check\n   ```\n\n7. **See response**:\n   ```\n   ============================================================\n   📱 SLACK RESPONSE:\n   ============================================================\n\n   1\n\n   ============================================================\n   ```\n\n8. **Type response in Claude**:\n   ```\n   You: 1\n   ```\n   (Or just type the custom text)\n\n9. **Claude continues** with your response\n\n### Quick Commands\n\n- `/check` - Check for Slack responses\n- `1` - Common response (yes/proceed)\n- `2` - Common response (always allow)\n- `3` - Common response (no/decline)\n\n## Troubleshooting\n\n### Bot not receiving messages\n\n**Check bot is running**:\n```bash\n# In slack_bot directory\nps aux | grep slack_listener\n```\n\nIf not running:\n```bash\ncd slack_bot\npython3 slack_listener.py\n```\n\n**Check bot is in channel**:\n- Type `/invite @Claude Code Bot` in the Slack channel\n- Bot must be explicitly invited to channels\n\n**Check permissions**:\n- Slack App → OAuth \u0026 Permissions → verify all scopes listed above\n\n### Claude not sending to Slack\n\n**Check token in settings**:\n```bash\ncat .claude/settings.local.json\n# Verify SLACK_BOT_TOKEN is set correctly\n```\n\n**Check hook is executable**:\n```bash\nls -la .claude/hooks/slack_bidirectional.py\nchmod +x .claude/hooks/slack_bidirectional.py  # If needed\n```\n\n**Check slack_sdk is installed**:\n```bash\npip install slack-sdk\n```\n\n**Test hook manually**:\n```bash\necho '{\"session_id\": \"test123\", \"project_dir\": \"/test\"}' | \\\n  HOOK_EVENT_TYPE=UserPromptSubmit \\\n  SLACK_BOT_TOKEN=xoxb-YOUR-TOKEN \\\n  SLACK_CHANNEL=#btcbot-claude \\\n  python3 .claude/hooks/slack_bidirectional.py\n```\n\n### /check shows no response\n\n**Check file exists**:\n```bash\nls -la slack_response.txt\ncat slack_response.txt\n```\n\n**Check bot wrote to file**:\n- Send test message in Slack\n- Check if file was created/updated\n- Check bot terminal for error messages\n\n**File permissions**:\n```bash\n# Ensure file is writable\nchmod 644 slack_response.txt  # If it exists\n```\n\n### Slack bot crashes\n\n**Check logs**:\n- Look at terminal output where bot is running\n- Common issues:\n  - Token expired/invalid\n  - Network connection lost\n  - Rate limiting\n\n**Restart bot**:\n```bash\ncd slack_bot\npython3 slack_listener.py\n```\n\n**Check Slack App status**:\n- https://api.slack.com/apps\n- Your App → Settings → Basic Information\n- Verify \"Install to Workspace\" is active\n\n## Files Overview\n\n```\nbtcbot/\n├── slack_bot/\n│   ├── slack_listener.py        # Main Slack bot (runs continuously)\n│   ├── requirements.txt         # Python dependencies\n│   ├── .env.example            # Template for configuration\n│   ├── .env                    # Your tokens (gitignored)\n│   └── README.md               # This file\n│\n├── .claude/\n│   ├── hooks/\n│   │   └── slack_bidirectional.py  # Claude Code hook\n│   ├── commands/\n│   │   └── check.md            # /check slash command\n│   ├── settings.local.json.example  # Template\n│   └── settings.local.json     # Your config (gitignored)\n│\n└── slack_response.txt          # Shared file for responses (gitignored)\n```\n\n## Security Notes\n\n- **Never commit tokens**: `.env` and `settings.local.json` are gitignored\n- **Rotate tokens periodically**: Recommended every 90 days\n- **Use separate bot token**: Don't use your personal user token\n- **Limit channel access**: Only invite bot to channels that need it\n- **Monitor usage**: Check Slack App dashboard for suspicious activity\n\n## Next Steps (Future Phases)\n\n### Phase 2: Auto-Injection Wrapper\n- Build `claude_wrapper.py` to proxy stdin/stdout\n- Automatically inject Slack responses (no manual `/check`)\n- Estimated time: 3-4 hours\n\n### Phase 3: Rich Slack UI\n- Interactive buttons (1️⃣ Yes  2️⃣ Always  3️⃣ No)\n- Threaded messages for context\n- Button 4️⃣ for additional context\n- Rich formatting, code blocks\n- Estimated time: 2-3 hours\n\n## Support\n\nFor issues:\n1. Check troubleshooting section above\n2. Verify all setup steps completed\n3. Check bot terminal logs\n4. Check Claude Code output for hook errors\n\n## License\n\nSame as parent project (btcbot)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdbenn8%2Fclaude-slack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdbenn8%2Fclaude-slack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdbenn8%2Fclaude-slack/lists"}