Docs
Slack integration
Slack integration is optional but recommended. Last Light uses two independent Slack features that you can enable one at a time.
- Socket Mode chat — the bot listens for messages and
@mentions, classifies intent, and runs the in-process
chatskill to reply. Every Slack thread becomes a growing, DB-backed conversation that resumes the same Claude Agent SDK session on every turn, so context stays coherent across hours or days. - OAuth dashboard login — the admin dashboard offers "Login with Slack" via OpenID Connect. You can restrict login to one workspace so only your team can see execution history.
Create the Slack app
Go to api.slack.com/apps and click Create New App → From scratch.
Enable Socket Mode chat
In the app's settings, do the following:
- Socket Mode → enable it. Create an App-Level Token with the
connections:writescope. Copy thexapp-...value — that'sSLACK_APP_TOKEN. - OAuth & Permissions → add Bot Token Scopes:
app_mentions:readchat:writeim:history,im:read,im:writechannels:history,groups:historycommands(if you want/approve,/rejectslash commands)
- Install to Workspace. After install, copy the Bot User OAuth Token (
xoxb-...) — that'sSLACK_BOT_TOKEN. - Event Subscriptions → subscribe to bot events:
message.im— direct messagesapp_mention— @mentions in channels
- Slash Commands (optional) → create
/approve,/reject,/status,/resetpointing at your app (Socket Mode handles the request URL).
Add the tokens to .env (or secrets/.env in production):
SLACK_BOT_TOKEN=xoxb-...
SLACK_APP_TOKEN=xapp-... Optional restrictions and routing:
SLACK_ALLOWED_USERS=U01ABC,U02DEF # Comma-separated user IDs allowed to interact
SLACK_DELIVERY_CHANNEL=C01XYZ # Channel for cron health reports
Restart the harness. You should see a [slack] Connected log line,
and DM'ing the bot should get a reply. Every conversation shows up on the
dashboard's Chat Sessions tab.
chat skill is intentionally not overridden with Haiku in
CLAUDE_MODELS — Haiku tends to refuse MCP tool calls on the
assumption it lacks permission, which creates false "I can't do that" replies.
Leave it on Sonnet.
Enable OAuth dashboard login
The dashboard can optionally let your team log in with Slack via OpenID Connect. Back in the Slack app settings:
- OAuth & Permissions → User Token Scopes → add
openid,email,profile. (These are user scopes, separate from the bot scopes above.) - Redirect URLs → add exactly:
https://your-host/admin/api/oauth/slack/callback(orhttp://localhost:8644/...for local dev). - Basic Information → copy the Client ID and Client Secret.
Add the following to .env:
SLACK_OAUTH_CLIENT_ID=...
SLACK_OAUTH_CLIENT_SECRET=...
SLACK_OAUTH_REDIRECT_URI=https://your-host/admin/api/oauth/slack/callback
SLACK_ALLOWED_WORKSPACE=T01ABCDEF # Optional: restrict to one team_id or domain
With these set, the dashboard login page shows a "Login with Slack" button
alongside the password login (or instead of it, if you don't set
ADMIN_PASSWORD).