.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) returns only the keys requested by each caller from .env at the project root. The parser itself does not load values into process.env. For the core settings below, the process environment takes precedence over .env unless noted. ANTHROPIC_BASE_URL is read by the installed gateway, process environment first, then .env. The shared parser strips matching outer single or double quotes, ignores blank values, and does not execute shell expressions. These parsing rules apply to callers of readEnvFile/envValue; some setup steps retain their own readers.
Host process environment only
Read fromprocess.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. The sweep’s two kill timers are tuned install-wide with NANOCLAW_ABSOLUTE_CEILING_MS and NANOCLAW_CLAIM_STUCK_MS instead.Outbound proxy
If the host reaches the internet through an HTTP or HTTPS proxy, set these in the shell that runs the service setup step, or in.env. The setup step reads them and writes them into the service definition, so the running host picks them up. Changing them later means re-running the service step.
Only
http:// and https:// proxy URLs are used; others are ignored. Setup turns on NODE_USE_ENV_PROXY for the service, which needs Node 22.21+, 24.5+ or 25+. On other Node versions the host goes direct and setup warns.
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 runtime, routing, and provider/gateway variables at spawn; these are not a blanket passthrough of the host environment. 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 f2224a2f (main after v2026.10.0) and will drift with future releases.