← All Lessons
Lesson 08

Your Own Chloe

Build a personal AI assistant that lives in Slack, knows your context, and works while you're away.

OpenClaw proved something: people want an AI that lives where they already work. Not in a separate app. Not in a browser tab. In Slack, in WhatsApp, in the tools they already have open. The trick isn't building an AI. It's wiring it into the place you already look.


What you're building today

A Slack bot powered by Claude that has access to your strategy folder, your brain, your CLAUDE.md. It can answer questions about your projects, search your files, draft messages, and run tasks. All from a Slack DM.


Step 1: The architecture

The whole system is simpler than it sounds:

You (in Slack)
    ↓  message
Slack Bot (Node.js, always running)
    ↓  reads your message
Claude API (with your CLAUDE.md as system prompt)
    ↓  generates response
Slack Bot
    ↓  posts reply
You (in Slack)

That's it. A small Node.js process that listens for Slack messages, sends them to Claude with your context, and posts the response back. The bot knows who you are because it reads your CLAUDE.md.


Step 2: Create the Slack app

  1. Go to api.slack.com/apps and click "Create New App"
  2. Choose "From scratch," name it whatever you want
  3. Under "OAuth & Permissions," add these scopes:
    • chat:write (post messages)
    • im:history (read DMs)
    • im:read (access DM channels)
    • app_mentions:read (respond to @mentions)
  4. Install to your workspace
  5. Copy the Bot Token (starts with xoxb-)
  6. Under "Socket Mode," enable it and generate an App-Level Token (starts with xapp-)

Step 3: Build the bot

Create a project folder:

mkdir -p ~/strategy/projects/my-slack-bot
cd ~/strategy/projects/my-slack-bot
npm init -y
npm install @slack/bolt @anthropic-ai/sdk

Create the bot file:

// bot.js
const { App } = require('@slack/bolt');
const Anthropic = require('@anthropic-ai/sdk');
const fs = require('fs');
const path = require('path');

// Load your CLAUDE.md as the system prompt
const claudeMd = fs.readFileSync(
  path.join(process.env.HOME, 'strategy', 'CLAUDE.md'), 'utf-8'
);

const app = new App({
  token: process.env.SLACK_BOT_TOKEN,
  appToken: process.env.SLACK_APP_TOKEN,
  socketMode: true,
});

const anthropic = new Anthropic();

// Respond to DMs
app.message(async ({ message, say }) => {
  if (message.subtype) return; // skip edits, joins, etc.

  const response = await anthropic.messages.create({
    model: 'claude-sonnet-4-6',
    max_tokens: 1024,
    system: `You are a personal assistant. Here is context about who you're helping:\n\n${claudeMd}`,
    messages: [{ role: 'user', content: message.text }],
  });

  await say(response.content[0].text);
});

(async () => {
  await app.start();
  console.log('Bot is running');
})();

Step 4: Set up environment

export SLACK_BOT_TOKEN="xoxb-your-token-here"
export SLACK_APP_TOKEN="xapp-your-token-here"
export ANTHROPIC_API_KEY="sk-ant-your-key-here"

Step 5: Run it

node bot.js

Open Slack. DM your bot. Ask it anything. It knows who you are because it read your CLAUDE.md.

This is the base version. From here you can add: file search (let the bot grep your strategy folder when you ask "where did I write about X?"), conversation memory (store message history so the bot remembers your last 10 exchanges), slash commands (/summarize, /draft), scheduled check-ins, and multiple channels.


The OpenClaw lesson

OpenClaw is the fastest-growing open-source AI project ever (240K stars). What made it work:

  1. One WebSocket, many channels. All messaging platforms connect the same way. Adding WhatsApp or Discord is just a new plugin.
  2. The AI is constant. The channel is just a window. Your assistant doesn't change based on where you message it.
  3. Session serialization. One conversation at a time per thread. No race conditions, no confused context.

You don't need to build OpenClaw. But understanding why it took off tells you what people actually want: an AI that lives where they already are.


Where to run it

For personal use, run it on your Mac (node bot.js in a terminal tab). For always-on, deploy to a server:

# On your server (Hetzner, DigitalOcean, etc.)
git clone your-repo
npm install
# Use pm2 to keep it running
npm install -g pm2
pm2 start bot.js --name "slack-bot"
pm2 save

What you built

Homework

Get the base bot running. DM it three questions about your work. Notice how much better the answers are when your CLAUDE.md is the system prompt vs generic Claude. That's the compounding effect, now available from your phone.