Skip to content

Pair with Claude on your repo

This page starts Claude Code on your repo in a cloud sandbox, detaches from it, and reattaches. The sandbox keeps running after you close the terminal, for up to --idle (30m by default).

  1. Start Claude from your repo.

    Terminal window
    cd ~/src/my-repo
    git push
    droneship run claude

    The sandbox clones your repo’s origin at your current branch, so push first. Claude opens in your terminal, and you work with it as you would locally. With no key sent, it uses the API key you saved in the console, or else you sign in to your Claude plan inside the sandbox. Harnesses and models has the other ways to pay.

  2. Step away.

    To detach, press Enter, then type ~ and .. Or close the terminal. Claude keeps running for up to --idle (30m by default):

    detached; claude keeps working in <id> — droneship run claude to reattach
    with nobody attached, the sandbox's idle timeout still applies

    For longer, raise --idle when you start the sandbox (for example droneship run claude --idle 4h), or hand the work off with -p. See Auto-stop.

  3. Come back to it.

    Terminal window
    droneship run claude
    Reattaching to <id> (you/my-repo@main)

    From the same repo, run claude finds your existing sandbox and attaches you to Claude’s session. The session isn’t restarted.

  4. Open a shell beside Claude.

    Terminal window
    droneship shell # an interactive shell in the sandbox
    droneship shell --id <id> git status # one command, then back to your laptop

    Use --id when you have more than one sandbox. droneship list shows the ids.

  5. Stop it, or let it stop itself.

    Terminal window
    droneship kill <id>
    Terminated sandbox <id> (local SSH key discarded)

    With nobody connected, the sandbox shuts down after 30 minutes idle. It also shuts down after 8 hours regardless. Its workspace is saved in both cases, so the next droneship run claude in this repo starts with those files.

The Sandboxes page in the console lists the sandbox with its harness, repository and branch, status, time running, and when it auto-stops. Open it to see its isolation level and egress policy.

Claude runs in a tmux session inside the sandbox, so a dropped connection doesn’t stop it. By default Claude doesn’t ask for permission before each command; the sandbox is the boundary. Pass --ask to turn the permission prompts back on.

run claude reattaches only to a sandbox for the repo you’re in, and prefers one on your current branch. If it finds yours on another branch, it attaches anyway and says how to switch:

<id> is on main; you're on feat/login here. In the sandbox: git fetch origin --tags && git checkout feat/login, or a separate one: droneship run claude --new --ephemeral

Options that are useful while pairing:

Terminal window
droneship run claude --model opus # choose Claude's model
droneship run claude -- --verbose # pass flags through to claude
droneship run claude -L 3000 # forward port 3000 to your machine
droneship shell -L 3000 # the same, from a shell
droneship run claude --new # another sandbox instead of reattaching

A second sandbox on the same repo needs --ephemeral, because the saved workspace holds one sandbox at a time. Run several agents in parallel covers it. Every flag is in droneship run and droneship shell.