slack-claude-code 0.1.6__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- slack_claude_code-0.1.6/LICENSE +21 -0
- slack_claude_code-0.1.6/PKG-INFO +227 -0
- slack_claude_code-0.1.6/README.md +205 -0
- slack_claude_code-0.1.6/pyproject.toml +31 -0
- slack_claude_code-0.1.6/src/__init__.py +0 -0
- slack_claude_code-0.1.6/src/agents/__init__.py +10 -0
- slack_claude_code-0.1.6/src/agents/orchestrator.py +315 -0
- slack_claude_code-0.1.6/src/agents/roles.py +164 -0
- slack_claude_code-0.1.6/src/app.py +715 -0
- slack_claude_code-0.1.6/src/approval/__init__.py +1 -0
- slack_claude_code-0.1.6/src/approval/handler.py +302 -0
- slack_claude_code-0.1.6/src/approval/plan_manager.py +226 -0
- slack_claude_code-0.1.6/src/approval/slack_ui.py +312 -0
- slack_claude_code-0.1.6/src/claude/__init__.py +2 -0
- slack_claude_code-0.1.6/src/claude/streaming.py +348 -0
- slack_claude_code-0.1.6/src/claude/subprocess_executor.py +446 -0
- slack_claude_code-0.1.6/src/cli.py +177 -0
- slack_claude_code-0.1.6/src/config.py +230 -0
- slack_claude_code-0.1.6/src/config_storage.py +138 -0
- slack_claude_code-0.1.6/src/database/__init__.py +1 -0
- slack_claude_code-0.1.6/src/database/migrations.py +169 -0
- slack_claude_code-0.1.6/src/database/models.py +237 -0
- slack_claude_code-0.1.6/src/database/repository.py +692 -0
- slack_claude_code-0.1.6/src/git/__init__.py +1 -0
- slack_claude_code-0.1.6/src/git/models.py +62 -0
- slack_claude_code-0.1.6/src/git/service.py +352 -0
- slack_claude_code-0.1.6/src/handlers/__init__.py +53 -0
- slack_claude_code-0.1.6/src/handlers/actions.py +1030 -0
- slack_claude_code-0.1.6/src/handlers/agents.py +270 -0
- slack_claude_code-0.1.6/src/handlers/base.py +163 -0
- slack_claude_code-0.1.6/src/handlers/basic.py +137 -0
- slack_claude_code-0.1.6/src/handlers/claude_cli.py +371 -0
- slack_claude_code-0.1.6/src/handlers/git.py +317 -0
- slack_claude_code-0.1.6/src/handlers/mode.py +121 -0
- slack_claude_code-0.1.6/src/handlers/notifications.py +192 -0
- slack_claude_code-0.1.6/src/handlers/parallel.py +71 -0
- slack_claude_code-0.1.6/src/handlers/queue.py +276 -0
- slack_claude_code-0.1.6/src/handlers/session_management.py +49 -0
- slack_claude_code-0.1.6/src/hooks/__init__.py +4 -0
- slack_claude_code-0.1.6/src/hooks/registry.py +200 -0
- slack_claude_code-0.1.6/src/hooks/types.py +61 -0
- slack_claude_code-0.1.6/src/question/__init__.py +1 -0
- slack_claude_code-0.1.6/src/question/manager.py +422 -0
- slack_claude_code-0.1.6/src/question/slack_ui.py +328 -0
- slack_claude_code-0.1.6/src/tasks/__init__.py +1 -0
- slack_claude_code-0.1.6/src/tasks/manager.py +350 -0
- slack_claude_code-0.1.6/src/utils/__init__.py +1 -0
- slack_claude_code-0.1.6/src/utils/detail_cache.py +89 -0
- slack_claude_code-0.1.6/src/utils/file_downloader.py +138 -0
- slack_claude_code-0.1.6/src/utils/formatters/__init__.py +1 -0
- slack_claude_code-0.1.6/src/utils/formatters/base.py +180 -0
- slack_claude_code-0.1.6/src/utils/formatters/command.py +148 -0
- slack_claude_code-0.1.6/src/utils/formatters/directory.py +64 -0
- slack_claude_code-0.1.6/src/utils/formatters/job.py +184 -0
- slack_claude_code-0.1.6/src/utils/formatters/markdown.py +85 -0
- slack_claude_code-0.1.6/src/utils/formatters/plan.py +183 -0
- slack_claude_code-0.1.6/src/utils/formatters/queue.py +103 -0
- slack_claude_code-0.1.6/src/utils/formatters/session.py +137 -0
- slack_claude_code-0.1.6/src/utils/formatters/streaming.py +85 -0
- slack_claude_code-0.1.6/src/utils/formatters/tool_blocks.py +343 -0
- slack_claude_code-0.1.6/src/utils/formatting.py +148 -0
- slack_claude_code-0.1.6/src/utils/slack_helpers.py +352 -0
- slack_claude_code-0.1.6/src/utils/streaming.py +291 -0
- slack_claude_code-0.1.6/src/utils/validators.py +36 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Dan
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: slack-claude-code
|
|
3
|
+
Version: 0.1.6
|
|
4
|
+
Summary: Slack app for running Claude Code CLI commands
|
|
5
|
+
License-File: LICENSE
|
|
6
|
+
Author: Dan
|
|
7
|
+
Requires-Python: >=3.10,<4.0
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
10
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
14
|
+
Requires-Dist: aiofiles (>=24.1.0,<25.0.0)
|
|
15
|
+
Requires-Dist: aiohttp (>=3.13.2,<4.0.0)
|
|
16
|
+
Requires-Dist: aiosqlite (>=0.21.0,<0.22.0)
|
|
17
|
+
Requires-Dist: cryptography (>=44.0.0,<45.0.0)
|
|
18
|
+
Requires-Dist: loguru (>=0.7.0,<0.8.0)
|
|
19
|
+
Requires-Dist: pydantic-settings (>=2.7.0,<3.0.0)
|
|
20
|
+
Requires-Dist: slack-bolt (>=1.27.0,<2.0.0)
|
|
21
|
+
Description-Content-Type: text/markdown
|
|
22
|
+
|
|
23
|
+
<p align="center">
|
|
24
|
+
<img src="assets/repo_logo.png" alt="Slack Claude Code Bot" width="1000">
|
|
25
|
+
</p>
|
|
26
|
+
|
|
27
|
+
<p align="center">
|
|
28
|
+
<a href="https://pypi.org/project/slack-claude-code/"><img src="https://img.shields.io/pypi/v/slack-claude-code" alt="PyPI version"></a>
|
|
29
|
+
<a href="https://pypi.org/project/slack-claude-code/"><img src="https://img.shields.io/pypi/pyversions/slack-claude-code" alt="Python versions"></a>
|
|
30
|
+
<a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="License"></a>
|
|
31
|
+
<a href="https://github.com/djkelleher/slack-claude-code/actions/workflows/tests.yml"><img src="https://github.com/djkelleher/slack-claude-code/actions/workflows/tests.yml/badge.svg" alt="Tests"></a>
|
|
32
|
+
</p>
|
|
33
|
+
|
|
34
|
+
**Claude Code, but in Slack.** Access Claude Code remotely from any device, or use it full-time for a better UI experience.
|
|
35
|
+
|
|
36
|
+
## Why Slack?
|
|
37
|
+
|
|
38
|
+
| Feature | Terminal | Slack |
|
|
39
|
+
|---------|----------|-------|
|
|
40
|
+
| **Code blocks** | Plain text | Syntax-highlighted with copy button |
|
|
41
|
+
| **Long output** | Scrolls off screen | "View Details" modal |
|
|
42
|
+
| **Permissions** | Y/n prompts | Approve/Deny buttons |
|
|
43
|
+
| **Parallel work** | Multiple terminals | Threads = isolated sessions |
|
|
44
|
+
| **File sharing** | `cat` or copy-paste | Drag & drop with preview |
|
|
45
|
+
| **Notifications** | Watch the terminal | Alerts when tasks complete |
|
|
46
|
+
| **Streaming** | Live terminal output | Watch responses as they generate |
|
|
47
|
+
| **Smart context** | Manual file inclusion | Frequently-used files auto-included |
|
|
48
|
+
|
|
49
|
+
## Installation
|
|
50
|
+
|
|
51
|
+
### Prerequisites
|
|
52
|
+
- Python 3.10+
|
|
53
|
+
- [Claude Code CLI](https://github.com/anthropics/claude-code) installed and authenticated
|
|
54
|
+
|
|
55
|
+
### 1. Install the `ccslack` executable
|
|
56
|
+
```bash
|
|
57
|
+
pipx install slack-claude-code
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### 2. Create Slack App
|
|
61
|
+
Go to https://api.slack.com/apps → "Create New App" → "From scratch"
|
|
62
|
+
|
|
63
|
+
**Socket Mode**: Enable and create an app-level token with `connections:write` scope (save the `xapp-` token)
|
|
64
|
+
|
|
65
|
+
**Bot Token Scopes** (OAuth & Permissions):
|
|
66
|
+
- `chat:write`, `commands`, `channels:history`, `app_mentions:read`, `files:read`, `files:write`
|
|
67
|
+
|
|
68
|
+
**Event Subscriptions**: Enable and add `message.channels`, `app_mention`
|
|
69
|
+
|
|
70
|
+
**App Icon**: In "Basic Information" → "Display Information", upload `assets/claude_logo.png` from this repo as the app icon
|
|
71
|
+
|
|
72
|
+
**Slash Commands**: Add the commands from the tables below (or the subset that you plan to use)
|
|
73
|
+
|
|
74
|
+
#### Configuration
|
|
75
|
+
Customize Claude's behavior for your workflow.
|
|
76
|
+
|
|
77
|
+
| Command | Description | Example |
|
|
78
|
+
|---------|-------------|---------|
|
|
79
|
+
| `/model` | Show or change AI model | `/model sonnet` |
|
|
80
|
+
| `/mode` | View or set permission mode | `/mode`, `/mode plan` |
|
|
81
|
+
| `/permissions` | View/update permissions | `/permissions` |
|
|
82
|
+
| `/notifications` | Configure notifications | `/notifications` |
|
|
83
|
+
|
|
84
|
+
#### Session Management
|
|
85
|
+
Each Slack thread maintains an isolated Claude session with its own context.
|
|
86
|
+
|
|
87
|
+
| Command | Description | Example |
|
|
88
|
+
|---------|-------------|---------|
|
|
89
|
+
| `/clear` | Reset conversation | `/clear` |
|
|
90
|
+
| `/compact` | Compact context | `/compact` |
|
|
91
|
+
| `/cost` | Show session cost | `/cost` |
|
|
92
|
+
| `/resume` | Resume previous session | `/resume` |
|
|
93
|
+
| `/sessions` | List active sessions | `/sessions` |
|
|
94
|
+
| `/session-cleanup` | Clean up inactive sessions | `/session-cleanup` |
|
|
95
|
+
|
|
96
|
+
#### Navigation
|
|
97
|
+
Control the working directory for Claude's file operations.
|
|
98
|
+
|
|
99
|
+
| Command | Description | Example |
|
|
100
|
+
|---------|-------------|---------|
|
|
101
|
+
| `/ls` | List directory contents | `/ls`, `/ls src/` |
|
|
102
|
+
| `/cd` | Change working directory | `/cd /home/user/project`, `cd subfolder`, `cd ..` |
|
|
103
|
+
| `/pwd` | Print working directory | `/pwd` |
|
|
104
|
+
| `/add-dir` | Add directory to context | `/add-dir ./lib` |
|
|
105
|
+
|
|
106
|
+
#### CLI Tools
|
|
107
|
+
Direct access to Claude Code CLI functionality.
|
|
108
|
+
|
|
109
|
+
| Command | Description | Example |
|
|
110
|
+
|---------|-------------|---------|
|
|
111
|
+
| `/init` | Initialize project config | `/init` |
|
|
112
|
+
| `/memory` | View/edit Claude's memory | `/memory` |
|
|
113
|
+
| `/review` | Review code changes | `/review` |
|
|
114
|
+
| `/doctor` | Diagnose installation | `/doctor` |
|
|
115
|
+
| `/stats` | Show session statistics | `/stats` |
|
|
116
|
+
| `/context` | Display context info | `/context` |
|
|
117
|
+
| `/todos` | List and manage todos | `/todos` |
|
|
118
|
+
| `/mcp` | Show MCP server configuration | `/mcp` |
|
|
119
|
+
| `/claude-help` | Show Claude Code help | `/claude-help` |
|
|
120
|
+
| `/claude-config` | Show configuration | `/claude-config` |
|
|
121
|
+
|
|
122
|
+
#### Multi-Agent Tasks
|
|
123
|
+
Autonomous Planner → Worker → Evaluator pipeline for complex tasks. Iterates up to 3 times until complete.
|
|
124
|
+
|
|
125
|
+
| Command | Description | Example |
|
|
126
|
+
|---------|-------------|---------|
|
|
127
|
+
| `/task` | Start a multi-agent task | `/task add unit tests for UserService` |
|
|
128
|
+
| `/tasks` | List active tasks with status | `/tasks` |
|
|
129
|
+
| `/task-cancel` | Cancel a running task | `/task-cancel abc123` |
|
|
130
|
+
|
|
131
|
+
#### Command Queue
|
|
132
|
+
Queue commands for sequential execution while preserving Claude's session context across items.
|
|
133
|
+
|
|
134
|
+
| Command | Description | Example |
|
|
135
|
+
|---------|-------------|---------|
|
|
136
|
+
| `/q` | Add command to queue | `/q analyze the API endpoints` |
|
|
137
|
+
| `/qv` | View queue status | `/qv` |
|
|
138
|
+
| `/qc` | Clear pending queue | `/qc` |
|
|
139
|
+
| `/qr` | Remove specific item | `/qr 5` |
|
|
140
|
+
|
|
141
|
+
#### Jobs & Control
|
|
142
|
+
Monitor and control long-running operations with real-time progress updates.
|
|
143
|
+
|
|
144
|
+
| Command | Description | Example |
|
|
145
|
+
|---------|-------------|---------|
|
|
146
|
+
| `/st` | Show active job status | `/st` |
|
|
147
|
+
| `/cc` | Cancel jobs | `/cc` or `/cc abc123` |
|
|
148
|
+
| `/esc` | Send interrupt (Ctrl+C) | `/esc` |
|
|
149
|
+
|
|
150
|
+
#### Git
|
|
151
|
+
Full git workflow without leaving Slack. Includes branch name and commit message validation.
|
|
152
|
+
|
|
153
|
+
| Command | Description | Example |
|
|
154
|
+
|---------|-------------|---------|
|
|
155
|
+
| `/status` | Show branch and changes | `/status` |
|
|
156
|
+
| `/diff` | Show uncommitted changes | `/diff --staged` |
|
|
157
|
+
| `/commit` | Commit staged changes | `/commit fix: resolve race condition` |
|
|
158
|
+
| `/branch` | Manage branches | `/branch create feature/auth` |
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
### 3. Configure
|
|
162
|
+
|
|
163
|
+
Use the built-in config CLI to securely store your Slack credentials:
|
|
164
|
+
|
|
165
|
+
```bash
|
|
166
|
+
ccslack-config set SLACK_BOT_TOKEN=xoxb-...
|
|
167
|
+
ccslack-config set SLACK_APP_TOKEN=xapp-...
|
|
168
|
+
ccslack-config set SLACK_SIGNING_SECRET=...
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
**Config CLI Commands:**
|
|
172
|
+
| Command | Description |
|
|
173
|
+
|---------|-------------|
|
|
174
|
+
| `ccslack-config set KEY=VALUE` | Store a configuration value |
|
|
175
|
+
| `ccslack-config get KEY` | Retrieve a configuration value |
|
|
176
|
+
| `ccslack-config list` | List all stored configuration |
|
|
177
|
+
| `ccslack-config delete KEY` | Remove a configuration value |
|
|
178
|
+
| `ccslack-config path` | Show config file locations |
|
|
179
|
+
|
|
180
|
+
Configuration is encrypted and stored in `~/.slack-claude-code/config.enc`. Sensitive values (tokens, secrets) are masked when displayed.
|
|
181
|
+
|
|
182
|
+
**Alternative:** You can also use environment variables or a `.env` file. Config values take precedence over environment variables.
|
|
183
|
+
|
|
184
|
+
**Where to find these values:**
|
|
185
|
+
- `SLACK_BOT_TOKEN`: Your App → OAuth & Permissions → Bot User OAuth Token
|
|
186
|
+
- `SLACK_APP_TOKEN`: Your App → Basic Information → App-Level Tokens → (token you created with `connections:write`)
|
|
187
|
+
- `SLACK_SIGNING_SECRET`: Your App → Basic Information → App Credentials → Signing Secret
|
|
188
|
+
|
|
189
|
+
### 4. Start the Slack bot
|
|
190
|
+
You can now run `ccslack` in your terminal. The working directory where you start the executable will be the default working directory for your Claude Code session(s). If you have a .env file in this directory, it will automatically be loaded.
|
|
191
|
+
|
|
192
|
+
## Usage
|
|
193
|
+
|
|
194
|
+
Type messages in any channel where the bot is installed. The main channel is a single Claude Code session. If you click `reply` to any message and start a thread, this will be a new Claude Code session.
|
|
195
|
+
|
|
196
|
+
## Architecture
|
|
197
|
+
|
|
198
|
+
```
|
|
199
|
+
src/
|
|
200
|
+
├── app.py # Main entry point
|
|
201
|
+
├── config.py # Configuration
|
|
202
|
+
├── database/ # SQLite persistence (models, migrations, repository)
|
|
203
|
+
├── claude/ # Claude CLI integration (streaming)
|
|
204
|
+
├── handlers/ # Slack command handlers
|
|
205
|
+
├── agents/ # Multi-agent orchestration (planner→worker→evaluator)
|
|
206
|
+
├── approval/ # Permission & plan approval handling
|
|
207
|
+
├── git/ # Git operations (status, diff, commit, branch)
|
|
208
|
+
├── hooks/ # Event hook system
|
|
209
|
+
├── question/ # AskUserQuestion tool support
|
|
210
|
+
├── tasks/ # Background task management
|
|
211
|
+
└── utils/ # Formatters, helpers, validators
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
## Troubleshooting
|
|
215
|
+
|
|
216
|
+
| Problem | Solution |
|
|
217
|
+
|---------|----------|
|
|
218
|
+
| Configuration errors on startup | Check `.env` has all required tokens |
|
|
219
|
+
| Commands not appearing | Verify slash commands in Slack app settings |
|
|
220
|
+
|
|
221
|
+
## License
|
|
222
|
+
|
|
223
|
+
MIT
|
|
224
|
+
|
|
225
|
+
- - -
|
|
226
|
+
|
|
227
|
+
Congratulations, you can now use Claude Code from anywhere 🎉💪
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="assets/repo_logo.png" alt="Slack Claude Code Bot" width="1000">
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
<p align="center">
|
|
6
|
+
<a href="https://pypi.org/project/slack-claude-code/"><img src="https://img.shields.io/pypi/v/slack-claude-code" alt="PyPI version"></a>
|
|
7
|
+
<a href="https://pypi.org/project/slack-claude-code/"><img src="https://img.shields.io/pypi/pyversions/slack-claude-code" alt="Python versions"></a>
|
|
8
|
+
<a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="License"></a>
|
|
9
|
+
<a href="https://github.com/djkelleher/slack-claude-code/actions/workflows/tests.yml"><img src="https://github.com/djkelleher/slack-claude-code/actions/workflows/tests.yml/badge.svg" alt="Tests"></a>
|
|
10
|
+
</p>
|
|
11
|
+
|
|
12
|
+
**Claude Code, but in Slack.** Access Claude Code remotely from any device, or use it full-time for a better UI experience.
|
|
13
|
+
|
|
14
|
+
## Why Slack?
|
|
15
|
+
|
|
16
|
+
| Feature | Terminal | Slack |
|
|
17
|
+
|---------|----------|-------|
|
|
18
|
+
| **Code blocks** | Plain text | Syntax-highlighted with copy button |
|
|
19
|
+
| **Long output** | Scrolls off screen | "View Details" modal |
|
|
20
|
+
| **Permissions** | Y/n prompts | Approve/Deny buttons |
|
|
21
|
+
| **Parallel work** | Multiple terminals | Threads = isolated sessions |
|
|
22
|
+
| **File sharing** | `cat` or copy-paste | Drag & drop with preview |
|
|
23
|
+
| **Notifications** | Watch the terminal | Alerts when tasks complete |
|
|
24
|
+
| **Streaming** | Live terminal output | Watch responses as they generate |
|
|
25
|
+
| **Smart context** | Manual file inclusion | Frequently-used files auto-included |
|
|
26
|
+
|
|
27
|
+
## Installation
|
|
28
|
+
|
|
29
|
+
### Prerequisites
|
|
30
|
+
- Python 3.10+
|
|
31
|
+
- [Claude Code CLI](https://github.com/anthropics/claude-code) installed and authenticated
|
|
32
|
+
|
|
33
|
+
### 1. Install the `ccslack` executable
|
|
34
|
+
```bash
|
|
35
|
+
pipx install slack-claude-code
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### 2. Create Slack App
|
|
39
|
+
Go to https://api.slack.com/apps → "Create New App" → "From scratch"
|
|
40
|
+
|
|
41
|
+
**Socket Mode**: Enable and create an app-level token with `connections:write` scope (save the `xapp-` token)
|
|
42
|
+
|
|
43
|
+
**Bot Token Scopes** (OAuth & Permissions):
|
|
44
|
+
- `chat:write`, `commands`, `channels:history`, `app_mentions:read`, `files:read`, `files:write`
|
|
45
|
+
|
|
46
|
+
**Event Subscriptions**: Enable and add `message.channels`, `app_mention`
|
|
47
|
+
|
|
48
|
+
**App Icon**: In "Basic Information" → "Display Information", upload `assets/claude_logo.png` from this repo as the app icon
|
|
49
|
+
|
|
50
|
+
**Slash Commands**: Add the commands from the tables below (or the subset that you plan to use)
|
|
51
|
+
|
|
52
|
+
#### Configuration
|
|
53
|
+
Customize Claude's behavior for your workflow.
|
|
54
|
+
|
|
55
|
+
| Command | Description | Example |
|
|
56
|
+
|---------|-------------|---------|
|
|
57
|
+
| `/model` | Show or change AI model | `/model sonnet` |
|
|
58
|
+
| `/mode` | View or set permission mode | `/mode`, `/mode plan` |
|
|
59
|
+
| `/permissions` | View/update permissions | `/permissions` |
|
|
60
|
+
| `/notifications` | Configure notifications | `/notifications` |
|
|
61
|
+
|
|
62
|
+
#### Session Management
|
|
63
|
+
Each Slack thread maintains an isolated Claude session with its own context.
|
|
64
|
+
|
|
65
|
+
| Command | Description | Example |
|
|
66
|
+
|---------|-------------|---------|
|
|
67
|
+
| `/clear` | Reset conversation | `/clear` |
|
|
68
|
+
| `/compact` | Compact context | `/compact` |
|
|
69
|
+
| `/cost` | Show session cost | `/cost` |
|
|
70
|
+
| `/resume` | Resume previous session | `/resume` |
|
|
71
|
+
| `/sessions` | List active sessions | `/sessions` |
|
|
72
|
+
| `/session-cleanup` | Clean up inactive sessions | `/session-cleanup` |
|
|
73
|
+
|
|
74
|
+
#### Navigation
|
|
75
|
+
Control the working directory for Claude's file operations.
|
|
76
|
+
|
|
77
|
+
| Command | Description | Example |
|
|
78
|
+
|---------|-------------|---------|
|
|
79
|
+
| `/ls` | List directory contents | `/ls`, `/ls src/` |
|
|
80
|
+
| `/cd` | Change working directory | `/cd /home/user/project`, `cd subfolder`, `cd ..` |
|
|
81
|
+
| `/pwd` | Print working directory | `/pwd` |
|
|
82
|
+
| `/add-dir` | Add directory to context | `/add-dir ./lib` |
|
|
83
|
+
|
|
84
|
+
#### CLI Tools
|
|
85
|
+
Direct access to Claude Code CLI functionality.
|
|
86
|
+
|
|
87
|
+
| Command | Description | Example |
|
|
88
|
+
|---------|-------------|---------|
|
|
89
|
+
| `/init` | Initialize project config | `/init` |
|
|
90
|
+
| `/memory` | View/edit Claude's memory | `/memory` |
|
|
91
|
+
| `/review` | Review code changes | `/review` |
|
|
92
|
+
| `/doctor` | Diagnose installation | `/doctor` |
|
|
93
|
+
| `/stats` | Show session statistics | `/stats` |
|
|
94
|
+
| `/context` | Display context info | `/context` |
|
|
95
|
+
| `/todos` | List and manage todos | `/todos` |
|
|
96
|
+
| `/mcp` | Show MCP server configuration | `/mcp` |
|
|
97
|
+
| `/claude-help` | Show Claude Code help | `/claude-help` |
|
|
98
|
+
| `/claude-config` | Show configuration | `/claude-config` |
|
|
99
|
+
|
|
100
|
+
#### Multi-Agent Tasks
|
|
101
|
+
Autonomous Planner → Worker → Evaluator pipeline for complex tasks. Iterates up to 3 times until complete.
|
|
102
|
+
|
|
103
|
+
| Command | Description | Example |
|
|
104
|
+
|---------|-------------|---------|
|
|
105
|
+
| `/task` | Start a multi-agent task | `/task add unit tests for UserService` |
|
|
106
|
+
| `/tasks` | List active tasks with status | `/tasks` |
|
|
107
|
+
| `/task-cancel` | Cancel a running task | `/task-cancel abc123` |
|
|
108
|
+
|
|
109
|
+
#### Command Queue
|
|
110
|
+
Queue commands for sequential execution while preserving Claude's session context across items.
|
|
111
|
+
|
|
112
|
+
| Command | Description | Example |
|
|
113
|
+
|---------|-------------|---------|
|
|
114
|
+
| `/q` | Add command to queue | `/q analyze the API endpoints` |
|
|
115
|
+
| `/qv` | View queue status | `/qv` |
|
|
116
|
+
| `/qc` | Clear pending queue | `/qc` |
|
|
117
|
+
| `/qr` | Remove specific item | `/qr 5` |
|
|
118
|
+
|
|
119
|
+
#### Jobs & Control
|
|
120
|
+
Monitor and control long-running operations with real-time progress updates.
|
|
121
|
+
|
|
122
|
+
| Command | Description | Example |
|
|
123
|
+
|---------|-------------|---------|
|
|
124
|
+
| `/st` | Show active job status | `/st` |
|
|
125
|
+
| `/cc` | Cancel jobs | `/cc` or `/cc abc123` |
|
|
126
|
+
| `/esc` | Send interrupt (Ctrl+C) | `/esc` |
|
|
127
|
+
|
|
128
|
+
#### Git
|
|
129
|
+
Full git workflow without leaving Slack. Includes branch name and commit message validation.
|
|
130
|
+
|
|
131
|
+
| Command | Description | Example |
|
|
132
|
+
|---------|-------------|---------|
|
|
133
|
+
| `/status` | Show branch and changes | `/status` |
|
|
134
|
+
| `/diff` | Show uncommitted changes | `/diff --staged` |
|
|
135
|
+
| `/commit` | Commit staged changes | `/commit fix: resolve race condition` |
|
|
136
|
+
| `/branch` | Manage branches | `/branch create feature/auth` |
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
### 3. Configure
|
|
140
|
+
|
|
141
|
+
Use the built-in config CLI to securely store your Slack credentials:
|
|
142
|
+
|
|
143
|
+
```bash
|
|
144
|
+
ccslack-config set SLACK_BOT_TOKEN=xoxb-...
|
|
145
|
+
ccslack-config set SLACK_APP_TOKEN=xapp-...
|
|
146
|
+
ccslack-config set SLACK_SIGNING_SECRET=...
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
**Config CLI Commands:**
|
|
150
|
+
| Command | Description |
|
|
151
|
+
|---------|-------------|
|
|
152
|
+
| `ccslack-config set KEY=VALUE` | Store a configuration value |
|
|
153
|
+
| `ccslack-config get KEY` | Retrieve a configuration value |
|
|
154
|
+
| `ccslack-config list` | List all stored configuration |
|
|
155
|
+
| `ccslack-config delete KEY` | Remove a configuration value |
|
|
156
|
+
| `ccslack-config path` | Show config file locations |
|
|
157
|
+
|
|
158
|
+
Configuration is encrypted and stored in `~/.slack-claude-code/config.enc`. Sensitive values (tokens, secrets) are masked when displayed.
|
|
159
|
+
|
|
160
|
+
**Alternative:** You can also use environment variables or a `.env` file. Config values take precedence over environment variables.
|
|
161
|
+
|
|
162
|
+
**Where to find these values:**
|
|
163
|
+
- `SLACK_BOT_TOKEN`: Your App → OAuth & Permissions → Bot User OAuth Token
|
|
164
|
+
- `SLACK_APP_TOKEN`: Your App → Basic Information → App-Level Tokens → (token you created with `connections:write`)
|
|
165
|
+
- `SLACK_SIGNING_SECRET`: Your App → Basic Information → App Credentials → Signing Secret
|
|
166
|
+
|
|
167
|
+
### 4. Start the Slack bot
|
|
168
|
+
You can now run `ccslack` in your terminal. The working directory where you start the executable will be the default working directory for your Claude Code session(s). If you have a .env file in this directory, it will automatically be loaded.
|
|
169
|
+
|
|
170
|
+
## Usage
|
|
171
|
+
|
|
172
|
+
Type messages in any channel where the bot is installed. The main channel is a single Claude Code session. If you click `reply` to any message and start a thread, this will be a new Claude Code session.
|
|
173
|
+
|
|
174
|
+
## Architecture
|
|
175
|
+
|
|
176
|
+
```
|
|
177
|
+
src/
|
|
178
|
+
├── app.py # Main entry point
|
|
179
|
+
├── config.py # Configuration
|
|
180
|
+
├── database/ # SQLite persistence (models, migrations, repository)
|
|
181
|
+
├── claude/ # Claude CLI integration (streaming)
|
|
182
|
+
├── handlers/ # Slack command handlers
|
|
183
|
+
├── agents/ # Multi-agent orchestration (planner→worker→evaluator)
|
|
184
|
+
├── approval/ # Permission & plan approval handling
|
|
185
|
+
├── git/ # Git operations (status, diff, commit, branch)
|
|
186
|
+
├── hooks/ # Event hook system
|
|
187
|
+
├── question/ # AskUserQuestion tool support
|
|
188
|
+
├── tasks/ # Background task management
|
|
189
|
+
└── utils/ # Formatters, helpers, validators
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
## Troubleshooting
|
|
193
|
+
|
|
194
|
+
| Problem | Solution |
|
|
195
|
+
|---------|----------|
|
|
196
|
+
| Configuration errors on startup | Check `.env` has all required tokens |
|
|
197
|
+
| Commands not appearing | Verify slash commands in Slack app settings |
|
|
198
|
+
|
|
199
|
+
## License
|
|
200
|
+
|
|
201
|
+
MIT
|
|
202
|
+
|
|
203
|
+
- - -
|
|
204
|
+
|
|
205
|
+
Congratulations, you can now use Claude Code from anywhere 🎉💪
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
[tool.poetry]
|
|
2
|
+
name = "slack-claude-code"
|
|
3
|
+
version = "0.1.6"
|
|
4
|
+
description = "Slack app for running Claude Code CLI commands"
|
|
5
|
+
authors = ["Dan"]
|
|
6
|
+
readme = "README.md"
|
|
7
|
+
packages = [{include = "src"}]
|
|
8
|
+
|
|
9
|
+
[tool.poetry.scripts]
|
|
10
|
+
ccslack = "src.app:run"
|
|
11
|
+
ccslack-config = "src.cli:run"
|
|
12
|
+
|
|
13
|
+
[tool.poetry.dependencies]
|
|
14
|
+
python = "^3.10"
|
|
15
|
+
slack-bolt = "^1.27.0"
|
|
16
|
+
aiosqlite = "^0.21.0"
|
|
17
|
+
pydantic-settings = "^2.7.0"
|
|
18
|
+
aiohttp = "^3.13.2"
|
|
19
|
+
aiofiles = "^24.1.0"
|
|
20
|
+
loguru = "^0.7.0"
|
|
21
|
+
cryptography = "^44.0.0"
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
[tool.poetry.group.dev.dependencies]
|
|
25
|
+
pytest = "^9.0.2"
|
|
26
|
+
pytest-asyncio = "^1.3.0"
|
|
27
|
+
pytest-cov = "^7.0.0"
|
|
28
|
+
|
|
29
|
+
[build-system]
|
|
30
|
+
requires = ["poetry-core>=2.0.0,<3.0.0"]
|
|
31
|
+
build-backend = "poetry.core.masonry.api"
|
|
File without changes
|