This is the practical guide. If you’ve read the why and the what’s possible, this is how to actually build it.
I’m going to walk you through every click. If you’ve never opened a terminal, never made a Slack app, and don’t know what an API key is — that’s fine. Read each step, do the thing it asks, then come back. The instructions assume nothing.
Set aside about 90 minutes the first time. Most of that is reading and pasting, not typing. There is no programming required — we’re using AI tools that handle the code for us.
What you’re going to build, in plain language
Three pieces:
- A Slack app — a little robot account that lives in your Slack workspace. It can read messages in channels you invite it to, and post replies.
- An AI engine (Claude) — the brain. We’ll use a free tool called Claude Code that runs on your own computer.
- A “bridge” — a small program that listens to your Slack and hands each message over to the AI brain, then posts the answer back. We’ll have Claude write this for us.
When it’s done, you can type a message in Slack, the AI reads it, thinks, and writes back. If it’s about to do anything risky — sending an email, publishing a post — it pauses and asks you with an Approve / Decline button.
Before you start: a checklist
- A Mac or Windows computer that you can leave on most of the day. (Your laptop is fine.)
- A Slack workspace where you’re an owner or admin. If you’re not sure, open Slack → click your workspace name top-left → Settings & administration. If you can see that menu, you’re good. If not, ask whoever runs your Slack to add you as an admin or to follow these steps for you.
- About 90 minutes.
- A credit card — not for this guide, but you’ll need one to set up an Anthropic account in Step 4. The first month’s usage is typically a few dollars at most.
That’s the whole list. No coding background required.
A note on the Terminal (don’t skip this)
You’re going to use something called the “Terminal” in a couple of steps. It’s an app already installed on your computer. It looks scary but it’s not.
- On Mac: press
Cmd + Space, type Terminal, hit Return. A window with text on a dark background opens. - On Windows: press the Windows key, type PowerShell, click Windows PowerShell. Same idea: a window with text on a dark background.
That window is the Terminal. When this guide says “paste this command,” it means: click in that window, paste the line, and press Return. That’s it. You’re not writing code — you’re telling your computer to install something.
Step 1 — Create your Slack app
This is the “robot account” that will live in Slack. You’re not installing software; you’re just creating an identity in Slack’s system that the AI will use to read and post messages.
- Open api.slack.com/apps in your browser. (This is Slack’s official developer page. Don’t be put off by the name — you don’t need to be a developer to use it.)
- If asked, sign in with the same email/password you use for Slack.
- Click the green Create New App button (top-right of the page).
- A pop-up asks how to create the app. Click From scratch.
- It asks for an App Name — type something like Claude Apprentice. This is what shows up in your Slack as the bot’s display name; you can change it later.
- Pick your workspace from the dropdown.
- Click Create App.
You’re now on your new app’s settings page. Keep this browser tab open — we’ll come back to it many times. Slack has its own official quickstart if you ever want a second reference.
Step 2 — Give your app permission to do things
By default, your new app can do nothing. We need to grant it specific abilities — called “scopes” in Slack’s language. Think of scopes as permission checkboxes: “allow this app to read messages”, “allow this app to post replies”, etc.
- In the left sidebar of your app’s settings page, click OAuth & Permissions.
- Scroll down to a section called Bot Token Scopes. (There are two scope sections — Bot Token and User Token. We only want Bot Token.)
- Click Add an OAuth Scope. Type the scope name and click it from the dropdown. Add these one at a time:
chat:write— lets the bot post messageschannels:history— lets the bot read messages in public channelsgroups:history— same, but for private channelsapp_mentions:read— lets the bot see when you @-mention itreactions:read— lets the bot see emoji reactions on messages (this is what powers reactions-as-commands later)
That’s your full scope list for now. You can always come back and add more later.
Step 3 — Install the app and grab two passwords
Now we’ll actually drop the bot into your Slack and collect the two secret keys it needs. Slack calls these “tokens”. Tokens are just very long passwords that the AI will use to prove it’s allowed to act on your behalf.
3a. Install the bot into your workspace
- Still on the OAuth & Permissions page, scroll back to the top.
- Click the green Install to Workspace button.
- Slack shows a permissions screen listing what you just added. Click Allow.
- You’re bounced back to the OAuth page, and a new field has appeared at the top: Bot User OAuth Token. It starts with
xoxb-and is very long. - Click Copy next to it. Open a plain text file (TextEdit on Mac, Notepad on Windows) and paste it in. Label it “Bot Token”. We’ll need it shortly.
3b. Generate the second token
- In the left sidebar, click Basic Information.
- Scroll down to App-Level Tokens.
- Click Generate Token and Scopes.
- Give it a name (e.g. connection-token) and click Add Scope. Add
connections:write. - Click Generate. A new token appears, starting with
xapp-. - Copy this one too into your text file. Label it “App Token.”
You now have both tokens. Why two? The bot token is the bot’s identity (“I’m allowed to post in your Slack”). The app token is permission to open a live connection (“I’m allowed to listen for new messages in real time”). Slack uses two for security — if one ever leaks, you can rotate just that one.
Step 4 — Turn on Socket Mode
This is one toggle. It’s the trick that lets the whole thing run from your laptop without needing a public website.
Without Socket Mode, Slack would need a public URL it could send your messages to — meaning you’d have to host the bridge somewhere with a domain name (extra setup, extra cost). With Socket Mode, the direction is reversed: your laptop opens a connection to Slack, and Slack streams messages down through that connection. No public URL required.
- In the left sidebar, click Socket Mode.
- Toggle Enable Socket Mode to On.
Done. That’s the entire step.
Step 5 — Tell Slack which events to forward
Right now your bot has permission but isn’t hearing anything. We need to tell Slack: “when X happens, send my bot a notification.”
- In the left sidebar, click Event Subscriptions.
- Toggle Enable Events to On.
- Open the Subscribe to bot events section (click it to expand).
- Click Add Bot User Event and add each of these one at a time:
message.channels— new messages in public channelsmessage.groups— new messages in private channelsapp_mention— when someone @-mentions the botreaction_added— emoji reactions
- Scroll to the bottom and click Save Changes.
Slack might ask you to Reinstall your app — if you see a yellow banner saying so, click it and then Allow on the permissions screen. This is normal whenever you change scopes or events.
Invite the bot to a test channel
- Open Slack itself.
- Make a new channel (call it #claude-test) or pick one you already have.
- In the message box, type
/invite @Claude Apprentice(use whatever name you gave the bot). Press Return. - The bot appears in the channel’s member list.
Step 6 — Set up your AI brain (Claude Code + an API key)
Time to install the AI side. We’ll use Claude Code, Anthropic’s agentic AI tool. It runs on your own computer, reads files, runs commands, and can be wired up to talk to Slack.
6a. Get an Anthropic API key
- Go to platform.claude.com and sign up (or log in if you already have a Claude account).
- You’ll be asked to add billing — this is a pay-as-you-go service. Add a card. Set a low monthly spending cap to start ($10 is plenty while you’re experimenting).
- From the left sidebar, click API Keys.
- Click Create Key. Name it (e.g. slack-bridge) and copy the long string that appears. It starts with
sk-ant-. - Add this to your text file from Step 3 with the label “Anthropic API Key.”
You now have three secrets: Bot Token, App Token, Anthropic API Key. Don’t share these with anyone.
6b. Install Claude Code on your computer
Open the Terminal (see the note above if you forgot how). Paste this exact line and press Return:
curl -fsSL https://claude.ai/install.sh | bash
(On Windows PowerShell, use this instead:)
irm https://claude.ai/install.ps1 | iex
The Terminal will print messages for a minute or two. When it’s done, type claude and press Return. The first time, it will ask you to log in — follow the prompts. Once you see the Claude Code chat prompt, you’re in.
Type exit and press Return to leave Claude Code for now.
Step 7 — Have Claude write the bridge for you
This is where it gets fun. The bridge is a small program that connects Slack to Claude. You’re not going to write it. You’re going to ask Claude Code to write it for you.
- In your Terminal, make a new folder for this project. Paste:
This creates a folder called slack-bridge in your home directory and moves into it.mkdir ~/slack-bridge && cd ~/slack-bridge - Start Claude Code in that folder by typing:
claude - Once Claude Code is running, type or paste this whole prompt:
Build me a Python program that connects to Slack using Socket Mode and forwards every message in channels I’m invited to into the Claude Agent SDK. The agent’s reply should be posted back into the same Slack thread. Use environment variables for SLACK_BOT_TOKEN, SLACK_APP_TOKEN, and ANTHROPIC_API_KEY. Add a PreToolUse hook that, before any Write, Edit, or Bash tool call, posts a Slack message to me with an Approve / Decline button and waits for my response before continuing. Make the code well-commented so a beginner can read it.
- Hit Return and let Claude Code work. It will create files, ask for confirmation along the way, and end up with a working bridge program. This may take a few minutes — that’s normal.
Under the hood, Claude is using the Claude Agent SDK — the official Python (or TypeScript) library that wraps the same agent loop powering Claude Code. The hooks mechanism is what makes the approval gate possible — it’s small bits of logic that run before each tool call.
When Claude Code says it’s done, you’ll see a file called something like bridge.py in your folder. Don’t worry about reading it — just trust that it’s there.
Step 8 — Plug in your three secrets and start it up
Almost there. We need to give the bridge access to your three tokens.
- Still in your Terminal (exit Claude Code with
exitif needed), paste these three lines, replacing the...with the values from your text file:
(On Windows, useexport SLACK_BOT_TOKEN=xoxb-... export SLACK_APP_TOKEN=xapp-... export ANTHROPIC_API_KEY=sk-ant-...$env:SLACK_BOT_TOKEN="xoxb-..."instead ofexport.) - Now run the bridge by pasting:
python3 bridge.py - The Terminal should print something like “Connected to Slack”. Leave that window open.
- Open Slack, go to your #claude-test channel, and type a message: “Hello, are you there?”.
- Within a few seconds, the bot should reply.
If you see a reply — congratulations. You have an AI apprentice in your Slack.
When something doesn’t work
- Bot doesn’t reply. Check your Terminal window for red error text. Most often: a token is missing or wrong. Re-copy from your text file. Make sure the bot is invited to the channel (
/invite @your-bot). - “Module not found” errors. Claude Code may need to install a Python library. Paste the exact error back into Claude Code with “please fix this” and let it handle it.
- Bot replies but doesn’t pause for approval. The hook didn’t wire up. Tell Claude Code: “the PreToolUse hook isn’t firing — please fix it and verify it triggers a Slack message before any Write or Bash tool call.”
- You changed scopes and nothing works. You probably need to reinstall the app. Go back to OAuth & Permissions in the Slack app settings, click Reinstall to Workspace, click Allow.
The fastest fix in any of these cases is: copy the error message, paste it back into Claude Code, and ask “why is this happening?”. The whole point of having an AI apprentice is that it can also debug itself.
Step 9 — Connect external tools (optional, but worth it)
Want the apprentice to read your Google Drive, look up your calendar, search your Notion? That’s done through the Model Context Protocol (MCP). MCP is an open standard for plugging external systems into an AI — there are hundreds of community-built connectors already.
The simplest way to add one: ask Claude Code in your bridge folder. For example: “add the Google Drive MCP server to my bridge so I can ask the bot to look up files.” It will install the server, add the right config line, and restart the bridge for you.
Step 10 — Keep it running
Right now, the bridge only runs while your Terminal window is open. To make it stay alive across restarts:
- Ask Claude Code: “turn this bridge into a background service that auto-restarts on crash and starts when my computer boots.” On Mac it’ll write a LaunchAgent file. On Linux, a systemd service. On Windows, a Task Scheduler entry.
- For peace of mind, ask Claude Code to add a watchdog: “add a script that pings the bridge every five minutes and notifies me on my phone via ntfy.sh if it’s down.” ntfy.sh is a free push-notification service that takes 60 seconds to set up.
What to build next
Once the basic loop is alive (message in → agent step → approval gate → reply out), every higher capability — brain-dump triage, scheduled briefings, recursive learning — is a layer on top of that same shape.
The official Agent SDK demo repo has worked examples of email assistants, research agents, and routing agents you can study. The Slack quickstart has a fully working bot template in both Python and JavaScript.
Take it slow. Get the boring loop working first. Add the approval gate. Add one MCP. Add a second channel with a different brief. Each layer is small. The compounding is what matters.
The why: Turning Slack Into Your AI Command Center. The shape of what’s possible: What I Built Into Claude Inside My Slack.
Get Smarter About AI Every Morning
Free daily newsletter — one story, one tool, one tip. Plain English, no jargon.
Free forever. Unsubscribe anytime.
Want a head start? Book a 2-hour live AI crash course
A private, beginner-friendly session across Claude, ChatGPT, Gemini, Grok, and the wider landscape. Walk away knowing which tools fit your work and how to use them.
Book the 2-hour crash course · $125 →