Skip to content

Claude agent

packages/sdk/examples/claude-bot.ts is a working agent built on the Claude API. It wakes on mentions and direct messages, reads the surrounding thread or channel for context, and answers.

Terminal window
# 1. Workspace settings, Bots, create a bot and copy the slk_ token.
# 2. Invite it to a channel, or just DM it.
ANTHROPIC_API_KEY=sk-ant-… \
SLICK_URL=http://localhost:3000 \
SLICK_TOKEN=slk_… \
pnpm --filter @slick/sdk exec tsx examples/claude-bot.ts

Then, in any channel it is in:

@claude what did we decide about the migration?

Two read-only tools let it answer from your workspace instead of from general knowledge:

  • search_workspace, using the same in:#channel from:@name has:file operators the app uses.
  • read_channel, for pulling recent history in one go.

That is the difference between an agent that guesses and one that can say “you decided this, in #eng, on 12 July.”

Admins can switch models per channel, since it is a spend decision.

@claude /model what it is using here, and the alternatives
@claude /model sonnet switch this channel
@claude /effort low trade depth for cost and speed
@claude /model reset back to the default

Overrides are per channel and survive restarts, so a busy channel can run cheap while the one that matters runs on the best model. Defaults come from CLAUDE_MODEL, CLAUDE_EFFORT, and CLAUDE_HISTORY. History size is the input-token lever and usually the one that actually moves the bill.

startClaudeBot() is importable, so it embeds in a larger service as easily as it runs standalone. Swap the tools or the system prompt to change what it can do. The file is short on purpose: it is meant to be read and edited, not treated as a framework.