Skip to content

Claude Code routines

Claude Code routines run Claude on a schedule, from an API call or on a GitHub event, without your laptop. By default they run on Anthropic’s own cloud. This guide connects them to Droneship instead, so each run gets its own isolated sandbox with your project’s egress policy.

It works through a Claude self-hosted environment: a named destination in claude.ai that sessions can be sent to. Droneship serves that environment for one project. Every session sent to it runs in a Droneship sandbox, whether it comes from a routine, from claude.ai/code, or from claude --cloud in a terminal.

  • A Claude Team or Enterprise organization. Self-hosted environments are not available on Pro or Max.
  • A Claude Owner to turn self-hosted environments on and create the environment.
  • A Droneship plan other than Free or Trial. Routine sandboxes are not part of the Free and Trial plans.
  • Someone to connect it in Droneship. In the console that’s an org admin. droneship routines enable connects it for the project you’re signed in to.
  • GitHub connected in claude.ai for the person whose routines use a repository. Claude clones and pushes through Anthropic with that connection, so the sandbox holds no git credentials.
  1. Turn on self-hosted environments in claude.ai. As a Claude Owner, open Admin settings → Cloud environments and turn on Allow self-hosted environments.

  2. Create a self-hosted environment and copy its key. On the same page, create an environment, for example droneship. Its key starts with sk-ant-cc- and is shown only once. Treat it like a password: anyone holding it can take the environment’s sessions.

  3. Connect it to a Droneship project. In the console, switch to the project the runs should belong to, open Settings from the account menu (your name, top right), and under Claude Code routines paste the key and click Enable routines. Or, from your terminal:

    Terminal window
    droneship routines enable

    Either way, Droneship checks the key with Anthropic before saving it. Success reads Connected in the console, or ✓ Connected to environment ccpool_… in the terminal.

  4. Send sessions to the environment.

    • A routine: when you create or edit it at claude.ai/code/routines, pick the environment in the environment selector.
    • One session: pick the environment when you start a session on claude.ai/code, or run claude --cloud "<task>" --environment ccpool_….
  5. Watch it run. Each session gets its own sandbox, listed under Sandboxes in the console and in droneship list. The session itself, with its transcript and any pull request, stays in claude.ai.

Sandbox One per session, in this project, as the person who enabled routines. It counts toward the project’s sandbox hours like any other sandbox.
Lifetime Starts when the session is picked up and ends soon after the session goes idle. Replying to the session in claude.ai picks it up again in a new sandbox. A sandbox never runs longer than an hour.
Git Through Anthropic, using the session creator’s GitHub connection in claude.ai. No git credentials are in the sandbox, and Claude pushes to claude/ branches.
Model calls Straight to Anthropic, on the Claude plan of whoever started the session. They do not go through the Highflame gateway, so the console shows no AI spend for these sandboxes.
Egress The egress bundle you picked when enabling: baseline-secure by default, which allows package registries. See Egress.

The conversation itself goes to Anthropic, as it does for any Claude cloud session. What Droneship adds is where the code runs: an isolated sandbox with your egress policy, holding no git or API credentials.

Pick the bundle when you enable, in the console’s What routine sandboxes may reach list or with --policy-bundle:

Bundle Reaches Use it when
baseline-secure (default) Anthropic, GitHub, and package registries (npm, PyPI, crates.io, Go modules) Routines that install dependencies, run tests or build
pci-scope Anthropic only Routines that only read and change code
open-dev Any host Routines that need hosts you cannot list in egress rules ahead of time

Under baseline-secure and pci-scope, routine sandboxes also use the project’s egress rules, so a host you allow there is reachable from routines too.

To change it later, pick another bundle in Settings → Claude Code routines, leave the key empty and click Save. From the terminal, run droneship routines enable --policy-bundle <bundle> and press Enter at the key prompt. The key and the connection stay as they are.

  • New key. If you regenerate the environment’s key in claude.ai, or want this project to serve a different environment, paste it under New environment key in Settings → Claude Code routines and click Save (it asks you to confirm), or run droneship routines enable again. The old key stops being used.
  • Turn off. Click Disable routines in the console, or run droneship routines disable. Sessions already running finish. New sessions sent to the environment wait in claude.ai until a runner serves it again.

In the console, only org admins can enable, update or disable routines, and everyone in the organization can see whether they’re on. droneship routines enable and disable act on the project you’re signed in to.

“could not connect to environment …: unauthorized”. The key is wrong, was regenerated, or its environment was deleted. Copy a fresh key from claude.ai and enable again.

“this environment is enabled for another project”. An environment can serve one Droneship project. Disable routines in the other project first, or create a second environment in claude.ai.

“Claude Code routines are not available on this deployment yet”. This Droneship deployment doesn’t run routines yet.

“Free plan limit reached: Claude Code routines are not included” (or Trial). Routines need a Droneship plan other than Free or Trial. Contact sales@highflame.com to switch to Pro.

A session stays queued in claude.ai. Check that routines are connected (droneship routines, or Settings → Claude Code routines) and that the routine is set to this environment. If the environment’s Activity tab in claude.ai shows a failed start, it says why, for example a plan limit on the Droneship side.

claude --cloud in the terminal sits on “waiting for runner”. Open the session on claude.ai/code. The run is often already going there.

Installing dependencies fails with “connection reset”. The egress policy doesn’t allow that host. Add an allow rule for it on the project’s Egress page (Egress rules). pci-scope allows no package registries, so switching to baseline-secure also works for the public ones.