Build a Slack Bot Powered by Claude: Complete Setup Guide

Claudeautomationintermediate~30 minVerified Jul 19, 2026

Prerequisites

  • Claude subscription (Pro, Max, Team, or Enterprise) or Anthropic Console account
  • Slack workspace with app installation permissions
  • Terminal or command prompt
  • Git installed (Git for Windows recommended on native Windows)
  • Code project directory

You will build a Slack bot that uses Claude Code to triage bug reports, answer questions, and automate development tasks directly from your team chat. The setup takes about 30 minutes and requires a Claude subscription, a Slack workspace, and basic familiarity with the terminal.

Prerequisites

  • A Claude subscription (Pro, Max, Team, or Enterprise) or an Anthropic Console account with pre-paid credits
  • A Slack workspace where you have permission to install apps
  • A terminal or command prompt open on your machine
  • Git installed (Git for Windows recommended on native Windows)
  • A code project directory to work with

Step 1: Install Claude Code

Claude Code is the agentic coding tool that powers the Slack integration. You need it installed on your local machine or in your CI/CD pipeline. The recommended method is the native installer, which auto-updates in the background.

macOS, Linux, or WSL

Open your terminal and run:

curl -fsSL https://claude.ai/install.sh | bash

This downloads and runs the official install script. After completion, verify the installation:

claude --version

You should see output like 0.1.0 (Claude Code). The exact version number will differ based on when you install.

Windows (PowerShell)

If you are using PowerShell (your prompt shows PS C:\), run:

irm https://claude.ai/install.ps1 | iex

If you see 'irm' is not recognized as an internal or external command, you are in CMD, not PowerShell. Switch to PowerShell or use the CMD method below.

Windows (CMD)

If you are using Command Prompt (your prompt shows C:\ without PS), run:

curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd

If you see The token '&&' is not a valid statement separator, you are in PowerShell, not CMD. Switch to CMD or use the PowerShell method above.

Alternative Package Managers

Homebrew (macOS/Linux):

brew install --cask claude-code

Homebrew offers two casks. claude-code tracks the stable release channel, typically about a week behind and skipping releases with major regressions. claude-code@latest tracks the latest channel and receives new versions as soon as they ship. Homebrew installations do not auto-update. Run brew upgrade claude-code or brew upgrade claude-code@latest periodically.

WinGet (Windows):

winget install Anthropic.ClaudeCode

WinGet installations do not auto-update. Run winget upgrade Anthropic.ClaudeCode periodically.

Linux Package Managers:

You can also install with apt, dnf, or apk on Debian, Fedora, RHEL, and Alpine. See the official documentation for repository setup.

Windows-Specific Notes

Git for Windows is recommended on native Windows so Claude Code can use the Bash tool. If Git for Windows is not installed, Claude Code uses PowerShell as the shell tool instead. WSL setups do not need Git for Windows.

Step 2: Log In to Your Account

Claude Code requires an authenticated account. Start an interactive session to trigger the login flow:

claude

On first use, you will be prompted to log in. Follow the prompts to complete authentication in your browser. You can log in using any of these account types:

  • Claude Pro, Max, Team, or Enterprise (recommended)
  • Claude Console (API access with pre-paid credits). On first login, a "Claude Code" workspace is automatically created in the Console for centralized cost tracking.
  • Amazon Bedrock, Google Cloud's Agent Platform, or Microsoft Foundry (enterprise cloud providers)
  • A self-hosted Claude apps gateway, if your organization runs one: your admin pre-configures the gateway URL, and /login opens directly on the Cloud gateway screen for you to sign in with corporate SSO

Once logged in, your credentials are stored locally and you will not need to log in again on that machine. To switch accounts later or re-authenticate, type /login inside the running session:

/login

Step 3: Start Your First Claude Code Session

Navigate to a project directory and start Claude Code:

cd /path/to/your/project
claude

Replace /path/to/your/project with the actual path to a code project on your machine. You will see the Claude Code prompt with the version, current model, and working directory displayed above it. Type /help for available commands or /resume to continue a previous conversation.

Step 4: Understand How the Slack Integration Works

Claude Code integrates with Slack through the Model Context Protocol (MCP) and a dedicated Slack app. According to the official documentation, you can "route tasks from team chat: mention @Claude in Slack with a bug report and get a pull request back." This means the bot listens for mentions in Slack channels, processes the request using Claude Code, and returns results such as code changes, pull requests, or answers.

The Slack integration is one of several surfaces Claude Code supports. Others include GitHub Actions, GitLab CI/CD, Chrome, Telegram, Discord, and iMessage. Each surface connects to the same underlying Claude Code engine, so your CLAUDE.md files, settings, and MCP servers work across all of them.

Step 5: Set Up the Slack App

To create the Slack bot, you need to install the official Claude Code Slack app. The documentation states that you can "route bug reports from Slack to pull requests" via Slack. The exact steps to install the app are:

  1. Go to the Claude Code Slack app installation page (the URL is provided in the Claude Code documentation or your Anthropic Console).
  2. Click "Add to Slack" and authorize the app for your workspace.
  3. Grant the required permissions: the app needs to read messages where it is mentioned and post messages to channels.
  4. Once installed, the app appears in your Slack workspace as @Claude.

If you do not see the installation link, check the "Slack" section in the Claude Code documentation or contact your Anthropic account manager. The app is part of the Claude Code product and requires an active subscription.

Step 6: Configure MCP for Slack (Optional but Recommended)

