Claude Research Analyst for Slack is a boilerplate that turns any Slack workspace into a persistent AI research analyst, powered by Claude Managed Agents, Chat SDK, and Vercel Connect.
What is the Claude Research Analyst for Slack?
It is a starter template from Vercel Labs that integrates a Claude Managed Agent with Slack through Chat SDK. When a user @mentions the bot in a channel or sends it a DM, the agent searches and fetches sources inside an Anthropic-managed sandbox and streams a brief back into the thread. The app runs on Next.js 16 on Vercel and uses Claude Sonnet 5 as its underlying model.
Each Slack thread maps to one persistent Managed Agents session, so follow-ups keep the prior research context. Vercel Connect owns the Slack app and credentials, while Upstash Redis stores subscriptions, session mappings, and webhook deduplication across deployments.
Key Features
- Persistent thread context — Every Slack thread maps to one Managed Agents session; follow-ups retain prior research context without re-mentioning in single-human threads.
- One-command provisioning —
npm run cma:setupcreates the agent and sandbox environment, writes the agent ID and environment ID to.env.local, and adds them to the linked Vercel project. - Anthropic-managed sandbox — The agent searches and fetches web pages in a sandbox where Bash is disabled to reduce the risk of untrusted pages exfiltrating conversation data.
- Debug mode diagnostics — Setting
CLAUDE_DEBUG_MODE=trueposts a table after each turn with duration, model requests, token and prompt-cache usage, web searches and fetches, and a Claude Console session link. - Participant-aware mentions — Follow-ups in a thread need no extra @mention when one human participates; with multiple humans, the bot responds only when explicitly mentioned.
- Chat SDK Slack adapter — Slack events are acknowledged quickly by the webhook route and dispatched in the background, using the official Chat SDK Slack adapter.
- Redis-backed state — Upstash Redis preserves subscriptions, thread/session mappings, and webhook deduplication so restarts and redeploys don't lose context.
- Customizable model and prompt — The model and system prompt live in
scripts/cma/lib/agent.ts; publishing a new version vianpm run cma:updateis required after prompt changes.
Who is it for?
- Teams that want an AI researcher inside Slack — Deploy it to a channel and get cited, sourced briefs without leaving the conversation.
- Developers building on Claude Managed Agents — Use the repo as reference for wiring managed agents to Slack with Chat SDK, Vercel Connect, and Redis.
- Vercel and Upstash users — See an example of Vercel Connect Slack triggers, marketplace Redis, and serverless webhooks working together.
What can you do with it?
- Research in channels: Mention the bot in a thread and it will pull live web sources, then stream a brief reply directly back into the thread.
- Persistent follow-up questions: Ask a follow-up in a single-human thread without re-mentioning; context carries over from earlier turns in the same thread.
- Debug agent behavior: Turn on
CLAUDE_DEBUG_MODE=trueto see per-turn diagnostics, token usage, and a link to the Claude Console session for inspection.
How does it work?
Setup follows four steps: clone the repo and install dependencies (Node.js 24+), attach Slack via Vercel Connect and add Upstash Redis from the Vercel Marketplace, run npm run cma:setup to provision the Managed Agent and sandbox, then add ANTHROPIC_API_KEY and deploy with vercel deploy --prod. At runtime, Slack webhooks are received by the Next.js route, mapped to a persistent agent session, and the event stream is streamed back into the thread as the agent works.
Pros and cons
- Pros: one-command setup, persistent per-thread context, structured debug output, and fast webhook acknowledgement via background dispatch.
- Cons / considerations: requires Node.js 24+, access to Claude Managed Agents (Anthropic API key), a Redis instance, and all three required environment IDs; archiving resources with
npm run cma:archiveis permanent, so confirm agent IDs first.
FAQ
What do I need before deploying this template?
You need an Anthropic API key with Managed Agents access, a Vercel project, and a Redis store (Upstash Redis from the Vercel Marketplace is used in the quickstart). The setup also requires Node.js 24+ locally to run the provisioning script.
Does the bot remember context from earlier turns?
Yes. Each Slack thread maps to one persistent Managed Agents session, so follow-ups in that thread retain the prior research context. Anthropic pins each session to the agent version that created it, so prompt changes should be tested in a new thread.
How do I change the model or system prompt?
Edit scripts/cma/lib/agent.ts and publish the change with npm run cma:update. Do not rerun npm run cma:setup for prompt changes; that command is only for one-time provisioning.
How do I clean up the resources?
Run npm run cma:archive to archive the persistent Anthropic resources. Because archiving is permanent, confirm both Managed Agents IDs before executing.






