Skip to content

TonyJOM/slack-code

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

slack-code

A Rust CLI with interactive TUI for receiving Claude Code session notifications via Slack.

Features

  • Slack Notifications: Receive notifications when Claude Code sessions start, need input, or complete
  • Interactive TUI: Monitor active sessions and view logs
  • Multiple Sessions: Track multiple concurrent Claude Code sessions

Installation

Quick Install (Recommended)

curl -fsSL https://raw.githubusercontent.com/tonyjom/slack-code/main/scripts/install.sh | bash

This will automatically download the pre-built binary for your platform and install it to ~/.local/bin.

Download Binary Manually

Download the latest release for your platform from GitHub Releases:

Platform Architecture Download
Linux x86_64 slack-code-vX.X.X-x86_64-unknown-linux-gnu.tar.gz
Linux ARM64 slack-code-vX.X.X-aarch64-unknown-linux-gnu.tar.gz
macOS Apple Silicon slack-code-vX.X.X-aarch64-apple-darwin.tar.gz

Extract and copy both slack-code and slack-code-hook to a directory in your PATH.

Build from Source

If you prefer to build from source (requires Rust):

curl -fsSL https://raw.githubusercontent.com/tonyjom/slack-code/main/scripts/install.sh | bash -s -- --from-source

git clone https://github.com/tonyjom/slack-code
cd slack-code
cargo install --path crates/slack-code
cargo install --path crates/slack-code-hook

Setup

1. Create a Slack App

  1. Go to api.slack.com/apps
  2. Click "Create New App" → "From scratch"
  3. Name it "slack-code" and select your workspace

2. Add Bot Token Scopes

  1. Go to OAuth & Permissions → Scopes → Bot Token Scopes
  2. Add these scopes:
    • chat:write
    • im:write
    • users:read

3. Install to Workspace

  1. Go to Install App
  2. Click "Install to Workspace"
  3. Copy the Bot User OAuth Token (starts with xoxb-)

4. Run Setup Wizard

slack-code setup

Follow the prompts to enter your tokens and configure the integration.

Usage

Start the TUI

slack-code

Manage Hooks

# Install Claude Code hooks
slack-code hooks install

# Check hook status
slack-code hooks status

# Uninstall hooks
slack-code hooks uninstall

Daemon Control

# Start daemon in background
slack-code daemon start

# Check daemon status
slack-code daemon status

# Stop daemon
slack-code daemon stop

TUI Keyboard Shortcuts

Global

Key Action
1 Sessions view
2 Config view
3 Logs view
? Toggle help
q Quit

Navigation

Key Action
j / Next item
k / Previous item
Enter Select
Esc Cancel/Back

Config View

Key Action
t Test tokens
h Manage hooks

Configuration

Configuration is stored at ~/.config/slack-code/config.toml:

[slack]
bot_token = "xoxb-your-bot-token"
user_id = "U12345678"

[daemon]
log_level = "info"

[defaults]
hook_timeout = 5

Environment Variables

Tokens can also be set via environment variables:

  • SLACK_CODE_BOT_TOKEN

Architecture

┌─────────────────────────────────────────────────────────┐
│                     TUI (ratatui)                       │
└──────────────────────────┬──────────────────────────────┘
                           │ IPC (Unix Socket)
┌──────────────────────────▼──────────────────────────────┐
│                    Daemon Process                       │
│  ┌──────────────┐  ┌───────────────┐                   │
│  │   Session    │  │   IPC Server  │                   │
│  │   Manager    │  │               │                   │
│  └──────────────┘  └───────────────┘                   │
│         │                                               │
│         ▼                                               │
│  ┌─────────────┐                                       │
│  │ Slack Web   │                                       │
│  │ API Client  │                                       │
│  └─────────────┘                                       │
└─────────────────────────────────────────────────────────┘
                           ▲
┌──────────────────────────│──────────────────────────────┐
│                Claude Code Hook Script                  │
│  SessionStart/End/Notification → JSON stdin → IPC      │
└─────────────────────────────────────────────────────────┘

How It Works

  1. When you start a Claude Code session in your terminal, the installed hooks notify the daemon
  2. The daemon sends a Slack notification to your DM channel
  3. As Claude works, status updates are posted to the Slack thread
  4. You can monitor all active sessions in the TUI

License

MIT

About

CLI for getting Claude Code notifications through Slack

Resources

Stars

Watchers

Forks

Packages

No packages published