Palmy is a Slack bot that runs Claude Code in an isolated Modal sandboxes against GitHub repos. Mention the bot with a task, it clones the repo, runs Claude Code, and response back to Slack.
- Modal Account with
modal clisetup - ANTHROPIC_API_KEY
- Slack workspace
-
Create a Slack App on https://api.slack.com/apps, and get the
SLACK_BOT_TOKEN,SLACK_SIGNING_SECRET -
Get a Github Token - Since we are a small team and it is not meant to be production grade, currently we just use personal token. For larger teams, you should create a Github App with proper auth instead.
-
Create a Modal secret:
modal secret create palmy-secrets \ ANTHROPIC_API_KEY=sk-ant-... \ SLACK_BOT_TOKEN=xoxb-... \ SLACK_SIGNING_SECRET=... \ GITHUB_TOKEN=ghp_... \ DEFAULT_REPO=owner/repo \ GIT_USER_NAME="Your Name" \ GIT_USER_EMAIL=you@example.com -
Deploy:
modal deploy app.py -
Point your Slack app's event subscription URL to
https://<your-modal-url>/slack/events -
Add the slack app to your workplace, and start assigning tasks to it!
sequenceDiagram
participant S as Slack
participant P as Palmy (Modal Function)
participant SB as Sandbox (Modal Sandbox)
participant G as GitHub
S->>P: @palmy "add dark mode"
P->>SB: Create sandbox
SB->>G: Clone repo
SB->>SB: Run Claude Code
SB-->>P: Result + cost
P-->>S: Post reply in thread
S->>P: "also update the tests"
P->>SB: Resume session
SB->>SB: Run Claude Code --continue
SB-->>P: Result + cost
P-->>S: Post reply in thread
- Palmy Slack App triggers a Modal function
run_initial_task - the Modal function creates the sandbox and clones the github repo
- Run Claude Code with API key inside the sandbox
- Read the results via stdout and posts the response back to the channel thread
- This is a quick PoC for people who use Claude Code with API key and have no access to Claude Code slack bot. Not meant to be production-grade, but rather an internal tool that we open source to show you how easy it is to set one up.
- As mentioned above, Github personal token is not recommended for security reasons. Also with personal token, all the github interactions will be on behalf of the github user, rather than a github bot. So if you use personal token, assign minimal permission (gh cli is available inside the sandbox for creating/reading PRs, issues, etc).
