slaude Docs

Introduction

Getting Started

Deploy a Claude Code agent as a teammate in your Slack workspace. One Slack thread equals one persistent Claude session — with a durable persona you define.

What is Slaude?#

Slaude is a Slack-native runtime for Claude Code. It bridges Slack Socket Mode to the @anthropic-ai/claude-agent-sdk so your team can @mention an agent that remembers context, writes skills, and asks for approval before mutating anything.

Core model:

ConceptWhat it means
1 thread = 1 sessionEach Slack thread maps to a persistent Claude session. The SDK resume flag keeps conversation history across idle restarts (default TTL: 15 min).
Two-layer personaA hardcoded runtime baseline (Slack output rules, approval discipline, engagement model) + your operator-defined SOUL.md (name, role, voice, manager, mandate, approvers). You only author the second layer.
Slack output via MCPThe agent never streams raw text to Slack. All output goes through an in-process MCP server (mcp__slaude_slack__reply / edit / upload / request_approval). Tables, code blocks, and links are auto-converted to Slack mrkdwn.
Headless, single-containerOne container = one persona = one SOUL.md. Run it on any host that can reach Slack via Socket Mode. Scale to more agents by deploying more containers.

Note: Slaude is inspired by NousResearch/hermes-agent but is Slack-only and powered by the official Claude Agent SDK.

Prerequisites#

