Skip to content

Commit 59aa5c6

Browse files
committed
docs: update all documentation for v2.3.0 (channel monitoring, thread-per-session)
1 parent 6fcb8ef commit 59aa5c6

File tree

8 files changed

+65
-3
lines changed

8 files changed

+65
-3
lines changed

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,21 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [2.3.0] - 2026-03-03
9+
10+
### Added
11+
- **Channel Monitoring** (#17): Watch a Discord channel for bot/webhook messages and auto-trigger a Claude investigation in a thread. Messages are batched over a 30-second debounce window. Requires `MONITOR_CHANNEL_ID` and `MONITOR_BOT_IDS` env vars and the Message Content privileged intent.
12+
- **Thread-per-Session** (#19): New `/claude-thread` command starts each conversation in a dedicated Discord thread with a custom name.
13+
- **Per-Channel Session Tracking**: Regular `/claude` commands in the same channel automatically reuse the last session — no need to pass `session_id` manually.
14+
- **Custom Thread Names**: `/claude-thread name:"Fix auth bug" prompt:"Review the auth module"` creates a thread titled "Fix auth bug".
15+
- **Thread-Aware Channel Detection**: Commands work correctly inside session threads (bot recognizes the parent channel).
16+
17+
### Changed
18+
- `discord/session-threads.ts` added — `SessionThreadManager` handles thread creation, lookup, and lifecycle
19+
- `discord/types.ts``InteractionContext` now exposes `getChannelId()` for per-channel session mapping
20+
- `core/handler-registry.ts``channelSessionMap` maintains channel → session mapping
21+
- `.env.example` updated with Channel Monitoring section
22+
823
## [2.2.0] - 2025-07-18
924

1025
### Added
@@ -188,6 +203,7 @@ This is the first stable release of Claude Code Discord Bot - a Discord bot that
188203

189204
---
190205

206+
[2.3.0]: https://github.com/zebbern/claude-code-discord/releases/tag/v2.3.0
191207
[2.2.0]: https://github.com/zebbern/claude-code-discord/releases/tag/v2.2.0
192208
[2.0.0]: https://github.com/zebbern/claude-code-discord/releases/tag/v2.0.0
193209
[1.0.0]: https://github.com/zebbern/claude-code-discord/releases/tag/v1.0.0

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
| Role-based access control | Restrict destructive commands (`/shell`, `/git`, worktree ops) to specific Discord roles ||
2727
| Local hosting & security | Keep keys and code on your infra while exposing a controlled interface through Discord ||
2828
| Channel monitoring | Watch a channel for bot/webhook messages and auto-investigate in a thread ||
29+
| Thread-per-session | Each `/claude-thread` conversation gets its own Discord thread with custom names ||
2930
| Audit trail & accountability | Channel history provides an easy-to-search record of who ran what and when ||
3031

3132
</kbd>

deno.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "2.2.0",
2+
"version": "2.3.0",
33
"compilerOptions": {
44
"lib": ["deno.window"],
55
"strict": true

docs/architecture.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ claude-code-discord/
2424
2525
├── discord/ # Discord integration layer
2626
│ ├── sender.ts # Message sending, embeds, streaming
27+
│ ├── session-threads.ts # Thread-per-session lifecycle management
2728
│ └── ...
2829
2930
├── settings/ # Settings management

docs/commands.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
# Command Reference
22

3-
## Core Claude Commands (3)
3+
## Core Claude Commands (4)
44

55
| Command | Description |
66
|---------|-------------|
77
| `/claude` | Send a prompt to Claude Code. Supports `prompt` and `session_id` options. |
8+
| `/claude-thread` | Start a new Claude conversation in a dedicated Discord thread. Options: `name` (thread title), `prompt`. |
89
| `/resume` | Resume (continue) a previous Claude conversation with an optional follow-up prompt. |
910
| `/claude-cancel` | Cancel the currently running Claude operation. |
1011
| `/fast` | Toggle Opus 4.6 fast mode — 2.5x faster responses, same quality. |

docs/features.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ Set via `/settings` > `claude` > `set-effort`.
4949
| Fork Session | Branch a conversation into a new independent session |
5050
| AskUserQuestion | Claude can ask clarifying questions mid-session via Discord buttons |
5151
| Interactive Permission Requests | Allow/Deny buttons when Claude wants to use unapproved tools (replaces CLI TUI prompt) |
52+
| Channel Monitoring | Auto-detect bot/webhook messages and trigger Claude investigation in a thread |
53+
| Thread-per-Session | Dedicated Discord thread for each `/claude-thread` conversation with custom names |
5254

5355
Toggles available via `/settings` > `claude`.
5456

@@ -153,6 +155,43 @@ Example schema:
153155

154156
When enabled, responses follow `json_schema` output format through the SDK.
155157

158+
## Thread-per-Session
159+
160+
Keep conversations organized with dedicated Discord threads:
161+
162+
- **`/claude-thread`** — Start a new Claude session in its own thread
163+
- `name` — Custom thread title (required)
164+
- `prompt` — Your initial prompt (required)
165+
- **Per-channel session tracking** — Regular `/claude` commands in the same channel automatically reuse the last session (no need to pass `session_id`)
166+
- **Thread auto-naming** — Threads are named with your custom title or a truncated version of the prompt
167+
- **Seamless continuation** — Subsequent `/claude` commands inside a session thread continue that conversation
168+
169+
### How It Works
170+
171+
1. Run `/claude-thread name:"Fix auth bug" prompt:"Review the auth module"`
172+
2. A new thread titled **Fix auth bug** is created
173+
3. Claude's response streams into the thread
174+
4. Any further `/claude` commands in that thread continue the same session
175+
5. Use `/claude-thread` again in the main channel to start a fresh conversation in a new thread
176+
177+
## Channel Monitoring
178+
179+
Automatically investigate alerts from other bots or webhooks:
180+
181+
1. A monitored bot posts in the configured channel
182+
2. Messages are batched over a 30-second debounce window
183+
3. A thread is created on the alert message
184+
4. Claude analyzes the alert and streams its investigation into the thread
185+
186+
### Setup
187+
188+
```env
189+
MONITOR_CHANNEL_ID=123456789012345678 # Channel to watch
190+
MONITOR_BOT_IDS=987654321,111111111 # Bot/webhook user IDs to respond to
191+
```
192+
193+
Requires the **Message Content** privileged intent enabled in the Discord Developer Portal. The bot needs Read Messages, Create Public Threads, and Send Messages in Threads permissions in the monitored channel.
194+
156195
## Role-Based Access Control (RBAC)
157196

158197
Restrict dangerous commands to authorized users and roles:

docs/installation.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,10 @@ ANTHROPIC_API_KEY=your_anthropic_api_key_here # Only needed if not using `claud
123123
USER_ID=your_discord_user_id # Get mentioned when Claude finishes
124124
CATEGORY_NAME=claude-code # Discord category for channels
125125
WORK_DIR=/path/to/project # Working directory (default: current)
126+
127+
# Channel Monitoring (optional)
128+
MONITOR_CHANNEL_ID=123456789012345678 # Channel to watch for alerts
129+
MONITOR_BOT_IDS=987654321,111111111 # Bot/webhook user IDs to respond to
126130
```
127131

128132
Environment variables override `.env` file settings. CLI flags override environment variables.

docs/known-issues.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Known Issues & Accepted Risks
22

3-
> Last audited: 2025-02-18
3+
> Last audited: 2026-03-03
44
> Context: Single-user personal Discord bot — not a production multi-user service
55
66
This document tracks issues identified during a comprehensive code audit that were **intentionally not fixed**. Each entry explains why the issue exists, why it doesn't matter for our use case, and under what conditions (if any) it would need revisiting.

0 commit comments

Comments
 (0)