Skip to main content
Exhaustive list of every environment variable the NanoClaw host, setup wizard, and agent runner read. For how to actually set these — .env editing, service definitions, restart commands — see Configuration. Channel adapters (Telegram bot tokens, Slack app credentials, and so on) have their own variables documented on the per-channel pages under Channels; they’re not repeated here.

Read from .env

NanoClaw’s own parser (src/env.ts) reads exactly these keys from .env at the project root. Values are never loaded into process.env, so they don’t leak to child processes. For the first eleven, a value already in the process environment takes precedence over .env; ANTHROPIC_BASE_URL is read from .env only.

Host process environment only

Read from process.env at host startup, with no .env fallback. Putting these in .env has no effect — the generated launchd plist, systemd unit, and nohup wrapper don’t source it. Set them in the service definition or export them before pnpm run dev.
CONTAINER_TIMEOUT, IDLE_TIMEOUT, MAX_CONCURRENT_CONTAINERS, CONTAINER_MAX_OUTPUT_SIZE, and MAX_MESSAGES_PER_PROMPT were removed from the code and are no longer read anywhere (host or container). Container idle/stuck detection is now handled by the periodic host-sweep loop (src/host-sweep.ts), not a per-container timeout env var. Setting any of these five in .env or the process environment has no effect.

Setup-time variables

Consumed by the setup wizard (pnpm run setup:auto) and migration scripts, not by the running host. Most pre-answer an interactive prompt for scripted or CI runs; each also has a matching CLI flag (e.g. NANOCLAW_SKIP--skip).
NANOCLAW_REEXEC_SG and NANOCLAW_BOOTSTRAPPED also appear in setup/auto.ts — they’re internal sentinels setup sets on itself when re-executing (Linux sg docker re-exec, bootstrap guard). Don’t set them yourself.

Container-side variables (agent runner)

Read inside the agent container by the agent runner. The host injects only TZ (plus provider-contributed and OneCLI proxy variables) at spawn — src/container-runner.ts:443. The rest are not passed through from the host environment; overriding them means baking them into a custom image or a provider container config. Line numbers reference nanocoai/nanoclaw at v2.1.38 (b6cb53e) and will drift with future releases.
Last modified on July 18, 2026