Skip to main content
Clawboo’s persistent configuration is a single JSON file (settings.json) plus a small set of files Clawboo owns under its own state directory. This page documents the on-disk shapes, the path-resolution rules, and the OpenClaw files Clawboo reads (but does not treat as its own state). For the environment variables that override these locations, see Environment variables.

At a glance

Clawboo writes only under its own state directory (~/.clawboo by default). The exception is OpenClaw onboarding: when a user configures the OpenClaw runtime through the wizard, Clawboo writes openclaw.json and .env into OpenClaw’s state directory on the user’s behalf. Outside that flow, OpenClaw’s directory is read-only interop.

settings.json

The persisted settings file. Read by loadSettings(), written by saveSettings(), and surfaced (token-redacted) by GET /api/settings.
  • Path: resolveSettingsPath()<resolveClawbooDir()>/settings.json~/.clawboo/settings.json by default.
  • Created: lazily on the first saveSettings() call (the directory is mkdir -p’d first). Missing or unparseable file → defaults.
  • In-memory shape (ClawbooSettings):
  • On-disk shape: the gateway URL/token are nested under a gateway object; studioAccessToken and firstRunDismissedAt are top-level. saveSettings() only writes the fields the caller explicitly provides; omitted fields are left untouched.

Field reference

Token resolution chain

gatewayToken is resolved at read time, not stored verbatim in every case:
  1. If gateway.token is a template token like ${GATEWAY_AUTH_TOKEN}, it is resolved from process.env first, then from <resolveStateDir()>/.env.
  2. If no usable token results, loadSettings() falls back to OpenClaw’s openclaw.json (gateway.auth.token + gateway.port), resolving the same template syntax and synthesizing ws://localhost:<port>.
  3. Otherwise the literal value is used; gatewayUrl falls back to ws://localhost:18789.
This bridges OpenClaw’s secret management (its .env) with Clawboo’s proxy auth; it is not a dev-project .env pattern.

State directory (~/.clawboo)

Resolved by resolveClawbooDir(). The override CLAWBOO_HOME is ~-expanded and resolved to an absolute path; otherwise the directory is <homedir>/.clawboo. Clawboo owns everything under this directory. The OpenClaw runtime dependency is unchanged; only the file home is Clawboo’s own (matching how Codex and Claude Code each own their dir).

The two DB-path resolvers

There are two distinct resolvers for the SQLite path, and they differ:
  • getDbPath() (apps/web/server/lib/db.ts): used by the Express server and the worktree/board code. Returns <resolveClawbooDir()>/clawboo.db~/.clawboo/clawboo.db. It does not read CLAWBOO_DB_PATH; it follows CLAWBOO_HOME. Server code reaches the database through getDb(), a process-wide memo keyed on this path, rather than opening it per request.
  • defaultDbPath() (@clawboo/db): used by out-of-process consumers (the MCP stdio bins spawned by external runtimes). Honors CLAWBOO_DB_PATH when set, otherwise returns the legacy ~/.openclaw/clawboo/clawboo.db. Each bin opens one connection for its own process lifetime.
The MCP stdio bins must open the same SQLite file the server serves. When CLAWBOO_HOME is set to a non-default location (e.g. a sandbox), set CLAWBOO_DB_PATH to that same clawboo.db so the bins and the server agree. The multi-process WAL recipe is what makes a shared file safe.

Secrets vault

Encrypts each runtime provider key at rest with AES-256-GCM under a local master key. This is defense in depth: it protects against casual inspection and a leaked disk or backup, and a wrong, rotated, or lost key fails closed (returns null, never plaintext).
  • Directory: <resolveClawbooDir()>/secrets/, created with mode 0700 (best effort; advisory on Windows).
  • Master key: secrets/master.key (32 bytes, base64-encoded, mode 0600). Auto-generated on first use if absent.
  • Vault: secrets/runtime-keys.json, mode 0600, keyed by env-var name:

Master key

Runtime-key resolution chain

resolveRuntimeKey(envVar) is the one place a secret value is read (callers put it straight into a spawned child’s environment, never a log, response, audit, or SQLite). Highest priority first:
  1. process.env[envVar]
  2. the encrypted vault (secrets/runtime-keys.json)
  3. OpenClaw’s <resolveStateDir()>/.env (so an existing OpenClaw provider key, e.g. ANTHROPIC_API_KEY, is reused automatically)

OpenClaw interop reads (~/.openclaw)

OpenClaw’s state directory is located by resolveStateDir(). It honors OPENCLAW_STATE_DIR (and the legacy MOLTBOT_STATE_DIR / CLAWDBOT_STATE_DIR); otherwise it returns the first existing of ~/.openclaw, ~/.clawdbot, ~/.moltbot, defaulting to ~/.openclaw. Clawboo reads these OpenClaw files:
OPENCLAW_CONFIG_PATH appears in design-intent notes but is not read by current code; the config path is always derived as <resolveStateDir()>/openclaw.json.

See also

Last modified on August 7, 2026