RequirementVersion / DetailsCheck
Bun>= 1.3 (runtime + package manager)bun --version — install: `curl -fsSL https://bun.sh/install
Docker>= 24 with Compose v2docker compose version
Slack workspaceAdmin rights to create apps, or permission to install from manifest
Anthropic-compatible providerOne of the auth options below
GitAny recent versiongit --version

Auth options (pick one)#

OptionWhen to useEnv vars
API keyMetered usage, any Anthropic-compatible gatewayANTHROPIC_API_KEY=sk-ant-...
Claude Pro / Max subscriptionRun on your Claude subscription instead of API creditsCLAUDE_CODE_OAUTH_TOKEN=sk-ant-oat01-... (from claude setup-token)
Third-party gatewayOpenRouter, Z.ai, self-hostedANTHROPIC_BASE_URL + ANTHROPIC_API_KEY + SLAUDE_MODEL (required)

Tip: When using CLAUDE_CODE_OAUTH_TOKEN, leave SLAUDE_MODEL unset to inherit the subscription's default model. Set SLAUDE_MODEL only to pin a specific model or when pointing ANTHROPIC_BASE_URL at a non-Anthropic gateway.

Quickstart (5 minutes)#

1. Clone and install#

bash
git clone https://github.com/barockok/slaude.git
cd slaude
bun install

2. Generate the Slack app manifest#

bash
bun run manifest > manifest.json
cat manifest.json

This prints the JSON that declares required scopes (chat:write, app_mentions:read, assistant:write, etc.), Socket Mode, and event subscriptions.

3. Create the Slack app#

  1. Go to https://api.slack.com/appsCreate New AppFrom manifest → paste the contents of manifest.json → select your workspace → Create.
  2. Basic InformationApp-Level TokensGenerate Token → scope connections:write → copy the token (xapp-...). This is SLACK_APP_TOKEN.
  3. OAuth & PermissionsInstall to WorkspaceAllow → copy the Bot Token (xoxb-...). This is SLACK_BOT_TOKEN.
  4. Agents & AI Apps (optional but recommended) → enable Assistant view to unlock the animated assistant.threads.setStatus indicator ("thinking...", "running cmd").
  5. Socket Mode → confirm it is Enabled.

Warning: Reinstall the app to your workspace whenever you regenerate the manifest with changed scopes — otherwise the bot token will lack the new permissions.

4. Configure environment#

Slaude loads env from ~/.slaude/.env (host) or ./.env (repo root / Docker). For local dev, copy the example:

bash
cp .env.example .env
# or for a persistent home:
mkdir -p ~/.slaude && cp .env.example ~/.slaude/.env

Edit .env and set at minimum:

bash
# Slack — from step 3
SLACK_BOT_TOKEN=xoxb-...
SLACK_APP_TOKEN=xapp-...

# LLM — pick one auth mode
ANTHROPIC_API_KEY=sk-ant-...
# OR
CLAUDE_CODE_OAUTH_TOKEN=sk-ant-oat01-...

# Optional: only needed for non-Anthropic gateways
# ANTHROPIC_BASE_URL=https://openrouter.ai/api/v1
# SLAUDE_MODEL=claude-sonnet-4-6

# Sensible defaults — change as needed
SLAUDE_DEFAULT_MODE=bypass
SLAUDE_AUTO_ALLOW_TOOLS=Read,Grep,Glob,LS
SLAUDE_IDLE_MINUTES=15
SLAUDE_HEALTH_PORT=8080

Key environment variables:

VariableRequiredDefaultDescription
SLACK_BOT_TOKENYesBot token xoxb-... from OAuth install
SLACK_APP_TOKENYesApp-level token xapp-... with connections:write
ANTHROPIC_API_KEYOne of this / CLAUDE_CODE_OAUTH_TOKENMetered API key
CLAUDE_CODE_OAUTH_TOKENOne of this / ANTHROPIC_API_KEYSubscription OAuth token (sk-ant-oat01-...)
ANTHROPIC_BASE_URLNohttps://api.anthropic.comGateway URL for OpenRouter / Z.ai / self-hosted
SLAUDE_MODELOnly with ANTHROPIC_BASE_URLSDK defaultProvider-qualified model id (e.g. claude-sonnet-4-6)
SLAUDE_DEFAULT_MODENobypass (Docker) / ask (env.example)Default permission mode for new threads
SLAUDE_AUTO_ALLOW_TOOLSNoRead,Grep,Glob,LSTools auto-approved without Block Kit prompt
SLAUDE_IDLE_MINUTESNo15Minutes before SDK Query closes; next message resumes
SLAUDE_HEALTH_PORTNo8080Health/metrics port; 0 disables

Note: SLAUDE_DEFAULT_MODE values: ask (prompt per tool), accept-edits (auto-allow reads/writes), bypass (YOLO — rely on approval gate + persona mandate), plan (read-only), dont-ask (deny unapproved).

5. Seed the persona (SOUL.md)#

On first boot Slaude auto-seeds ~/.slaude/SOUL.md with a starter scaffold. To customize before first boot:

bash
mkdir -p ~/.slaude   # or ./data for Docker
cat > ~/.slaude/SOUL.md <<'MD'
## Identity
- Name: slaude
- Role: senior platform engineer
- Voice: concise, direct

## Reporting
- Manager: U0XXXXXXXXX
- Manager handle: @you

## Mandate
- Help the team ship; refuse destructive ops without explicit approval.
MD

Validate at any time:

bash
bun run validate-soul
# exit 0 = ok, 1 = missing required fields, 2 = extraction failure

Required fields: identity.name, manager.userId, mandate. See SOUL Guide for the full schema.

6. Run#

Local dev (with watch):

bash
bun run dev
# or without watch:
bun run start

Docker (recommended for persistent deploys):

bash
# Place persona + env where compose expects them
mkdir -p ./data
cp .env ./data/.env        # or ensure SLACK_* / ANTHROPIC_* are exported
cp ~/.slaude/SOUL.md ./data/SOUL.md  # if you customized it

docker compose up -d --build
docker compose logs -f

Docker mounts ./data/data (SLAUDE_HOME) as a persistent volume holding SOUL.md, mcp.json, slaude.json, db.sqlite, skills, and knowledge bases.

Note: docker compose reads env from ./.env on the host and forwards it into the container. ~/.slaude/.env and ./data/.env are also loaded inside the container via SLAUDE_HOME. Any one location works — ./.env is simplest for Docker.

Verify Installation#

1. Health endpoints#

Slaude exposes three endpoints on SLAUDE_HEALTH_PORT (default 8080):

bash
curl -s http://localhost:8080/healthz | jq .
# {"status":"ok"}

curl -s http://localhost:8080/readyz | jq .
# {"status":"ok"}

curl -s http://localhost:8080/metrics | head -n 20
# # HELP slaude_sessions_live Current live sessions
# # TYPE slaude_sessions_live gauge
# slaude_sessions_live 1
EndpointSuccessFailure indicates
GET /healthz200 {"status":"ok"}Process not running
GET /readyz200 {"status":"ok"}sqlite unreachable
GET /metrics200 Prometheus textMetrics registry error

Tip: For Docker, map or expose the health port if you changed it. The default docker-compose.yaml relies on the container's 8080.

2. Slack DM test#

  1. Invite the bot to any channel or just open a DM with it.

  2. Send:

    text
    hello — are you there?

    The bot should reply in-thread. DMs are always engaged (no @mention needed).

  3. In a public channel, @mention it:

    text
    @slaude what is 2+2?

    The thread should engage and reply. Mentioning someone else in the same thread disengages the bot.

  4. Check logs if nothing happens:

    bash
    # local
    # logs print to stdout — look for "[slaude] slack socket mode started" and no "missing env" errors
    
    # docker
    docker compose logs --tail 100 slaude

Common first-run issues:

SymptomFix
missing env SLACK_BOT_TOKEN.env not loaded — confirm it is at ~/.slaude/.env or ./.env (local) or ./data/.env (Docker)
invalid_auth from SlackReinstall the app after manifest changes; confirm xoxb- and xapp- are not swapped
Socket Mode connection failsVerify SLACK_APP_TOKEN has connections:write and Socket Mode is enabled
ANTHROPIC_API_KEY / OAuth errorsConfirm exactly one auth mode is set; gateways need SLAUDE_MODEL
No DM reply but /healthz okCheck SOUL.md ## ReportingManager is your Slack user ID (U...), not your handle

Next Steps#

TopicWhat you will learn
Installation & ConfigurationFull env reference, ANTHROPIC_BASE_URL gateways, model selection, Docker vs Kubernetes
ArchitectureSession lifecycle, gateway ↔ agent ↔ MCP flow, sqlite + PVC layout
SOUL & PersonaPersona schema, approvers, channel trust tiers, redaction
Engagement & ApprovalsMention model, @mention to engage/disengage, Block Kit approval gate
Skills & Knowledgeslaude.json / slaude.lock, installing skills and KB wikis, sync_manifest
Deployment & OperationsKubernetes single-replica deploy, health probes, Prometheus metrics, log tailing
Webhook (Events API) modeSlack ingress over HTTP instead of Socket Mode
Control panelOperator web console — fleet view, session control, take control from Slack
ExamplesRunnable end-to-end: first skill, first KB ingest, custom MCP server

Next: If you just finished quickstart, go to Installation & Configuration for the complete environment reference, then SOUL & Persona to make the agent yours.