Policy·27 Nov 2026·via Dev Community·Covered by 4 sources

    A sandbox for Claude Code: running it headless in a cloud workspace

    Developers can now run Anthropic's Claude Code AI agent within a Sandscale cloud workspace, utilizing Firecracker microVMs to isolate code execution from local machines. This method, detailed in a guide referencing documentation read in November 2026, aims to enhance security and maintain session state for AI development.

    To operate Anthropic's Claude Code AI agent and its commands off a local machine, developers can deploy it within a Sandscale workspace. A Sandscale workspace functions as a Firecracker microVM, equipped with its own kernel and a persistent disk. This architecture ensures that installed tools, code repositories, and Claude Code's session files remain intact across development sessions. The primary benefit is that any operations initiated by Claude Code execute within this isolated microVM, preventing them from affecting the user's local laptop.

    The workflow begins with installing the Sandscale command-line interface, then opening a designated workspace. Inside the workspace shell, developers install Claude Code, clone their repository, and sign in. Because the workspace disk persists, this initial setup for sign-in and repository cloning remains available after the workspace stops and restarts. For programmatic or non-interactive use, Claude Code can be run with the `-p` or `--print` flag, along with `--allowedTools` to pre-approve functionalities and `--output-format json` to receive results and session IDs.

    A key advantage of this microVM-based architecture is the security isolation it provides. If a command goes awry, its impact is confined to the workspace's disk and does not extend to the local machine. This setup also means developers do not need Docker installed on their laptop. Organizations can enforce policies regarding workspace templates and sizes, and secrets can be managed through Vault instead of direct prompts. Sandscale also provides audit logs for starting, stopping, and connecting to workspaces, offering a layer of oversight.

    Users can continue long-running tasks by executing commands within a terminal multiplexer like tmux on the workspace, then detaching and closing their local machine. The workspace continues to run until it is explicitly stopped, goes idle, or reaches a scheduled stop time. Workspace hours are counted against a user's plan only while the workspace is active. Reconnection is possible via `sandscale workspace open` or `sandscale workspace ssh` commands, and local port forwarding allows access to development servers running within the workspace without exposing them to the internet.

    The guide, which incorporates information from Sandscale's workspaces documentation and Anthropic's programmatic Claude Code page, all reportedly read in November 2026, includes specific security advisories. Running a programmatic session without the `--bare` flag means Claude Code will automatically execute hooks in project settings and connect servers without a trust prompt. Therefore, users are advised to only point such sessions at repositories they would trust to open themselves. With the `--bare` flag, this auto-discovery is skipped, though settings files and their permission rules are still read.

    Share this article

    Go deeper
    Original reporting by Dev CommunityWe don't republish, read the full story →

    Related reading

    6 stories