Slack Integration
Use the slack-cc CLI tool for all Slack operations. All commands return JSON.
Shared reference: See _shared/slack-integration/ for:
- CLI reference - Canonical commands
- Error handling - Warn and continue pattern
Commands
Sync (Required First)
npx tsx .claude/tools/slack-cc/src/index.ts sync
Fetches channels and members, caches locally. Run once before other commands.
Send Message to Channel
npx tsx .claude/tools/slack-cc/src/index.ts send-message <channel> <message>
# Examples
npx tsx .claude/tools/slack-cc/src/index.ts send-message design-studio "Deployment complete!"
npx tsx .claude/tools/slack-cc/src/index.ts send-message "#prototype-v2-updates" "New feature shipped"
# Thread reply
npx tsx .claude/tools/slack-cc/src/index.ts send-message design-studio "Follow-up" --thread 1234567890.123456
Options: --thread <ts> - Reply in thread
Send Direct Message
npx tsx .claude/tools/slack-cc/src/index.ts send-dm <user> <message>
# Examples
npx tsx .claude/tools/slack-cc/src/index.ts send-dm zeeshan "Design polish is complete!"
npx tsx .claude/tools/slack-cc/src/index.ts send-dm "Andy Rong" "Check out the new feature"
List Channels
npx tsx .claude/tools/slack-cc/src/index.ts list-channels
npx tsx .claude/tools/slack-cc/src/index.ts list-channels --filter design
npx tsx .claude/tools/slack-cc/src/index.ts list-channels --limit 10
List Members
npx tsx .claude/tools/slack-cc/src/index.ts list-members
npx tsx .claude/tools/slack-cc/src/index.ts list-members --filter zeeshan
npx tsx .claude/tools/slack-cc/src/index.ts list-members --limit 20
Response Format
Success:
{"success": true, "channel": "design-studio", "messageTs": "...", "permalink": "..."}
Error:
{"success": false, "error": "Channel not found. Available: design-studio, ..."}
Primary Channels
design-studio- Design updates and reviewsprototype-v2-updates- Feature and deployment notifications
Usage Pattern
# 1. Check if a user exists
RESULT=$(npx tsx .claude/tools/slack-cc/src/index.ts list-members --filter zeeshan)
# 2. Send notification
npx tsx .claude/tools/slack-cc/src/index.ts send-dm zeeshan "DIS-307 design polish is complete!"
# 3. Or post to channel
npx tsx .claude/tools/slack-cc/src/index.ts send-message prototype-v2-updates "New feature deployed! See DIS-308"
Error Handling
Slack updates are informational, not blocking. If sending fails:
- Warn and continue
- Log error for debugging
- Don't block the primary workflow
RESULT=$(npx tsx .claude/tools/slack-cc/src/index.ts send-message design-studio "Update" 2>&1)
if echo "$RESULT" | grep -q '"success":true'; then
echo "Message sent"
else
echo "Warning: Slack notification failed. Continuing..."
fi