💬Claude Code in Slack
Route bug reports from Slack to pull requests
Claude Code in Slack
Slack is where your team communicates, triages bugs, discusses features, and shares context. Claude Code's Slack integration brings AI-powered development assistance directly into your workspace — turning conversations into action. Instead of copying error logs from Slack into your terminal, you can mention Claude in a channel and have it investigate, fix, and open a pull request without leaving the chat.
Why Integrate Claude Code with Slack?
Development teams spend significant time in Slack. Bug reports arrive in #bugs, feature requests appear in #product, and production alerts flood #incidents. Without integration, someone must manually read each message, context-switch to their IDE, investigate, write a fix, and push a PR. Claude Code in Slack automates this pipeline:
- Instant triage — Claude reads bug reports and immediately classifies severity, identifies the affected component, and suggests a fix
- Bug-to-PR pipeline — A single
@Claude fix thismessage can trigger investigation, code changes, and a pull request - Channel summarization — Claude can summarize long threads so newcomers get context in seconds
- On-call support — Claude answers questions about the codebase, saving on-call engineers from diving into unfamiliar code
- Knowledge sharing — Claude explains how systems work, reducing bus-factor risk
- Async collaboration — Teams in different time zones get AI-powered help around the clock
How the Slack Integration Works
Claude Code connects to Slack through an official Anthropic Slack app. Once installed, team members can interact with Claude by mentioning it in channels or sending direct messages.
Architecture Overview
┌──────────────┐ ┌──────────────────┐ ┌─────────────────┐
│ Slack │────▶│ Anthropic Slack │────▶│ Claude Code │
│ Workspace │◀────│ App (Bot) │◀────│ Backend │
└──────────────┘ └──────────────────┘ └─────────────────┘
│ │
│ ▼
│ ┌─────────────────┐
└──────────────▶│ GitHub / Git │
│ Repository │
└─────────────────┘
When you mention @Claude in a Slack message:
- Slack sends the message to the Anthropic Slack app via webhook
- The app authenticates and validates the request
- Claude Code processes the message, reading any attached context (thread history, files, error logs)
- Claude performs the requested action (answer a question, investigate a bug, generate code)
- The response is posted back into the Slack thread
- If code changes are needed, Claude can create a branch and open a pull request on GitHub
Setting Up Claude Code in Slack
Step 1: Install the Slack App
Navigate to your organization's Anthropic console and locate the Slack integration settings. An admin with workspace-level permissions must authorize the app.
1. Go to Anthropic Console → Integrations → Slack
2. Click "Add to Slack"
3. Select your Slack workspace
4. Review the requested permissions
5. Click "Allow"
Step 2: Configure Repository Access
After installing the app, connect it to your GitHub repositories so Claude can read code and open pull requests.
1. In the Anthropic Console, go to Slack Integration → Repositories
2. Click "Connect Repository"
3. Authenticate with GitHub
4. Select which repositories Claude can access
5. Set default branch and permissions per repository
Step 3: Invite Claude to Channels
Claude only responds in channels where it has been explicitly invited. This gives you fine-grained control over where AI assistance is available.
/invite @Claude
Invite Claude to channels like #bugs, #engineering, #incidents, or #code-review. Avoid adding Claude to general social channels to prevent unnecessary noise.
Step 4: Set Permissions and Policies
Configure what Claude is allowed to do in each channel:
| Permission | Description | Default |
|---|---|---|
| Read messages | Claude can read channel messages | On |
| Post replies | Claude can reply in threads | On |
| Create branches | Claude can push branches to repos | Off |
| Open PRs | Claude can create pull requests | Off |
| Summarize threads | Claude can provide thread summaries | On |
| Access private channels | Claude can be invited to private channels | Off |
| Direct messages | Users can DM Claude directly | On |
@Claude Mentions — Interacting with Claude
Basic Mentions
Mention Claude in any message to get a response:
@Claude What does the PaymentService.processRefund() method do?
Claude will search the connected repository, find the method, and explain its logic, parameters, return values, and any edge cases.
Contextual Thread Replies
When you mention Claude inside a thread, it reads the entire thread history for context:
User A: "We're seeing 500 errors on /api/checkout after the last deploy"
User B: "Looks like it started at 2:15 PM UTC"
User C: "@Claude can you investigate this? The repo is payments-api"
Claude reads the full thread, searches the repository for recent changes to the checkout endpoint, cross-references deploy timestamps, and provides a targeted analysis.
Slash Commands
Some integrations support slash commands for structured interactions:
/claude summarize — Summarize the current thread
/claude explain <file> — Explain a specific file
/claude review <pr-url> — Review a pull request
/claude fix <issue-url> — Investigate and fix a GitHub issue
The Bug-to-PR Pipeline
This is the most powerful workflow enabled by Claude Code in Slack. It turns a bug report message into a working pull request, often within minutes.
How It Works
Bug report in Slack
│
▼
Claude reads the message + thread context
│
▼
Claude searches the codebase for relevant files
│
▼
Claude identifies the root cause
│
▼
Claude writes a fix and tests
│
▼
Claude creates a branch and opens a PR
│
▼
Claude posts the PR link back in Slack
Example: Bug Report to Pull Request
A user posts in #bugs:
@Claude There's a bug in the user registration flow. When a user
signs up with an email that has uppercase letters, they can't log
in later because the login check is case-sensitive but registration
doesn't normalize the email. Repo: auth-service
Claude responds in the thread:
I found the issue. In src/services/auth.ts, the register()
function stores the email as-is, but login() uses a strict
equality check without normalizing case.
Fix: Normalize the email to lowercase in both register() and
login() functions, and add a migration to normalize existing
emails in the database.
I've opened a PR with the fix:
→ github.com/org/auth-service/pull/347
Changes:
- src/services/auth.ts: Added .toLowerCase() to email handling
- src/migrations/20250420_normalize_emails.ts: Migration for
existing records
- src/services/__tests__/auth.test.ts: Added case-sensitivity
test cases
Configuring the Bug-to-PR Pipeline
You can customize how Claude handles bug reports by setting channel-level configurations:
{
"channel": "#bugs",
"auto_create_pr": true,
"require_approval": true,
"default_repo": "org/main-app",
"base_branch": "develop",
"pr_reviewers": ["@senior-dev", "@team-lead"],
"pr_labels": ["bug", "ai-generated"],
"max_files_changed": 10,
"run_tests_before_pr": true
}| Option | Description |
|---|---|
auto_create_pr | Whether Claude opens PRs automatically or asks first |
require_approval | Require a human to approve before PR is created |
default_repo | Repository to use when not specified in the message |
base_branch | Branch to create PRs against |
pr_reviewers | Default reviewers to assign |
pr_labels | Labels to apply to generated PRs |
max_files_changed | Safety limit on how many files Claude can modify |
run_tests_before_pr | Run the test suite before opening the PR |
Channel Summarization
Long Slack threads can accumulate hundreds of messages. Claude can distill them into concise summaries.
Summarize a Thread
Reply in any thread with:
@Claude summarize this thread
Claude reads all messages in the thread and produces a structured summary:
**Thread Summary** (47 messages, 6 participants)
**Topic:** Production outage on payments service
**Timeline:**
- 14:12 UTC — Alert triggered for high error rate on /api/charge
- 14:15 UTC — @alice confirmed the issue, started investigating
- 14:22 UTC — Root cause identified: expired TLS certificate on
payment gateway connection
- 14:35 UTC — @bob rotated the certificate
- 14:40 UTC — Error rate returned to normal
**Key Decisions:**
- Team will add certificate expiry monitoring (assigned: @carol)
- Post-mortem scheduled for Friday
**Action Items:**
- [ ] Add cert expiry alerting — @carol
- [ ] Write post-mortem document — @alice
- [ ] Update runbook with TLS rotation steps — @bob
Daily Channel Digests
Configure Claude to post a daily summary of activity in a channel:
{
"channel": "#engineering",
"daily_digest": true,
"digest_time": "09:00",
"digest_timezone": "America/New_York",
"include_threads": true,
"min_messages": 5
}This is useful for team leads who want to stay informed without reading every message, and for team members in different time zones.
Use Cases
1. On-Call Support
When an on-call engineer gets paged and needs to investigate unfamiliar code:
@Claude I'm on-call and got paged for high latency on the
search service. Can you explain the search indexing pipeline
and recent changes that might cause slowdowns? Repo: search-api
2. Code Review Assistance
When a PR is shared in Slack for discussion:
@Claude review this PR and flag any potential issues:
https://github.com/org/repo/pull/234
3. New Team Member Onboarding
New engineers can ask Claude about the codebase:
@Claude I'm new to the team. Can you explain the overall
architecture of the billing system? What are the main services
and how do they communicate? Repo: billing-platform
4. Incident Response
During an active incident, Claude can assist with rapid investigation:
@Claude We're seeing OOM kills on the worker pods. The memory
usage spiked after deploy v2.14.3. Can you check what changed
in that version that might cause a memory leak? Repo: worker-service
5. Documentation Generation
Request documentation for a module or API:
@Claude Generate API documentation for the endpoints defined
in src/routes/users.ts — include request/response examples.
Repo: user-service
6. Dependency and Security Audits
Ask Claude to check for known issues:
@Claude Check our package.json for any dependencies with
known security vulnerabilities. Repo: frontend-app
Best Practices
1. Be Specific in Your Requests
Bad:
@Claude fix the bug
Good:
@Claude There's a null pointer exception in UserService.getProfile()
when the user has no avatar set. The error occurs at line 45 of
src/services/user.ts. Repo: user-api
Providing the repository name, file path, error message, and reproduction steps gives Claude the context it needs to produce an accurate fix.
2. Use Threads for Follow-Up
Always reply in the same thread to maintain conversation context. Starting a new message loses the context of the previous discussion.
3. Limit Channel Access
Only invite Claude to channels where it adds value. Adding Claude to every channel creates noise and may lead to unintended interactions.
4. Set Up Approval Gates
For production repositories, always enable require_approval so a human reviews the proposed changes before a PR is created. This prevents unintended modifications.
5. Review All Generated PRs
Never merge AI-generated pull requests without human review. Claude may produce code that is syntactically correct but semantically wrong, misses business logic, or introduces subtle bugs.
6. Use Channel-Specific Configurations
Different channels have different needs. Configure #bugs for auto-PR creation, #questions for read-only Q&A, and #incidents for summarization and investigation.
7. Provide Repository Context
Always specify the repository when working across multiple repos. Claude uses the default_repo setting if none is provided, which may not be the one you intend.
8. Set Token and Cost Limits
Configure maximum token usage per request to control costs:
{
"max_tokens_per_request": 4096,
"max_requests_per_user_per_hour": 20,
"max_pr_creates_per_day": 10
}Permissions and Security
Data Privacy
- Claude processes messages only when explicitly mentioned with
@Claude - Messages are sent to Anthropic's API for processing and are subject to Anthropic's data retention policies
- Private channel messages are only accessible if Claude is explicitly invited
- Direct messages with Claude are private to the user
- Claude does not store conversation history beyond the active session
Repository Access Controls
| Access Level | Capabilities |
|---|---|
| Read-only | Search code, explain files, answer questions |
| Read + Branch | All read capabilities plus creating branches |
| Read + Branch + PR | Full capabilities including opening pull requests |
| Admin | Configure settings, manage permissions |
Audit Logging
All Claude interactions are logged for audit purposes:
- Who triggered the interaction (Slack user ID)
- What was requested (the message text)
- What actions Claude took (files read, branches created, PRs opened)
- When the interaction occurred (timestamp)
- Which repository was accessed
SSO and Authentication
Claude Code's Slack app integrates with your existing SSO provider. Users must be authenticated in both Slack and the Anthropic console to interact with Claude. This prevents unauthorized access.
Limitations
What Claude Cannot Do in Slack
- Deploy code — Claude can create PRs but cannot trigger deployments
- Access external services — Claude cannot connect to databases, cloud consoles, or monitoring dashboards directly from Slack
- Persistent memory — Claude does not remember previous conversations across sessions; each thread starts fresh
- Large file handling — Claude has context limits and may struggle with very large files or monorepos with thousands of files
- Real-time streaming — Responses may take 10-30 seconds for complex requests; Slack shows a typing indicator during this time
Rate Limits
- Each user is subject to per-hour request limits configured by the workspace admin
- PR creation is limited to prevent runaway automation
- Long-running investigations may be interrupted if they exceed timeout thresholds
Accuracy Considerations
- Claude may misidentify the root cause of complex bugs that span multiple services
- Generated code should always be reviewed by a human before merging
- Claude may not have access to runtime state, logs, or monitoring data unless explicitly provided in the message
Troubleshooting Common Issues
| Issue | Solution |
|---|---|
| Claude does not respond | Ensure Claude is invited to the channel with /invite @Claude |
| "Repository not found" error | Verify the repository is connected in the Anthropic Console |
| PR creation fails | Check that the GitHub token has write permissions to the repository |
| Slow responses | Reduce the scope of the request or split it into smaller questions |
| Claude responds to unrelated messages | Claude only responds when explicitly mentioned with @Claude |
| Permission denied | Ensure your Slack account is linked to the Anthropic console |
Summary
Claude Code in Slack transforms your team's chat into an AI-powered development hub. By connecting Slack to your repositories, you enable a seamless pipeline from bug reports to pull requests, on-demand code explanations, incident support, and channel summarization. The key is to configure permissions carefully, enforce human review for all generated code, and provide Claude with clear, specific context in every request.