What are Channels?
Channels are the communication surfaces through which agents receive work and send responses. They abstract away the specifics of different messaging systems, allowing the same agent to work across CLI, Slack, Discord, and more. In Kubernetes terms, channels are like Services—they define how work reaches your agents.Channel Architecture
Supported Channels
Terminal
Interactive command-line interface with styled output
TUI
Beautiful terminal UI with Bubble Tea
Slack
Full Slack integration with thread support
API
REST API for programmatic access
Channel Interface
All channels implement a common interface:Message Structure
Messages flow bidirectionally through channels:Metadata Examples
Different channels attach different metadata:- Slack
- CLI
- API
Terminal Channel
The default interactive experience:- Styled output with colors and formatting
- Real-time streaming of responses
- Tool execution visualization with box drawing
- Command history
- Multi-line input support
Simple Mode
For basic terminals without advanced features:TUI Channel
Rich terminal UI built with Bubble Tea:- Syntax highlighting for code
- Scrollable message history
- Progress indicators
- Keyboard shortcuts
- Split-pane view
Slack Channel
Full-featured Slack bot integration:Setup Requirements
- Create a Slack app at api.slack.com
- Enable Socket Mode
- Add bot scopes:
chat:write,app_mentions:read,channels:history - Install to workspace
- Set environment variables:
Thread Support
klaw automatically handles Slack threads:- Messages in threads get their own conversation context
- Main channel messages start new conversations
@mentionthe bot to engage it
Example Interaction
API Channel
REST API for programmatic access:Endpoints
| Method | Endpoint | Description |
|---|---|---|
| POST | /v1/chat | Send a message and get response |
| POST | /v1/chat/stream | Stream response with SSE |
| GET | /v1/agents | List available agents |
| GET | /v1/health | Health check |
Example Request
Streaming Response
Channel Bindings
Connect channels to namespaces in distributed mode:Streaming
All channels support real-time streaming:Custom Channels
Implement the Channel interface to add custom channels:Best Practices
Use thread-aware conversations
Use thread-aware conversations
In Slack and similar platforms, leverage threading to maintain separate conversation contexts.
Enable streaming for better UX
Enable streaming for better UX
Streaming responses show progress and reduce perceived latency.
Secure API channels
Secure API channels
Always use authentication for API channels in production.
Filter channels appropriately
Filter channels appropriately
In Slack, limit bot access to specific channels to prevent noise.