The Model Context Protocol (MCP) is an open standard for connecting AI tools to external data sources. With MCP, Claude Code can read your design docs in Google Drive, update tickets in Jira, pull data from Slack, or use your own custom tooling.

To connect Claude Code to Slack via MCP, you need to set up an MCP server that provides Slack tools. The MCP quickstart in the documentation connects your first server end to end. The general steps are:

  1. Create an MCP server configuration file (typically mcp.json or mcp.yaml in your project root).
  2. Define a server that connects to the Slack API using a bot token.
  3. Restart Claude Code to load the new MCP server.

For example, a minimal MCP configuration might look like:

{
  "mcpServers": {
    "slack": {
      "command": "node",
      "args": ["path/to/your-slack-mcp-server.js"],
      "env": {
        "SLACK_BOT_TOKEN": "xoxb-your-token-here",
        "SLACK_SIGNING_SECRET": "your-signing-secret"
      }
    }
  }
}

You need to create the MCP server script yourself or use a community-maintained one. The documentation provides the MCP quickstart for guidance.

Step 7: Test the Slack Bot

Once the Slack app is installed and configured, test it by mentioning @Claude in a channel where the app is present. Try these examples:

  • @Claude what is the status of the main branch?
  • @Claude fix the login bug where users see a blank screen after entering wrong credentials
  • @Claude write tests for the auth module, run them, and fix any failures

Claude Code will process the request and respond in the Slack thread. For code changes, it may create a pull request and post the link. For questions, it will provide an answer based on your codebase.

Step 8: Automate with GitHub Actions or GitLab CI/CD

For more advanced automation, you can integrate Claude Code with your CI/CD pipeline. The documentation shows that "in CI, you can automate code review and issue triage with GitHub Actions or GitLab CI/CD." This allows the Slack bot to trigger automated workflows.

For example, a GitHub Actions workflow that runs Claude Code on every pull request:

name: Claude Code Review
on:
  pull_request:
    types: [opened, synchronize]

jobs:
  review:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Install Claude Code
        run: curl -fsSL https://claude.ai/install.sh | bash
      - name: Run code review
        run: claude -p "review the changes in this PR for security issues and suggest improvements"

This workflow checks out the code, installs Claude Code, and runs a one-off review command. The results can be posted back to Slack using Slack webhooks or the Slack API.

Verifying It Works

To confirm the end-to-end setup is functional:

  1. Check Claude Code installation: Run claude --version in your terminal. You should see a version number followed by (Claude Code).
  2. Check authentication: Run claude and verify you are logged in. Type /login if needed.
  3. Test the Slack app: In a Slack channel, mention @Claude with a simple request like "what is the current time?" (if your MCP server provides that) or "list the files in my project." You should see a response within a few seconds.
  4. Test a code change request: Mention @Claude with "add a hello world function to the main file." The bot should create a pull request with the change.
  5. Check CI integration: Push a pull request to your repository and verify that the GitHub Actions workflow runs and posts results to Slack.

Common Problems

Installation fails with "syntax error near unexpected token"

Cause: You are running the wrong shell. The native install script is for Bash (macOS, Linux, WSL). On Windows, use PowerShell or CMD as appropriate.

Fix: Match the install command to your shell. Use the PowerShell command if your prompt shows PS C:\, or the CMD command if it shows C:\.

"The token '&&' is not a valid statement separator"

Cause: You are in PowerShell but using the CMD command.

Fix: Switch to the PowerShell command: irm https://claude.ai/install.ps1 | iex.

"'irm' is not recognized as an internal or external command"

Cause: You are in CMD but trying to use a PowerShell command.

Fix: Switch to the CMD command: curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd.

Claude Code does not respond in Slack

Cause: The Slack app may not be properly installed or the MCP server is not running.

Fix: Verify the Slack app is added to your workspace and the channel. Check that the MCP server configuration is correct and that Claude Code is running. Restart Claude Code after changing MCP configuration.

Authentication fails

Cause: Your session may have expired or you are using an unsupported account type.

Fix: Type /login inside the Claude Code session to re-authenticate. Ensure you have a valid Claude subscription or Console account.

Git operations fail on Windows

Cause: Git for Windows is not installed, so Claude Code defaults to PowerShell as the shell tool, which may not support all git operations.

Fix: Install Git for Windows from https://git-scm.com/download/win. WSL users do not need this.

Next Steps

  1. Customize with CLAUDE.md: Add a CLAUDE.md file to your project root to set coding standards, architecture decisions, and review checklists. Claude Code reads this at the start of every session.
  2. Create skills: Package repeatable workflows your team can share, like /review-pr or /deploy-staging. Skills make common tasks one command away.
  3. Set up scheduled tasks: Use Routines (Anthropic-managed infrastructure) or Desktop scheduled tasks to run Claude on a recurring schedule for morning PR reviews, overnight CI failure analysis, or weekly dependency audits.
  4. Build custom agents with the Agent SDK: For fully custom workflows, the Agent SDK lets you build your own agents powered by Claude Code's tools and capabilities, with full control over orchestration, tool access, and permissions.
Was this helpful?
Newsletter

The #1 Claude Newsletter

The most important claude updates, guides, and fixes — one weekly email.

No spam, unsubscribe anytime. Privacy policy

Sources & References

This page was researched from 2 independent sources, combined and verified for completeness.

Related Tutorials

Keep exploring Claude

Skip the manual work

Ready-made AI workflows and automation templates — import and run instead of building from scratch.

Explore workflows