Compute Providers

Run agents on local tmux, Docker containers, or EC2 instances.

Overview

Ark supports three compute providers. Each provider handles how agent sessions are launched, monitored, and cleaned up. The local provider is always available; Docker and EC2 require additional setup.

Providers declare their own isolation modes:

Local Provider

The default. Agents run in local tmux sessions. No setup required beyond having tmux installed.

Auto-created on first boot. Sessions launch as ark-s-<id> tmux sessions.

ark compute list
# Shows: local  local  running

Isolation

Docker Provider

Run agents in Docker containers. Each session gets its own container.

Setup

ark compute create my-docker --provider docker --image ubuntu:22.04
ark compute provision my-docker

Options:

How it works

  1. Container is created from the specified image
  2. Your repo is mounted into the container
  3. Bun and Claude Code are installed inside the container
  4. Agent launches in a tmux session inside the container

Provider Capabilities

Each provider declares its own capabilities, which determine what operations are available:

CapabilityLocalEC2Docker
Always runningYesNo (needs provisioning)No (needs provisioning)
supportsWorktreeYes (git worktree per session)No (remote clone)No
canRebootNoYesYes
canDeleteNoYesYes
Test supportNoYesYes

EC2 Provider

Run agents on AWS EC2 instances. Good for heavy workloads or when you need isolation from your dev machine.

Authentication Setup

Before your first remote dispatch, set up credentials:

  1. Run ark auth to configure Claude credentials for remote agents
  2. Configure AWS credentials via ~/.aws/credentials or pass --profile when creating the compute
  3. SSH keys are auto-generated per compute at ~/.ssh/ark-<name> -- no manual key management needed

On provision and dispatch, ark automatically syncs all required credentials to the EC2 instance: SSH keys, AWS credentials, git config, gh auth tokens, and Claude API keys.

Setup

ark compute create dev-box --provider ec2 --size m --arch x64 --region us-east-1
ark compute provision dev-box

EC2 instances incur AWS charges while running. Use --idle-minutes to enable auto-shutdown, and always run ark compute stop when work is done.

Instance Sizes

SizevCPURAMLabel
xs28 GBExtra Small
s416 GBSmall
m832 GBMedium
l1664 GBLarge
xl32128 GBExtra Large
xxl48192 GB2X Large
xxxl64256 GB3X Large

Configuration

ark compute update dev-box --ingress "1.2.3.4/32" --idle-minutes 30

Options:

Post-Provision Verification

After cloud-init completes, ark automatically verifies that all required tools are installed on the instance: claude, ark, bun, tmux, and git. If any tool is missing, ark attempts auto-remediation to install it. Credentials are synced as part of this process.

SSH Connection Pool

EC2 operations use SSH ControlMaster multiplexing to avoid opening a new TCP connection for every command. Requests are managed through per-type queues:

This prevents overwhelming the remote sshd with concurrent connections.

Operations

ark compute start dev-box     # start a stopped instance
ark compute stop dev-box      # stop (preserves data)
ark compute destroy dev-box   # terminate instance
ark compute ssh dev-box       # SSH into the instance
ark compute sync dev-box      # sync environment (push/pull)
ark compute metrics dev-box   # show CPU, memory, disk, network

Monitoring

The TUI Compute tab (press 6) shows real-time metrics for running computes:

Metrics are polled every ~9 seconds.

Dispatching to Remote Compute

When creating a session, specify the compute target:

ark session start --repo . --summary "Deploy" --compute dev-box

Or select it in the TUI's New Session form.

The agent will be launched on the remote compute. Attach via a in the TUI to get a remote tmux session. Press Ctrl+B d to detach from the tmux session without interrupting the agent.

Devcontainer and Compose

Devcontainer and Docker Compose support require explicit opt-in via arc.json in your project root:

{
  "devcontainer": true,   // use repo's devcontainer.json
  "compose": true          // use repo's docker-compose.yml
}

arc.json supports JSONC (comments are allowed in devcontainer.json as well). These options are not enabled by default to avoid unexpected container builds.