{
  "id": 22199063,
  "title": "A sandbox for Claude Code: running it headless in a cloud workspace",
  "url": "https://urgent.news/2026/11/27/a-sandbox-for-claude-code-running-it-headless-in-a-cloud-workspace",
  "topic": "ai",
  "section": "AI",
  "published": "2026-11-27T17:31:47.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/sandscale/a-sandbox-for-claude-code-running-it-headless-in-a-cloud-workspace-fm8"
  },
  "original_language": "en",
  "account": "To run Claude Code headlessly in the cloud, follow these steps:\n\n1. Create a Sandscale workspace, install Claude Code, clone your repository, and sign in to Claude Code. The workspace provides a separate environment for Claude Code to run code without affecting your local machine.\n\n2. Run Claude Code in headless mode using the -p flag. Specify the tools Claude Code is allowed to use with the --allowedTools flag. The output will be returned in JSON format, including the session ID.\n\n3. To continue a session, use the session ID retrieved in the previous step. Use the claude -p command with the --resume flag followed by the session ID.\n\n4. To keep the Claude Code workspace running even after you disconnect, use a terminal multiplexer like tmux to detach from the session. The workspace will continue running until it is stopped or reaches a scheduled stop time.\n\n5. To view the results from your local machine, reconnect to the workspace using sandscale workspace open or sandscale workspace ssh. If the Claude Code session started a development server, you can access it locally using sandscale workspace port-forward.\n\nRunning Claude Code in a Sandscale workspace provides a sandboxed environment for the model to execute code without impacting your local machine. The workspace keeps its disk when stopped, preserving your repository, installed tools, and Claude Code session files. Network access is required for Claude Code to communicate with Anthropic's API.",
  "summary": "Short answer: if you want Claude Code's commands off your machine, run Claude Code itself on a cloud computer and drive it with claude -p . A Sandscale workspace is a Firecracker microVM with its own kernel and a disk that survives between sessions, so the repository, the installed tools and Claude Code's own session files are still there next time, and nothing it runs touches your laptop. This…",
  "summary_source": "publisher",
  "key_points": [
    "Create Sandscale workspace to run Claude Code headlessly",
    "Run Claude Code in headless mode with -p flag and --allowedTools",
    "Use session ID to continue session, detach with tmux"
  ],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "machine_translated": false,
  "ai_generated": true,
  "disclaimer": "Accounts, briefs, key points, the editor’s take and translations are written by software from other outlets’ reporting and may contain errors. A summary whose summary_source is \"publisher\" is the outlet’s own feed text. Always check the linked original."
}