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 five, a value already in the process environment takes precedence over .env; ANTHROPIC_BASE_URL is read from .env only.
VariableDefaultRead inEffect
ASSISTANT_NAMEAndysrc/config.ts:11Assistant name. Also sets the default trigger, @<name>.
ASSISTANT_HAS_OWN_NUMBERfalsesrc/config.ts:13Set true when the assistant runs on its own WhatsApp number instead of yours.
ONECLI_URLsrc/config.ts:36URL of the OneCLI Agent Vault.
ONECLI_API_KEYsrc/config.ts:37API key for the vault. See Credentials.
TZsystem timezone, else UTCsrc/config.ts:62IANA timezone for scheduled tasks and timestamps. Invalid values are skipped, not errored. Injected into every agent container at spawn.
ANTHROPIC_BASE_URLsrc/providers/claude.ts:21Custom Anthropic-compatible endpoint, passed into agent containers with a placeholder auth token. Only active when setup has registered the custom-endpoint provider config; the real token stays in the vault.

Host process environment only

Read from process.env at host startup. 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.
VariableDefaultRead inEffect
CONTAINER_TIMEOUT1800000 (30 min)src/config.ts:34Max runtime for an agent container, in milliseconds.
CONTAINER_MAX_OUTPUT_SIZE10485760 (10 MB)src/config.ts:35Max output captured from a container, in bytes.
MAX_MESSAGES_PER_PROMPT10src/config.ts:38How many queued messages are batched into one agent prompt. Per-group override exists in container config.
IDLE_TIMEOUT1800000 (30 min)src/config.ts:39How long a container stays alive after its last result, waiting for follow-ups.
MAX_CONCURRENT_CONTAINERS5src/config.ts:40Intended cap on simultaneous agent containers. Parsed but not enforced anywhere as of v2.1.4 — setting it has no effect.
CONTAINER_IMAGEper-install tagsrc/config.ts:29Full agent image override (name and tag).
CONTAINER_IMAGE_BASEper-install namesrc/config.ts:28Base image name override. The default embeds an install slug so two checkouts on one host don’t clobber each other’s image.
WEBHOOK_PORT3000src/webhook-server.ts:82Port for the local webhook server.
LOG_LEVELinfosrc/log.ts:16One of debug, info, warn, error, fatal.
NANOCLAW_EGRESS_LOCKDOWNfalsesrc/egress-lockdown.ts:20Set true to force all agent traffic through the OneCLI gateway on an internal Docker network. Spawns fail fast if the gateway isn’t running. See Hardening.
NANOCLAW_EGRESS_NETWORKnanoclaw-egresssrc/egress-lockdown.ts:16Name of the locked-down Docker network.
ONECLI_GATEWAY_CONTAINERoneclisrc/egress-lockdown.ts:18Name of the gateway container attached as the only egress hop.

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).
VariableDefaultRead inEffect
NANOCLAW_SKIPsetup/auto.ts:118Comma-separated step names to skip: environment, container, onecli, auth, mounts, service, cli-agent, timezone, channel, verify, first-chat.
NANOCLAW_DISPLAY_NAME$USERsetup/auto.ts:320How agents address the operator — skips the prompt.
NANOCLAW_AGENT_NAMEsetup/channels/*.tsPre-fills the agent name prompt in each channel setup flow. The CLI scratch agent is always “Terminal Agent”.
NANOCLAW_CHANNELSsetup/migrate-v2/select-channels.ts:43Comma-separated channel names (e.g. telegram,discord) — skips the channel picker in the v2 migration flow.
NANOCLAW_V1_PATHsibling-directory scanmigrate-v2.sh:196Explicit override for v1 install discovery in the migration flow. Validated against $NANOCLAW_V1_PATH/store/messages.db — the script fails with a message telling you to set it when auto-discovery misses.
INSTALL_CJK_FONTSfalsesetup/container.ts:181Set true to bake CJK fonts (~200 MB) into the agent image. Read from .env by regex during the container build step and passed as a Docker --build-arg — the only build-arg passed through today. Set it in .env, not the service environment.
NANOCLAW_ONECLI_API_HOSThttps://api.onecli.shsetup/auto.ts:188Use a remote OneCLI vault instead of installing one locally.
NANOCLAW_ONECLI_API_TOKENsetup/onecli.ts:324Bearer token (oc_…) for the remote vault. Required when the host is set.
NANOCLAW_ANTHROPIC_BASE_URLsetup/auto.ts:717Custom Anthropic-compatible endpoint. Setup writes ANTHROPIC_BASE_URL to .env and stores the token in the vault.
NANOCLAW_ANTHROPIC_AUTH_TOKENsetup/auto.ts:718Bearer token for the custom endpoint. Both URL and token must be set together.
NANOCLAW_SETUP_ASSIST_MODEfalsesetup/lib/setup-config.ts:128Use non-interactive Claude assist on step failure instead of interactive handoff.
NANOCLAW_SKIP_CLAUDE_ASSISTsetup/lib/claude-assist.ts:96Set 1 to disable Claude-assisted failure recovery entirely (CI/scripted runs).
NANOCLAW_NO_DIAGNOSTICSsetup/lib/diagnostics.ts:45Set 1 to disable setup diagnostics reporting.
SIGNAL_CLI_PATHsignal-cli (on PATH)setup/signal-auth.ts:45Path to the signal-cli binary for the Signal channel flow.
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:413. The rest are not passed through from the host environment; overriding them means baking them into a custom image or a provider container config.
VariableDefaultRead inEffect
TZinjected from host TIMEZONEagent-runner/src/timezone.ts:52Timezone for timestamps and scheduling inside the container.
NANOCLAW_CONVERSATIONS_DIR/workspace/agent/conversationsagent-runner/src/providers/claude.ts:224Where pre-compaction conversation transcripts are archived as Markdown.
CLAUDE_TRANSCRIPT_ROTATE_BYTES12582912 (12 MiB)agent-runner/src/providers/claude.ts:252Transcript size past which the session is rotated instead of resumed — cold resumes of huge transcripts would outlive the idle ceiling.
CLAUDE_TRANSCRIPT_ROTATE_AGE_DAYS14agent-runner/src/providers/claude.ts:260Age trigger for transcript rotation, measured from the first entry. Zero or negative disables the age check; size alone governs.
CLAUDE_CONFIG_DIR~/.claudeagent-runner/src/providers/claude.ts:269Base directory the runner scans for Claude Code project transcripts.
CLAUDE_CODE_AUTO_COMPACT_WINDOW165000agent-runner/src/providers/claude.ts:322Token window at which Claude Code auto-compacts context. Raise for 1M-context model variants.
Line numbers reference nanocoai/nanoclaw at v2.1.4 and will drift with future releases.
Last modified on June 10, 2026