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 byloadSettings(), written by saveSettings(), and surfaced (token-redacted) by GET /api/settings.
- Path:
resolveSettingsPath()→<resolveClawbooDir()>/settings.json→~/.clawboo/settings.jsonby default. - Created: lazily on the first
saveSettings()call (the directory ismkdir -p’d first). Missing or unparseable file → defaults. - In-memory shape (
ClawbooSettings):
- On-disk shape: the gateway URL/token are nested under a
gatewayobject;studioAccessTokenandfirstRunDismissedAtare 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:
- If
gateway.tokenis a template token like${GATEWAY_AUTH_TOKEN}, it is resolved fromprocess.envfirst, then from<resolveStateDir()>/.env. - If no usable token results,
loadSettings()falls back to OpenClaw’sopenclaw.json(gateway.auth.token+gateway.port), resolving the same template syntax and synthesizingws://localhost:<port>. - Otherwise the literal value is used;
gatewayUrlfalls back tows://localhost:18789.
.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 readCLAWBOO_DB_PATH; it followsCLAWBOO_HOME. Server code reaches the database throughgetDb(), 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). HonorsCLAWBOO_DB_PATHwhen 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 (returnsnull, never plaintext).
- Directory:
<resolveClawbooDir()>/secrets/, created with mode0700(best effort; advisory on Windows). - Master key:
secrets/master.key(32 bytes, base64-encoded, mode0600). Auto-generated on first use if absent. - Vault:
secrets/runtime-keys.json, mode0600, 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:
process.env[envVar]- the encrypted vault (
secrets/runtime-keys.json) - 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
- Environment variables, every
CLAWBOO_*/OPENCLAW_*override. - Settings API,
GET/POST /api/settingsshapes. - Data and state, backup, reset, and file-location operations.
- Security, the access gate, device auth, and the redaction model.
- Deployment, ports, fallback, and the bundled server.