# anywhere: Complete Documentation > Canonical index: https://anywhere.so/llms.txt # Set up anywhere > Index of all pages: https://anywhere.so/llms.txt This page is for an AI coding agent (such as Claude Code, Codex, Cursor, or OpenCode) whose user asked it to set up anywhere. Follow the steps in order, run the commands yourself, and stop only where a step says the user must act. When you finish, the `anywhere` CLI is signed in on this machine and you can deploy scheduled and webhook cloud workers for the user. ## 1. Install the CLI and skill Run (Linux on x86_64): ```sh curl -fsSL https://anywhere.so/install.sh | ANYWHERE_INSTALL_BASE=https://anywhere.so sh ``` It installs `anywhere` into `~/.local/bin` and writes the anywhere skill for Claude Code and Codex into `~/.claude/skills/anywhere` and `~/.agents/skills/anywhere`. If your environment blocks outbound network access, ask the user to allow the platform host and run it again. Confirm the binary is available and is the workers CLI: ```sh command -v anywhere || ls ~/.local/bin/anywhere anywhere --help | head -n 1 ``` If only `~/.local/bin/anywhere` exists, use that full path in the steps below. ## 2. Check sign-in status Run: ```sh anywhere workers list ``` If it lists workers or reports none, the CLI is already signed in: skip to step 4. On `not_signed_in`, `unauthenticated`, or `native_authority_denied`, continue to step 3. On any other error, follow what its message says. ## 3. Have the user sign in Run `anywhere login --api https://api.anywhere.so` in the background (it waits up to 10 minutes for browser approval). Without a background tool, create a private temp directory (`dir="$(mktemp -d)"`), run `nohup anywhere login --api https://api.anywhere.so > "$dir/login.log" 2>&1 &`, read the log, and remove the temp directory afterward. On standard error it prints an approval URL (`https://anywhere.so/cli-login`) and a user code. Give the user that link and code, and nothing else to open: > Open this link and sign in. Then confirm the page shows code **CODE** and press **Approve**. Never approve the login yourself and never ask the user for a password or token. Once approved, credentials are saved automatically and the command exits. On `cli_login_expired`, run `anywhere login --api https://api.anywhere.so` again and share the new link. ## 4. Verify and hand over Run `anywhere workers list` again to verify sign-in succeeded. Then tell the user in one or two sentences that anywhere is ready: they can deploy scheduled or webhook workers from any folder with an `anywhere.toml`, view runs and HTML reports at `https://anywhere.so`, and ask what worker they would like to build and deploy first. Before building their first worker, read the installed skill at `~/.claude/skills/anywhere/SKILL.md` or `~/.agents/skills/anywhere/SKILL.md`, or browse [the documentation index](/llms.txt) and [Quickstart](/docs.md). --- # About anywhere anywhere, at [anywhere.so](/), is where cloud agents work autonomously. Give Claude Code, Codex, OpenCode, Gemini, custom Python, TypeScript, Go, or Rust agents, or plain shell scripts their own persistent Linux machine, headless browser, and connected tools—waking on schedules and webhooks, delivering finished work to one shared Inbox, and sleeping at `$0` between runs using the plans or API keys you already pay for, with no workflow SDK and zero AI credit markup. ## Why we built it Builders, founders, and engineering teams increasingly run coding and ops agents unattended in the background: triaging yesterday's errors every morning, reviewing pull requests on GitHub webhooks, tracking revenue and customer health, monitoring competitor pages with a browser, or running multi-worker software factories across Engineering, GTM, and Ops. Existing options each force a trade-off: - **Visual workflow builders (Gumloop, Zapier, n8n):** Lock you into a drag-and-drop node graph, bill per task or AI credit markup, and don't run Claude Code, Codex, OpenCode, or custom repos on a real persistent Linux computer. - **Vendor routines & workflow SDKs (Claude Code Routines, Codex Cloud, Trigger.dev):** Lock you to one vendor's harness, models, and cloud limits, or require rewriting into a TypeScript or Python workflow SDK on ephemeral containers that wipe disk state between runs. - **Raw sandboxes & DIY VPS (Modal, E2B, DigitalOcean, GitHub Actions):** A VPS bills 24/7, shares one OS and every secret across agents, and breaks at 2 a.m. over auth expiry, lockfiles, and hung runs. GitHub Actions cron lags and resets its VM every run. anywhere combines any-harness execution with reliable schedules and queued webhooks, workspace MCP Connections and encrypted secrets, a real persistent Linux computer and headless browser per worker, and one workspace Inbox for outcomes and HTML reports, sleeping at `$0` compute between runs. ## Key capabilities - **Any harness, zero SDK, zero AI markup:** Install `claude`, `codex`, OpenCode, Python, Node, Go, Rust, or `apt` packages in `build` and run ordinary shell commands in `[[trigger]]` (cron or webhook). Use your own API keys, subscriptions, OpenRouter, or interactive CLI sign-in (`anywhere exec -t`). - **Schedules & event triggers with dedupe & replay:** Any-minute 5-field cron with IANA time zones, plus secret webhook URLs (`POST /v1/webhooks/`) persisted to Postgres before `202`, native `dedupe_header` support, serial queueing up to 100 waiting runs, hard timeouts, and kept inputs you can inspect (`anywhere runs input`) or replay (`anywhere runs replay`) after a fix. - **Workspace MCP Connections, secrets & Projects:** Connect remote HTTPS MCP servers (Notion, Linear, Sentry, PostHog, or any HTTPS MCP endpoint) once per workspace with automatic OAuth, custom OAuth, or static keys: tokens stay encrypted in Postgres and are injected upstream by anywhere's proxy with live scope updates and instant revocation, never touching worker disks. Layer AES-256-GCM workspace and worker secrets with staged pending-apply (`anywhere secrets apply`), and organize fleets into optional Projects while keeping flat `workspace/worker` names unchanged. - **Persistent ZFS Linux disk & headless browser:** Git repositories stay warm (`git fetch` instead of re-cloning), SQLite databases and `/app/data/notes/` carry memory across runs, and the bundled `browser-agent` starter runs pinned headless Chromium inside the sandbox via `agent-browser` stdio MCP with domain allowlisting, optional persistent profiles, and clean shutdown before sleep. - **Finished work in one Inbox:** Every run lands in the workspace Inbox (filterable by Unread, Failed, Running, and Project) with explicit outcomes, optional `$ANYWHERE_RUN_DIR/note` summaries, logs, scrubbed transcripts, and sandboxed cookieless HTML reports (`artifacts/index.html`) readable without waking the worker. Runs are kept for 30 days after they end plus each worker's newest 50 ended runs whatever their age. - **Strong isolation & portability:** Dedicated gVisor sandbox per worker, secrets omitted from `build` and logs, and full data portability via `anywhere pull`. ## The team behind anywhere anywhere is built by Michael and Guru at DigitalCarbon Inc. We build infrastructure for the way people and AI agents work together: agents deploy, connect tools, and debug through purpose-built CLIs and skills, while people get one calm Inbox to review outcomes, share reports, and replay runs. Questions and feedback go to . ## Key facts - **Name:** anywhere - **Website:** [anywhere.so](/) - **Category:** Cloud platform where AI agents work autonomously on schedules and webhooks - **Developer:** DigitalCarbon Inc. (Michael and Guru) - **Agent setup prompt:** `Set up anywhere for me: https://anywhere.so/setup` - **Harnesses supported:** Claude Code (`claude -p`), Codex (`codex exec`), OpenCode, Gemini, custom Python/TypeScript/Go/Rust agents, OpenRouter, and any Linux CLI - **Isolation, storage & browser:** Dedicated gVisor (`runsc`) sandbox, persistent ZFS Ubuntu Linux disk per worker, and bundled headless Chromium via `agent-browser` - **Connections & secrets:** Workspace MCP Connections (proxy-injected OAuth/static credentials, never on disk), AES-256-GCM workspace & worker secrets with staged apply, and optional Projects - **Sleep & billing:** Triggered workers sleep automatically as soon as their last run ends (`$0` CPU and memory while asleep; disk billed while the worker exists; zero AI markup) - **Plans:** Free (`$0/month`, personal workspace, up to 3 workers, `$3` usage included, up to 1 shared vCPU / 2 GiB memory / 10 GiB disk per worker, 4 GiB awake memory default, workers with no run in 30 days archived with data kept) · Pro (`$10/month`, personal workspace, unlimited workers, `$10` usage included, up to 4 shared vCPUs / 8 GiB memory / 100 GiB disk per worker, 16 GiB awake memory default, top-ups `$10 to $1,000`) · Team (`$50/month`, team workspace, unlimited workers, `$50` shared monthly usage, unlimited free teammates where every member of an active team deploys, manages projects/connections/secrets, and reads runs and logs, same 4 vCPU / 8 GiB / 100 GiB per-worker limits, 32 GiB awake memory default, top-ups `$10 to $1,000`). - **Metered rates:** Memory $0.04 per GiB-hour of declared memory · CPU $0.10 per vCPU-hour · Disk $0.30 per GiB-month · Data out $0.20 per GiB (data in is free) - **Support:** --- # Quickstart A worker is an isolated Ubuntu Linux machine with a persistent disk that wakes on a trigger, runs your command, keeps what the run left, and goes back to sleep at `$0` compute. Bring any harness or script — Claude Code, Codex, OpenCode, a custom Python or TypeScript agent, or plain shell commands — with no workflow SDK. ## Set up with your coding agent The fastest way: paste this into your local Claude Code, Codex, Cursor, or OpenCode session: ```text Set up anywhere for me: https://anywhere.so/setup ``` Your local agent reads [the setup instructions](/setup), installs the `anywhere` CLI and its skill, prints a link and code for you to approve sign-in, and helps you deploy your first cloud worker. ## Set up by hand 1. **Install the CLI and its skill (Linux x86_64):** ```sh curl -fsSL https://anywhere.so/install.sh | ANYWHERE_INSTALL_BASE=https://anywhere.so sh ``` This installs `anywhere` into `~/.local/bin` and writes the skill for Claude Code and Codex. If your shell cannot find `anywhere`, add `~/.local/bin` to your `PATH`. 2. **Sign in:** ```sh anywhere login --api https://api.anywhere.so ``` Open the printed link in your browser, check that the code matches your terminal, and press **Approve**. ## Deploy your first worker Create a folder named `triage` with an `anywhere.toml` and a `run.sh`. The folder name becomes the worker name (lowercase letters, digits, and hyphens). This example uses Claude Code, but any command or agent harness works the same way: ```toml # triage/anywhere.toml title = "Daily error triage" build = "npm i -g @anthropic-ai/claude-code" [[trigger]] name = "triage" cron = "0 9 * * *" timezone = "America/New_York" run = "bash run.sh" timeout = 1800 ``` ```sh #!/bin/sh # triage/run.sh set -eu export IS_SANDBOX=1 mkdir -p "$ANYWHERE_RUN_DIR/artifacts" claude -p "Summarize today's focus in three bullets." \ --dangerously-skip-permissions \ > "$ANYWHERE_RUN_DIR/artifacts/summary.md" printf '%s\n' "Daily summary written" > "$ANYWHERE_RUN_DIR/note" ``` Writing `$ANYWHERE_RUN_DIR/note` and files under `$ANYWHERE_RUN_DIR/artifacts/` is completely optional — any command that exits works out of the box, and opting into these small conventions surfaces notes and reports directly in the portal and CLI. See [Runs & conventions](/docs/runs-and-artifacts). Validate and deploy from the folder: ```sh anywhere check ./triage anywhere deploy ./triage ``` ## Add credentials Either set an encrypted secret on this worker (or share it across your whole workspace with `--workspace --scope all` and apply with `anywhere secrets apply`): ```sh printf %s "$ANTHROPIC_API_KEY" | anywhere secrets set --worker triage ANTHROPIC_API_KEY ``` Or sign into your harness directly on the worker's persistent disk with an interactive terminal: ```sh anywhere exec -t triage -- env CLAUDE_CONFIG_DIR=/app/data/claude claude auth login ``` See [Disk, secrets & databases](/docs/storage-and-secrets) for shared workspace secrets, staged apply, and optional projects, and [Harnesses & sign-in](/docs/harnesses) for Claude Code, Codex, OpenCode, OpenRouter, custom agents, and MCP servers. ## Trigger it now and inspect the run A successful deploy proves `build` ran, not that your command works. Inspect the worker's triggers, run one immediately, and read what it left: ```sh anywhere triggers --worker triage # list cron schedules and webhook triggers anywhere run triage --worker triage # run a trigger now; prints the run ID anywhere runs --worker triage # list runs, newest first anywhere runs RUN_ID --worker triage # status, note, artifacts, and output anywhere runs link RUN_ID --worker triage # 12-hour link to open HTML artifacts anywhere runs replay RUN_ID --worker triage # re-run a past run with its kept input ``` None of the `anywhere runs` read commands wake the worker. Once the run ends, the worker sleeps automatically until its next trigger. ## Next steps - Learn every field in [anywhere.toml reference](/docs/anywhere-toml). - Configure cron schedules, webhooks, deduplication, and replay in [Triggers](/docs/triggers). - Explore optional output conventions in [Runs & conventions](/docs/runs-and-artifacts). - Copy working templates from [Recipes & software factory](/docs/recipes). --- # Recipes & software factory Every recipe below runs on anywhere today using `anywhere.toml`, persistent disk storage, and optional run conventions. No orchestration framework is required. Installing the bundled CLI skill (`anywhere skill install`) also gives your local coding agent ready-to-adapt starter recipes. ## Daily error triage Every morning at 9:00, this worker fetches yesterday's top error groups from PostHog, updates a cached git checkout on its persistent disk, asks Claude Code to investigate root causes in read-only mode, writes a self-contained HTML report (`artifacts/index.html`) plus an optional scrubbed `artifacts/transcript.jsonl`, and keeps per-error notes under `/app/data/notes/` so tomorrow's run builds on today's findings. ```toml # triage/anywhere.toml title = "Daily error triage" build = "npm i -g @anthropic-ai/claude-code" [[trigger]] name = "triage" cron = "0 9 * * *" timezone = "America/New_York" run = "REPO=owner/repo BRANCH=main POSTHOG_PROJECT=12345 bash run.sh" timeout = 3600 [limits] cpu = 2 memory = "6 GiB" disk = "20 GiB" ``` Setup: ```sh anywhere deploy ./triage printf %s "$GITHUB_TOKEN" | anywhere secrets set --worker triage GITHUB_TOKEN printf %s "$POSTHOG_KEY" | anywhere secrets set --worker triage POSTHOG_KEY anywhere exec -t triage -- env CLAUDE_CONFIG_DIR=/app/data/claude claude auth login anywhere run triage --worker triage anywhere runs link --worker triage ``` The `run.sh` script follows **prepare -> run -> check -> note -> exit**: - Clones `$REPO` into `/app/data/repo` on run 1, and runs `git fetch && git reset --hard` on subsequent runs. - Queries PostHog before starting Claude, then `unset`s `GITHUB_TOKEN` and `POSTHOG_KEY` from Claude's environment so untrusted error text cannot exfiltrate credentials. - Optionally captures `--output-format stream-json --verbose` (scrubbed of secrets) into `$ANYWHERE_RUN_DIR/artifacts/transcript.jsonl` for auditing. - Verifies `artifacts/index.html` was produced before exiting `0`, and writes a one-line summary (`3 new errors, 4 ongoing, 2 gone`) to `$ANYWHERE_RUN_DIR/note`. ## Software factory stations An AI software factory does not require a multi-service framework. On anywhere, a software factory is **three isolated `anywhere.toml` folders**, each on its own persistent Linux disk with least-privilege secrets and a human reviewing what merges: 1. **Station 1 — Morning triage (`triage`):** `0 9 * * *` with Claude Code. Investigates production errors and failed CI, writes an HTML evidence report, and saves notes across days in `/app/data/notes/`. 2. **Station 2 — PR & issue review (`pr-review`):** Webhook `[[trigger]]` with `dedupe_header = "x-github-delivery"` triggered by GitHub pull request or Linear issue webhooks using Codex. Verifies HMAC signatures from `ANYWHERE_WEBHOOK_HEADERS`, updates the cached repo on disk, runs tests, and posts concrete findings. 3. **Station 3 — Weekly maintenance (`cleanup`):** `0 8 * * 1` with Claude Code or Codex. Checks documentation drift, outdated dependencies, and stale flags, then opens a draft PR for human merge. ```toml # pr-review/anywhere.toml title = "PR reviewer" build = "npm i -g @openai/codex" [[trigger]] name = "on-pr" webhook = true dedupe_header = "x-github-delivery" run = "bash review.sh" timeout = 1200 [limits] cpu = 2 memory = "4 GiB" disk = "20 GiB" ``` Because each station has its own gVisor sandbox, its own scoped token, and its own persistent disk, a busy PR webhook burst never blocks morning triage and a read-only reviewer never holds merge credentials. ## Webhook responder Point GitHub, Linear, Stripe, or Datadog webhooks at a secret trigger URL. Incoming payloads arrive byte for byte on `stdin` with headers in `ANYWHERE_WEBHOOK_HEADERS`, duplicate retries are absorbed by `dedupe_header`, and bursts queue serially up to 100 deep so nothing is dropped. ```toml # issue-responder/anywhere.toml title = "Issue responder" build = "npm ci && npm run build" [[trigger]] name = "on-issue" webhook = true dedupe_header = "x-github-delivery" run = "node dist/on-issue.js" timeout = 600 ``` ```ts // issue-responder/src/on-issue.ts import { createHmac, timingSafeEqual } from "node:crypto"; import { readFileSync, writeFileSync } from "node:fs"; const raw = readFileSync(0, "utf8"); const headers = JSON.parse(process.env.ANYWHERE_WEBHOOK_HEADERS ?? "{}"); const sig = headers["x-hub-signature-256"] ?? ""; const expected = "sha256=" + createHmac("sha256", process.env.WEBHOOK_SECRET ?? "") .update(raw) .digest("hex"); if ( sig.length !== expected.length || !timingSafeEqual(Buffer.from(sig), Buffer.from(expected)) ) { writeFileSync( `${process.env.ANYWHERE_RUN_DIR}/note`, "Invalid webhook signature\n", ); process.exit(1); } const payload = JSON.parse(raw); // Run your agent or script, write artifacts, and leave a one-line note. writeFileSync( `${process.env.ANYWHERE_RUN_DIR}/note`, `Handled issue #${payload.issue?.number ?? "unknown"}\n`, ); ``` Deploy, generate the webhook URL, test locally with a sample payload, and replay any past run after a fix: ```sh anywhere deploy ./issue-responder printf %s "$WEBHOOK_SECRET" | anywhere secrets set --worker issue-responder WEBHOOK_SECRET anywhere triggers url on-issue --worker issue-responder # Test locally with a sample JSON body on stdin anywhere run on-issue --worker issue-responder < sample-issue.json # Inspect or replay a past run with its kept input after deploying a fix anywhere runs input RUN_ID --headers --worker issue-responder anywhere runs replay RUN_ID --worker issue-responder ``` ## Weekly research digest Run a scheduled Python or TypeScript agent against OpenRouter or any model provider, accumulate historical snapshots in SQLite at `/app/data/history.db`, and write a clean HTML digest to `$ANYWHERE_RUN_DIR/artifacts/index.html`: ```toml # digest/anywhere.toml title = "Weekly research digest" build = "python3 -m venv /app/.venv && /app/.venv/bin/pip install -r requirements.txt" [[trigger]] name = "weekly" cron = "0 8 * * 1" timezone = "Europe/London" run = "/app/.venv/bin/python digest.py" timeout = 900 [limits] cpu = 1 memory = "2 GiB" disk = "10 GiB" ``` Because `/app/data/history.db` persists across weeks, each Monday's run diffs new findings against prior snapshots instead of starting from scratch, and sleeps at `$0` compute for the other 167 hours of the week. ## Agent with local and remote MCP servers (`mcp-agent`) An agent worker can use both local MCP servers (stdio or `127.0.0.1` HTTP on any port except `7682`) and remote HTTPS MCP servers authenticated with encrypted worker secrets: ```toml # mcp-agent/anywhere.toml title = "MCP ops analyst" build = "npm i -g @anthropic-ai/claude-code && npm ci" [[trigger]] name = "daily-check" cron = "0 10 * * 1-5" timezone = "UTC" run = "bash run.sh" timeout = 1200 [limits] cpu = 2 memory = "4 GiB" disk = "10 GiB" ``` ```json { "mcpServers": { "local-sqlite": { "command": "node", "args": ["/app/node_modules/.bin/mcp-sqlite", "/app/data/metrics.db"] }, "linear": { "type": "http", "url": "https://mcp.linear.app/mcp", "headers": { "Authorization": "Bearer ${LINEAR_API_KEY}" } } } } ``` ```sh #!/bin/sh # mcp-agent/run.sh set -eu mkdir -p "$ANYWHERE_RUN_DIR/artifacts" # Keep external MCP data isolated from shell tools and unrelated secrets: # allow only the declared MCP tools, write the raw stream outside artifacts/, # then scrub secrets and bound its size before copying into artifacts/. claude -p "$(cat prompt.md)" \ --mcp-config /app/.mcp.json \ --strict-mcp-config \ --tools "" \ --allowedTools "mcp__local-sqlite__*,mcp__linear__*" \ --permission-mode dontAsk \ --output-format stream-json --verbose \ "$ANYWHERE_RUN_DIR/claude.jsonl" python3 /app/transcript.py "$ANYWHERE_RUN_DIR/claude.jsonl" \ "$ANYWHERE_RUN_DIR/artifacts/transcript.jsonl" python3 /app/render_report.py "$ANYWHERE_RUN_DIR/claude.jsonl" \ "$ANYWHERE_RUN_DIR/artifacts/index.html" test -s "$ANYWHERE_RUN_DIR/artifacts/index.html" python3 -c 'import json, sys; print([json.loads(l) for l in sys.stdin][-1]["result"].strip().splitlines()[0][:200])' < "$ANYWHERE_RUN_DIR/claude.jsonl" > "$ANYWHERE_RUN_DIR/note" ``` Set the secrets (`anywhere secrets set --env-file .env --worker mcp-agent`), deploy, and verify with `anywhere run daily-check --worker mcp-agent`. Because nothing outside the worker can reach its local MCP servers, credentials and local databases stay walled inside the sandbox. ## Headless browser agent (`browser-agent`) Every run wakes the worker, starts headless Chromium inside the sandbox through `agent-browser`'s built-in stdio MCP server (`recipes/browser-agent/` in the Anywhere skill), carries out one browser task, saves screenshots and `report.md` into `$ANYWHERE_RUN_DIR/artifacts/` (while the harness keeps its own session history on `/app/data/`), shuts Chromium down cleanly, and lets the worker go straight back to sleep. The bundled starter uses Claude Code, and the same pattern works with any harness or script. ```toml # browser-agent/anywhere.toml title = "Claude with a headless browser" build = "bash setup.sh" [[trigger]] name = "check" cron = "0 8 * * *" run = "exec env TARGET_URL=https://example.com TASK='Summarize the page and capture a screenshot.' bash run.sh" timeout = 1800 [limits] cpu = 1 memory = "2 GiB" disk = "5 GiB" ``` Setup: ```sh anywhere deploy ./browser-agent anywhere exec -t browser-agent -- env CLAUDE_CONFIG_DIR=/app/data/claude claude auth login anywhere run check --worker browser-agent ` through `env -i` to keep worker secrets out of Chromium's environment, while Claude runs with `--tools ""` and only allowlisted `mcp__browser__*` tools (`agent_browser_eval`, `agent_browser_flow_*`, `extraArgs`, and arbitrary screenshot `path`/`screenshotDir` arguments are blocked). Both the proxy and a Chromium managed `URLBlocklist`/`URLAllowlist` policy pin navigation to `ALLOWED_DOMAINS` (defaulting to `TARGET_URL`'s host), blocking `file://`, `chrome://`, and off-domain URLs in both ephemeral and persistent-profile modes. Before keeping `report.md` or screenshots, `run.sh` screens Claude's output and report for the worker's secrets and sign-in tokens and fails closed on a hit. - **gVisor and egress flags:** the generated config sets `--disable-quic` (avoiding UDP/443 probes that DNS-only egress drops), `--disable-gpu`, nonce `contentBoundaries: true` and `maxOutput: 40000`, and `/dev/shm` scales to half the sandbox's memory limit. - **Pinned builds and persistent state:** `setup.sh` installs pinned Claude Code, `agent-browser`, Ubuntu system libraries, CJK/emoji fonts, and a SHA256-verified Chrome for Testing archive onto the persistent ZFS disk once and skips already-verified parts on later deploys. Set `PERSIST_PROFILE=1` to keep cookies and `localStorage` under `/app/data/browser-profile` (with `flock` locking and automatic stale `Singleton*` lock cleanup), and optionally `ALLOWED_DOMAINS` to pin navigation to expected hosts. Raise `[limits]` to `cpu = 2` and `memory = "4 GiB"` on Pro for heavier multi-tab SPAs. --- # anywhere.toml reference Every worker is a folder with an `anywhere.toml` at its root. No workflow SDK or Dockerfile is needed. Workers sleep automatically as soon as their last active run finishes. ## Complete example ```toml title = "Daily error triage" build = "npm i -g @anthropic-ai/claude-code" [[trigger]] name = "triage" cron = "0 9 * * *" timezone = "America/New_York" run = "bash run.sh" timeout = 1800 [[trigger]] name = "on-issue" webhook = true dedupe_header = "x-github-delivery" run = "node dist/on-issue.js" timeout = 600 [limits] cpu = 2 memory = "4 GiB" disk = "20 GiB" ``` Put top-level keys (`title`, `build`) above the first `[[trigger]]` or `[limits]` table. TOML treats keys placed below a table header as part of that table. ## Top-level keys | Key | Type | Description | | ------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------ | | `title` | string | Human-readable label shown in the portal and `anywhere workers list`. | | `build` | string | Optional shell command run on Linux in `/app` on every deploy, without secrets. Install CLIs, npm/Python packages, or `apt` packages here. | ## `[[trigger]]` Define between **1 and 16** triggers per worker using double brackets (`[[trigger]]`). A worker must define at least one trigger (`worker_triggers_missing`). Each trigger is **either** a cron trigger (`cron`, optional `timezone`) **or** a webhook trigger (`webhook = true`, optional `dedupe_header`) — never both. | Key | Required | Description | | --------------- | ------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `name` | Yes | 1 to 32 lowercase letters, digits, and `-`, starting with a letter. Unique across all triggers in the worker. | | `run` | Yes | Shell command executed with `/bin/sh -c` as root in `/app`. Webhook runs receive the raw body on `stdin` and headers in `ANYWHERE_WEBHOOK_HEADERS`. | | `timeout` | No | Maximum seconds the run may execute, from `1` to `86400`. Defaults to `1800` (30 minutes). For queued webhook runs, starts when the run leaves the queue and begins executing. | | `cron` | Cron only | Standard 5-field cron at minute resolution (`minute hour day month weekday`). No seconds, `@daily`, `L`, `W`, `#`, or `?`. Mutually exclusive with `webhook`. | | `timezone` | Cron only | Optional IANA time zone name such as `America/New_York` or `Europe/London`. Defaults to `UTC`. | | `webhook` | Webhook only | Set `webhook = true` to expose an inbound secret webhook URL via `anywhere triggers url`. Mutually exclusive with `cron`. | | `dedupe_header` | Webhook only | Optional HTTP header name matched case-insensitively (for example `"X-GitHub-Delivery"` or `"svix-id"`). An absent header returns `400 dedupe_header_missing`; duplicate values return `202` without queueing a second run. | ## `[limits]` Limits cap CPU, memory, and disk for the worker's build, runs, and `exec` commands. A run reserves the worker's memory on its host when it starts, and memory is billed on that declared size while the worker is awake; CPU is billed on what the worker uses. A run that doesn't fit on a full host waits as `queued` for memory until room frees. ```toml [limits] cpu = 2 # shared vCPUs (decimals like 0.5 are allowed) memory = "4 GiB" # whole MiB or GiB disk = "20 GiB" # whole MiB or GiB ``` - Omitted memory defaults to 2 GiB, or your plan's ceiling if that's lower. Omitted CPU and disk default to your plan's per-worker ceiling (`1 vCPU / 10 GiB` on Free; `4 vCPUs / 100 GiB` on Pro and Team). Memory may go up to `2 GiB` on Free and `8 GiB` on Pro and Team. - Requesting more than your plan allows fails with `limit_above_plan`. Requesting `[limits]` above the host's per-sandbox CPU or memory ceiling fails with `worker_limits_unavailable` (lower `[limits]` in `anywhere.toml`); if no host currently has room for a new worker, deploy fails with `host_full`. - The effective ceilings are exported inside every run and `exec` session as `ANYWHERE_MEMORY_BYTES` and `ANYWHERE_CPUS` so your code can size memory budgets and concurrency. - Set `[limits]` to what the worker actually needs so placement succeeds cleanly on hosts. - Disk limits can shrink as well as grow, as long as existing files fit. Otherwise deploy fails with `disk_limit_below_used`. ## Validation and uploads Check your `anywhere.toml` and selected files before deploying: ```sh anywhere check ./my-worker ``` Unknown keys and invalid triggers are rejected cleanly at validation and deploy time (`worker_toml_invalid`, `worker_triggers_missing`, or `worker_trigger_invalid`) with a direct fix. Uploads automatically exclude `.git`, `.env`, `.env.*`, and anything matched by `.gitignore`. Keep local `node_modules/`, `.venv/`, and live databases out of uploads so deploys never overwrite remote state in `/app/data/`. Upload limits are 50,000 files, 1 GiB total, and 30 MiB per file. --- # Triggers A worker wakes on any `[[trigger]]` defined in `anywhere.toml` — either a cron schedule or an inbound HTTP webhook — as well as manual `anywhere run` commands and run replays. A worker can define between 1 and 16 `[[trigger]]` blocks. Different triggers on the same worker can overlap (up to 16 concurrent runs per worker), while each individual trigger enforces safe single-file ordering. ## Cron triggers Add a `[[trigger]]` with a `cron` expression to `anywhere.toml`: ```toml [[trigger]] name = "morning-triage" cron = "0 9 * * 1-5" timezone = "America/New_York" run = "bash run.sh" timeout = 1800 ``` - **Any-minute resolution:** Standard 5-field cron supporting numbers, `*`, ranges (`1-5`), steps (`*/15`), lists (`1,15`), and names (`MON`, `JAN`). There is no 1-hour minimum interval. - **Daylight saving time:** On spring-forward gaps, a fixed time inside the skipped hour runs once immediately after the gap. On fall-back repeats, it runs once. - **Spread starts:** A cron run becomes eligible to start at its scheduled time plus its trigger's offset, a fixed 0 to 20 seconds that stays the same for that trigger every time, so workers scheduled on the same minute don't all start together. Webhook runs, `anywhere run` and replays become eligible as soon as they're made. When a run really starts varies with load, such as waking its worker and memory on its host; no start time is promised. Each cron run gets its scheduled time in `ANYWHERE_RUN_SCHEDULED_AT` (RFC 3339 UTC), so a run that starts late can still work on the period it was meant for. - **No overlapping runs:** If a cron trigger's previous run is still active when the next tick arrives, the new tick fails with `trigger_still_running` rather than piling up duplicate work. - **Skipped, never silently dropped:** A cron run that hasn't started by its trigger's next scheduled time, for example because it's still waiting for memory on a full host, ends `not_started` with `run_skipped`, and the next run takes its place. Two runs of one trigger never wait in line together. - **No missed-tick storms:** After an outage, the newest scheduled time that has come gets its run, late, and one `not_started` record with `run_missed` counts the times before it. - **Paused workers:** A paused worker skips scheduled ticks cleanly and resumes on `anywhere workers resume NAME`. ## Webhook triggers Add a `[[trigger]]` with `webhook = true` to `anywhere.toml` and deploy: ```toml [[trigger]] name = "on-issue" webhook = true dedupe_header = "x-github-delivery" run = "node dist/on-issue.js" timeout = 600 ``` Inspect triggers and generate a webhook trigger's secret URL (printed once): ```sh anywhere triggers --worker issue-responder anywhere triggers url on-issue --worker issue-responder ``` Calling `anywhere triggers url` again rotates the URL and immediately invalidates the previous one (`404 webhook_not_found`). Only the SHA-256 hash of the token is stored by the platform, and request logs redact the token path. ### Request handling and payloads Send any HTTP `POST` to the trigger's URL (`POST /v1/webhooks/`): - **Durably saved before 202:** The control plane persists the run, headers, and body to Postgres before answering `202 Accepted` with `{"run": "", "duplicate": false}`. - **Body on stdin:** Up to **1 MiB**, piped byte for byte to your command's standard input. Payloads over 1 MiB return `413 input_too_large`. - **Headers in env:** Request headers (up to 16 KiB encoded as JSON with lower-case header names) are passed in `ANYWHERE_WEBHOOK_HEADERS`. Larger header sets return `431 webhook_headers_too_large`. - **Verify signatures in your code:** The platform does not hardcode provider signature schemes. Verify GitHub (`x-hub-signature-256`), Stripe (`stripe-signature`), or Linear HMAC headers directly in your command against your stored webhook secret. ### Native deduplication (`dedupe_header`) Webhook senders routinely retry deliveries on slow responses or transient network drops. Set `dedupe_header` on a webhook `[[trigger]]` to a delivery ID header name such as `X-GitHub-Delivery` or `svix-id` (matched case-insensitively): - If a request arrives without that header, the endpoint returns `400 dedupe_header_missing`. - If a request carries a delivery ID already accepted for that trigger, anywhere returns `202 Accepted` with `{"run": "", "duplicate": true}` without queueing a second run. - A delivery ID is remembered as long as its run's input is kept: a worker keeps the inputs of its newest 50 ended runs that have one, so a repeat that arrives after 50 newer runs starts a new run. ### Serial webhook queueing Each webhook trigger executes **one run at a time, in arrival order**, so agents never stomp on each other's files during a burst: - If a webhook arrives while the trigger already has a run active, it is saved as `queued`, still answered `202` with its run ID, and starts automatically as soon as the run ahead of it finishes. - Up to **100 queued runs** wait per webhook trigger. Past 100, the endpoint returns `429 webhook_queue_full` (retryable) without saving a run. - Each queued run's `timeout` clock begins only when it leaves the queue and starts executing, not while waiting. - Running `anywhere sleep WORKER`, pausing, deleting, or deploying an `anywhere.toml` that removes the trigger cancels its queued runs. ## Manual runs, local testing & replays Trigger any cron or webhook trigger on demand with `anywhere run`: ```sh anywhere run morning-triage --worker triage ``` Test a webhook trigger without waiting for an external sender by piping a sample payload into `stdin`: ```sh anywhere run on-issue --worker issue-responder < sample-issue.json ``` Pass `< /dev/null` when running a webhook trigger with an empty body. To re-run a past webhook or manual run using its kept input body and headers — for example after fixing a bug and redeploying — use `anywhere runs replay` (or press **Replay** on the run's page in the portal): ```sh anywhere runs replay RUN_ID --worker issue-responder ``` Replays always use the trigger's current `run` command and `timeout`, and bypass `dedupe_header` so you can re-verify the same delivery safely. ## Automatic sleep Workers sleep automatically as soon as their last active run ends. Sleep stops all processes inside the sandbox while keeping the persistent disk intact (`/app`, `/app/data/`, `/tmp`, and installed packages). While asleep, CPU and memory billing drops to `$0`; only persistent disk is billed. To end active and queued runs as `cancelled` and sleep a worker immediately: ```sh anywhere sleep triage ``` --- # Runs & conventions Anywhere is unopinionated by default: bring Claude Code, Codex, OpenCode, a custom Python/TypeScript/Go/Rust agent, or a plain shell script. Any command that exits works out of the box with no workflow SDK. When you want richer portal summaries, rendered HTML reports, kept transcripts, or explicit completion for a long-lived process, opt into any of the small file and HTTP conventions below. Every run's outcome, kept input, output, note, and artifacts are stored for the worker's **newest 50 runs** so you and your agents can inspect and pull runs without waking the worker, and replay past runs on demand. ## What a run receives | Input / variable | Description | | --------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `stdin` | For webhook triggers and `anywhere run < payload.json`, the raw request body (up to 1 MiB) piped byte for byte. Empty on cron runs. | | `ANYWHERE_WEBHOOK_HEADERS` | Present on webhook runs and replays with headers: request headers encoded as a JSON object with lower-case keys (up to 16 KiB). | | `ANYWHERE_RUN_ID` | The run's UUID. | | `ANYWHERE_RUN_DIR` | Dedicated folder at `/var/lib/anywhere/runs/`, pre-created with an empty `artifacts/` subfolder. The newest 50 run folders also remain on the worker's disk. | | `ANYWHERE_RUN_URL` | Direct URL to this run's page in the portal (for Slack or issue links; access requires workspace sign-in). | | `ANYWHERE_RUN_SCHEDULED_AT` | Cron runs only: the time the cron named, in RFC 3339 UTC (`2026-11-19T08:00:00Z`). Optional to read; a run that starts late can still work on the period it was meant for. | | `ANYWHERE_MEMORY_BYTES` | The worker's effective memory ceiling in bytes, useful for sizing heap limits or concurrency pools. | | `ANYWHERE_CPUS` | The worker's effective CPU ceiling (for example `2` or `0.5`), useful for sizing parallelism. | ## Optional conventions Use none, one, or all of these — nothing in `anywhere.toml` needs to be enabled: | Convention | Purpose | | ---------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Normal exit code | Exit `0` for `succeeded`, non-zero for `failed`. Works for any CLI or script with zero platform code. | | `$ANYWHERE_RUN_DIR/note` | One-line summary (first line, up to 200 bytes) shown beside the run in the portal and in `anywhere runs`. | | `$ANYWHERE_RUN_DIR/artifacts/` & `index.html` | Up to 10 MiB / 200 regular files uploaded at run end. `index.html` opens as the run's front page on a sandboxed, cookieless host without waking the worker. | | `$ANYWHERE_RUN_DIR/artifacts/transcript.jsonl` | Optional harness-written event or conversation log (scrubbed of secrets before writing). Anywhere is harness-agnostic and stores it as an ordinary text artifact, with no schema lock-in. | | `POST http://127.0.0.1:7682/_anywhere/done` | Signals completion from inside the sandbox if your harness or background process does not exit on its own. | ## How a run ends A run normally ends when its command exits. It is marked **`succeeded`** only when it ends as `exited` or `done` with exit code `0`. Every other ending is **`failed`**. | Ending | Meaning | | ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `exited` | Command exited on its own with its exit code. | | `done` | Code inside the sandbox called `/_anywhere/done` with `exit_code` (0 if omitted). | | `timed_out` | Run exceeded `timeout`; process group received `SIGTERM`, then `SIGKILL` 10 seconds later. | | `cancelled` | Ended by `anywhere sleep WORKER`, or a queued webhook run cancelled before starting. | | `sandbox_stopped` | A deploy, secret apply, pause, crash, or out-of-memory kill stopped the sandbox mid-run. | | `lost` | No ending arrived within `timeout + 2 minutes`. Never shown as a success. | | `not_started` | Host refused or could not start the run (for example `worker_busy` during a deploy), or a cron run was skipped (`run_skipped`, `run_missed`); the run's error says which. | ### Ending a harness that stays open (`/_anywhere/done`) If your run launches a background server or harness that never exits on its own, signal completion over loopback from inside the sandbox (no token required): ```sh curl -fsS -X POST http://127.0.0.1:7682/_anywhere/done curl -fsS -X POST -d '{"exit_code":1}' "http://127.0.0.1:7682/_anywhere/done/$ANYWHERE_RUN_ID" ``` Always prefer the second form with `$ANYWHERE_RUN_ID` whenever multiple triggers can overlap on the same worker: omitting the run ID while more than one run is active returns `409 run_ambiguous`. The helper answers `204` and stops the run's process group. ## Notes, artifacts, reports & transcripts Write files anywhere inside `$ANYWHERE_RUN_DIR`: - **Summary note (`$ANYWHERE_RUN_DIR/note`):** First line, up to 200 bytes (for example `3 new errors, 4 ongoing, 2 gone`). Shown right beside the run in the portal and in `anywhere runs`. Write what happened on success, and the fix on failure. - **Artifacts (`$ANYWHERE_RUN_DIR/artifacts/`):** Every regular file under `artifacts/`, up to **10 MiB** total and **200 files** (no symlinks, FIFOs, or paths over 255 bytes). - `artifacts/index.html` is the run's front page. - `.html` and image files open as real web pages from a separate, cookieless, sandboxed pages host via 12-hour per-person links, without waking the worker. - `.md`, `.txt`, `.json`, `.jsonl`, `.csv`, and source files render inline in the portal as escaped text. - Other files download directly. - **Optional transcripts (`$ANYWHERE_RUN_DIR/artifacts/transcript.jsonl`):** If you want a full step-by-step audit trail of an agent run, have your wrapper script write the harness's JSON-lines stream (for example Claude Code `--output-format stream-json --verbose` or Codex `--json`) to `artifacts/transcript.jsonl` after scrubbing any secrets. Because the platform never couples to a harness format, it stores and displays `transcript.jsonl` as an ordinary artifact you can inspect in the portal or download with `anywhere runs pull`. - **Kept output:** The run's first 64 KiB and newest 1 MiB of stdout/stderr are stored automatically. Write HTML reports self-contained with inline CSS (the sandboxed pages host blocks external origins and carries no cookies). When an agent processes untrusted external text (errors, issues, webhooks), have the agent output structured data and render the HTML from escaped templates without inline `