Skip to content

palmier-io/palmy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Palmy

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.

Palmy

Setup

Prerequisites

  1. Modal Account with modal cli setup
  2. ANTHROPIC_API_KEY
  3. Slack workspace

Steps

  1. Create a Slack App on https://api.slack.com/apps, and get the SLACK_BOT_TOKEN, SLACK_SIGNING_SECRET

  2. 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.

  3. 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
    
  4. Deploy: modal deploy app.py

  5. Point your Slack app's event subscription URL to https://<your-modal-url>/slack/events

  6. Add the slack app to your workplace, and start assigning tasks to it!

How it works

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
Loading
  1. Palmy Slack App triggers a Modal function run_initial_task
  2. the Modal function creates the sandbox and clones the github repo
  3. Run Claude Code with API key inside the sandbox
  4. Read the results via stdout and posts the response back to the channel thread

Disclaimer

  1. 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.
  2. 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).

About

Run Claude Code, from Slack, on Modal.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages