💬Lesson 25

Claude Code in Slack

Delegate coding tasks without leaving Slack. Mention @Claude in any channel, and Claude automatically opens a full Claude Code session on the web — then posts progress updates and action buttons back in your thread.

@Claude in any channelFull Claude Code sessionProgress in Slack threadOne-click PR creation

What is Claude Code in Slack?

Claude Code in Slack is an extension of the Claude for Slack app that adds intelligent routing for coding tasks. When Claude detects that your message is a development request, it automatically creates a Claude Code session on claude.ai/code rather than answering as a regular chat assistant.

The full session runs in the background. You get progress updates in your Slack thread and, when done, action buttons to View Session, Create PR, or Change Repo.

Example — fixing a bug from Slack

A developer reports a 500 error in the #engineering channel. Claude investigates, fixes the bug, and posts a summary — all without anyone leaving Slack.

#engineeringClaude · 4 members
JD
james.d10:14 AM
@Claude our checkout API is returning 500 errors for orders over $500. Logs show a ValidationError in order.service.ts. Can you investigate and fix it?
🤖
ClaudeAPP10:14 AM
🔄 Starting Claude Code session on acme/api-service
I'll investigate the ValidationError in order.service.ts…
Reading order.service.ts and related validators
Found issue: price field capped at 499.99 in validation schema
Fixing validation schema — removing incorrect upper limit
Writing unit test for orders above $500
🤖
ClaudeAPP10:17 AM
✅ Done — @james.d
Fixed the issue. The order amount validator had a hardcoded maximum of 499.99 in schemas/order.schema.ts. Removed the cap and added a test for orders over $500.

Prerequisites

RequirementDetails
Claude PlanPro, Max, Team, or Enterprise with Claude Code access
Claude Code on the webMust be enabled for your account at claude.ai/code
GitHub accountConnected to Claude Code on the web with at least one repository
Slack authenticationYour Slack account linked to your Claude account via the Claude app

Setup

1
Install the Claude app in Slack

A workspace administrator visits the Slack App Marketplace and clicks Add to Slack. Only admins can install apps for the whole workspace.

2
Connect your Claude account

Open the Claude app in Slack (find it under Apps), go to the App Home tab, click Connect, and complete the browser authentication flow. Each team member does this individually — sessions always run under the user's own account.

3
Configure Claude Code on the web

Visit claude.ai/code with the same account. Connect your GitHub account and authenticate at least one repository. Claude uses these connections when running sessions triggered from Slack.

4
Choose a routing mode

In the Claude App Home in Slack, select how you want messages handled:

Code only
All @Claude mentions start a Claude Code session. Best for teams using Claude purely for development.
Code + Chat
Claude analyses each message and routes to Code or Chat based on intent. Best for mixed dev and general Q&A.
5
Invite Claude to your channels

Claude is not added to channels automatically. In each channel where you want to use it, type /invite @Claude. Claude only responds to mentions in channels it has been invited to — works in both public and private channels.

How a session flows

💬
You mention @Claude
Type your request in any channel or thread where Claude has been invited.
🧠
Claude detects intent
Claude analyses your message. Coding tasks go to a Claude Code session; general questions go to Claude Chat (in Code + Chat mode).
🚀
Session created
A new Claude Code session opens on claude.ai/code using your connected GitHub repositories.
🔄
Progress updates posted
Claude posts status updates to your Slack thread as it reads files, makes changes, and runs checks.
Completion summary
Claude @mentions you with a summary and action buttons: View Session, Create PR, and Change Repo.
👀
You review and merge
Click View Session to see the full transcript, or Create PR to open a pull request directly from the session.

What you can ask Claude to do

🐛
Investigate a bug
@Claude the login endpoint is throwing 401 for valid tokens — can you find and fix the issue?
Implement a feature
@Claude add pagination to the /api/products endpoint, 20 items per page
♻️
Refactor code
@Claude the UserService class is too large — split it into separate auth and profile services
🧪
Write tests
@Claude add tests for the checkout flow — we need coverage for edge cases
📖
Update docs
@Claude update the README with setup instructions for the new Docker environment
🔍
Review a change
@Claude review the changes in PR #88 for security issues before we merge

Writing effective requests

Claude gathers context from the thread you're in. A few habits make sessions more accurate:

📌
Be specific
Include file names, function names, or error messages. The more precise, the faster Claude finds the right code.
🧵
Use threads
Reply in an existing bug or feature thread so Claude picks up all the context already discussed.
🎯
Define done
Say what success looks like — should Claude write tests? Update docs? Create a PR?
📁
Name the repo
If your workspace has multiple repos, mention the repo name so Claude selects the right one.
⚠️ Warning: Claude reads all messages in the thread for context. Only use Claude in trusted channels — it may follow instructions from other messages in the conversation.

Current limitations

🐙
GitHub only
Only GitHub repositories are supported. GitLab and Bitbucket are not yet available.
🚫
No DMs
Claude only responds in channels (public or private). Direct messages are not supported.
🔀
One PR per session
Each session can create one pull request. For multiple PRs, start separate sessions.
📊
Your plan limits apply
Sessions count against your individual plan's rate limits, not a shared workspace pool.

Troubleshooting

Sessions not starting after @Claude mention
Open the Claude App Home in Slack and verify your account is connected. Check that Claude Code on the web is enabled at claude.ai/code and that you have at least one GitHub repository connected.
Claude responds with Chat instead of a Code session
In Code + Chat mode, Claude uses intent detection. If it picks Chat incorrectly, click Retry as Code in the message to start a Code session instead. Or switch to Code only mode in the App Home.
Wrong repository selected
Click the Change Repo button in Claude's response to pick the correct repository. For future requests, mention the repository name explicitly in your message.
Authentication errors
Disconnect and reconnect your Claude account in the App Home. Make sure you are signed into the correct Claude account in your browser and that your plan includes Claude Code access.

Quick Reference

TaskHow
Install the Claude appSlack App Marketplace → Add to Slack
Connect your accountClaude App Home → App Home tab → Connect
Configure web accessclaude.ai/code
Add Claude to a channel/invite @Claude in the channel
Trigger a coding session@Claude <your request> in any invited channel
Force a Code sessionClick Retry as Code if Claude responded in Chat mode
Change the repositoryClick Change Repo in Claude's response message
Open the full sessionClick View Session in Claude's response message
Create a pull requestClick Create PR in Claude's completion message
View past sessionsclaude.ai/code

What's Next

Claude is live in Slack. The next lesson tours the Claude Desktop app — the home of both Chat and Cowork modes.