code

A command that opens a browser-based VS Code editor for a synced checkout running on a supported Linux lease. It connects through the coordinator and an SSH tunnel, so the runner itself is not exposed directly.

In plain words
What is it for?
Use it to prepare a lease with code-server, connect to a named lease, and optionally open the browser editor. It supports coordinator-backed Linux leases on Hetzner, AWS, and Azure.
Why use it?
It provides browser editing for a remote development workspace without requiring a directly reachable SSH or editor server. It only works when the required coordinator login, secure origin setup, code-enabled lease, and supported provider are available.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/openclaw/crabbox/code
Clone the repo
git clone --depth 1 https://github.com/openclaw/crabbox
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,244 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.01244
Opus 5 $0.00000 $0.00622
Sonnet 5 $0.00000 $0.00249
Haiku 4.5 $0.00000 $0.00124

Measured yesterday against content hash 970c26daad71, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

code scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl https://broker.example.com/portal/leases/<lease-id>/code/health
docs/commands/code.md · 137 lines

How it starts

The opening of the file, as written. The whole thing — 137 lines — stays where its author put it; the contents beside it link to each section on GitHub.

code

crabbox code bridges a Linux lease's code-server workspace into the authenticated coordinator portal, so you can edit the synced checkout in a browser VS Code without exposing the runner directly.

crabbox warmup --code
crabbox code --id swift-crab
crabbox code --id swift-crab --open

Prerequisites

  • A configured coordinator login. The command refuses to run without one: crabbox login --url broker.example.com first.
  • A valid coordinator CRABBOX_CODE_ORIGIN_TEMPLATE backed by wildcard TLS and WebSocket ingress. Browser Code fails closed when the template is absent or invalid.
  • A lease created with the code capability (crabbox warmup --code). The Linux bootstrap installs code-server only for leases that request it, and reusing a lease checks for the matching code=true label.
  • A coordinator-backed Linux lease on a provider that advertises the code capability (hetzner, aws, azure). Static SSH hosts, Blacksmith Testbox, Windows, and macOS leases are rejected.

How it works

crabbox code resolves the lease, ensures code-server is running on the runner's loopback interface (127.0.0.1:8080), opens an SSH tunnel to it, mints a short-lived bridge ticket from the coordinator, and registers a local bridge process. Keep the process running while you use the editor.

The data path is:

browser
  <-> coordinator /portal/leases/<lease-id>/code/
  <-> local crabbox code process (bridge)
  <-> SSH tunnel
  <-> runner 127.0.0.1:8080 (code-server)

The coordinator authenticates the browser through portal auth and authenticates the local bridge with a one-use, short-lived ticket. The CLI sends the ticket as an X-Crabbox-Bridge-Ticket WebSocket upgrade header so it stays out of WebSocket URLs while leaving ordinary coordinator authentication intact. A bearer-header retry supports older coordinators. Current coordinators reject bridge tickets in URL query strings by default, so older CLIs that still send query-ticket bridges must be upgraded before they can connect. Operators who need a temporary legacy rollout window can set CRABBOX_ALLOW_QUERY_BRIDGE_TICKETS=1; remove that setting after affected clients upgrade. Because the trusted boundary is the portal plus the bridge ticket, code-server runs with auth disabled on the runner side.

Read the full file on GitHub · 137 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 137 lines · 0 tokens per session scan A 970c26daad71

Subscribe to this mod's changes

code is a command published in the GitHub repository openclaw/crabbox (1,343 stars, last pushed yesterday), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,244 tokens. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other commands, from other repositories