Skip to content

Commit 6f14829

Browse files
add claude code example
1 parent 9810c3a commit 6f14829

File tree

8 files changed

+1773
-0
lines changed

8 files changed

+1773
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ANTHROPIC_API_KEY=<YOUR-KEY-HERE>

examples/claude-code/Dockerfile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
FROM docker.io/cloudflare/sandbox:0.4.7
2+
RUN npm install -g @anthropic-ai/claude-code
3+
ENV COMMAND_TIMEOUT_MS=300000
4+
EXPOSE 3000
5+
6+
# On a Mac with Apple Silicon, you might need to specify the platform:
7+
# FROM --platform=linux/arm64 docker.io/cloudflare/sandbox:0.4.4

examples/claude-code/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Claude Code 🧡 Sandbox SDK
2+
Run Claude Code for on Cloudflare Sandboxes! This example shows a basic setup that does the following:
3+
- The worker accepts POST requests that include a repository URL and a task description
4+
- The worker spawns a sandbox, clones the repository and starts Claude Code in headless mode with the provided task
5+
- Claude Code will edit all necessary files and return when done
6+
- The Worker will return a response with the output logs from Claude and the diff left on the repo.
7+
8+
Happy hacking!

0 commit comments

Comments
 (0)