ClosedLoop.ai
Resources

Environment variables reference

Every environment variable read by the desktop client and the Claude Code plugins.

This page lists every environment variable the desktop client and the plugins read, grouped by component.

Desktop client — API keys

VariablePurpose
CLOSEDLOOP_API_KEYPrimary API key. Takes precedence over stored safeStorage key.
SYMPHONY_API_KEYLegacy fallback key if the above is unset and no stored key exists.

Desktop client — gateway auth (dev only)

Guarded by !app.isPackaged. These are unsafe in packaged builds and are enforced as dev-only.

VariablePurpose
CL_LOCAL_GATEWAY_DEBUG_AUTH=1Enable the "Mint Debug Token" UI button.
CL_LOCAL_GATEWAY_NO_AUTH=1Bypass all gateway auth. Dangerous.
CL_LOCAL_GATEWAY_PROD_ORIGINS_ONLY=1Strict origin whitelist, used when dev is pointed at a production relay.

Desktop client — origins

VariableDefaultPurpose
CL_RELAY_ORIGINhttps://relay.closedloop.aiCloud relay origin.
CL_WEB_APP_ORIGINhttps://app.closedloop.aiWeb app origin.
CL_AUTH_API_ORIGINhttps://api.closedloop.aiREST API origin.
CL_POSTHOG_HOSThttps://us.i.posthog.comPostHog host.
CL_POSTHOG_API_KEYunsetPostHog API key. Unset disables PostHog.

Desktop client — symphony and worktree

VariablePurpose
SYMPHONY_GATEWAY_FALLBACK_ORIGINFallback proxy origin for unimplemented routes.
SYMPHONY_WORKTREE_PARENT_DIROverride worktree parent (default: sibling of repo).
CLOSEDLOOP_SYMPHONY_TEST_RAW_CLAUDE_PIPELINE=1Bypass normal Symphony pipeline, run raw Claude.
CL_PLUGIN_VERSIONOverride code@closedloop-ai plugin version (semver, max 64 chars).

Desktop client — tailer and watcher tuning

VariablePurpose
CLOSEDLOOP_TAILER_POLL_MSOutput tailer poll interval.
CLOSEDLOOP_TAILER_THROTTLE_MSTailer event throttle.
CLOSEDLOOP_WATCHER_POLL_MSBoot-recovery live-loop PID watcher interval (default 3000 ms).

Desktop client — passed to children (informational)

VariablePurpose
CLOSEDLOOP_WORKDIRWorking directory for run artifacts.
HOME, USER, SHELL, TERM, NODE_ENVInherited into deploy children for shell sanity.

Plugins — session environment

Written to {WORKDIR}/.closedloop-ai/config.env by setup-closedloop.sh, injected via subagent-start-hook.sh.

VariablePurpose
CLOSEDLOOP_WORKDIRAbsolute path to the work directory.
CLAUDE_PLUGIN_ROOTAbsolute path to the plugin install dir.
CLOSEDLOOP_PRD_FILEPRD file path (auto-detected).
CLOSEDLOOP_PLAN_FILEPre-supplied plan file path.
CLOSEDLOOP_MAX_ITERATIONSLoop iteration cap (default 10).
CLOSEDLOOP_AGENT_IDCurrent agent's unique ID.
CLOSEDLOOP_PROMPT_FILEOrchestrator prompt file (default prompt.md).
CLOSEDLOOP_RUN_IDYYYYMMDD-HHMMSS-<hex>.
CLOSEDLOOP_ITERATIONCurrent iteration number.
CLOSEDLOOP_ACTIVE_GOALCurrent goal (default reduce-failures).
CLOSEDLOOP_REPO_MAPMulti-repo mapping.
CLOSEDLOOP_ADD_DIRSAdditional directories.
CLOSEDLOOP_ADD_DIR_NAMESNames for add dirs.

Plugins — other

VariablePurpose
CLAUDE_BINClaude executable path (set by closedloop-electron desktop).
CLAUDE_ORG_IDOrganization ID for /push-learnings and /pull-learnings.
CLAUDE_WORKSPACE_REPOSPeer repo discovery.
CLOSEDLOOP_API_KEYUsed by upload-artifact script mode.
NEXT_PUBLIC_MCP_SERVER_URLMCP server URL for upload-artifact.
ANTHROPIC_API_KEYFor count_tokens.py.
GOAL_EVALUATOR_SCRIPTCustom goal evaluator script.
POST_LOOP_REVIEW_CYCLESDefault 2 cycles of post-loop review.

CI secrets

VariablePurpose
SLACK_GITHUB_REPO_WEBHOOK_URLRelease notifications.
GITHUB_TOKENAutomatic in CI; needs contents: write.

On this page