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.
Running it
Section titled “Running it”# 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.tsThen, in any channel it is in:
@claude what did we decide about the migration?What makes it useful
Section titled “What makes it useful”Two read-only tools let it answer from your workspace instead of from general knowledge:
search_workspace, using the samein:#channel from:@name has:fileoperators 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.”
Controlling cost from chat
Section titled “Controlling cost from chat”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 defaultOverrides 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.
Making it yours
Section titled “Making it yours”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.