Environment variables

What sc reads to find its files, vault and editor, and what it sets in every session it launches. A value you set before running sc usually wins.

Set a variable before sc to change one run, or export it from your shell profile to change every run.

export SUPERCLAUDE_EDITOR="nvim"
CLAUDE_CODE_ENABLE_FUNCTION_HOOKS=0 sc <project> <agent>

Variables sc reads#

VariableDefaultWhat it does
SUPERCLAUDE_HOME$HOME/.superclaudeThe profiles home: config.toml, the vendored plugins, the shared prompt library and the system/ workspace.
SUPERCLAUDE_VAULTfrom config.tomlThe active vault, as a path. It outranks the default key in config.toml. An explicit -v <vault> outranks it.
SUPERCLAUDE_EDITORnoneThe editor sc edit, --sc-edit and sessions open, for example "zed --wait" or "nvim".
SC_PLUGINS<profiles home>/pluginsThe vendored plugin tree that sc system refreshes. Anything you write here is replaced on the next refresh.
SC_VAULT_PLUGINS<vault>/pluginsThe active vault’s own plugins. Vendoring never touches this tree, so custom plugins live here.
SC_PROMPTS<profiles home>/_global/shared/promptThe shared prompt library, where core.toml lives. See The shared system prompt.
SUPERCLAUDE_DAEMON_PORT[daemon].port, else 48770The daemon’s control port. The variable beats config.toml, so a nested sc and the daemon it talks to agree on one port.
A variable I set is ignored, or I need an off-switch

Three rules apply to every variable on this page.

  • Parent environment wins. For most exported variables, a value you set before running sc is passed through untouched. That makes NAME=0 sc <project> <agent> an off-switch for anything sc turns on. The export tables mark the exceptions.
  • Empty means unset. SUPERCLAUDE_HOME=, SUPERCLAUDE_VAULT= and the three manifest path variables are treated as absent when they hold an empty string, so a stray assignment falls through to the default.
  • Exports reach the whole session. sc replaces itself with claude, so an exported variable is visible to Claude Code, every plugin hook, every subagent and every Bash tool command.

For how vaults, the profiles home and plugins relate, see How it fits together.

Which vault sc picks

sc resolves the vault in this order:

  1. -v <vault> on the command line, looked up in the [vaults.*] registry.
  2. $SUPERCLAUDE_VAULT, used as a path.
  3. The top-level default key in config.toml.
  4. A registered vault literally named default.

A launch, including bare sc in a workspace, also needs a registered default vault, either the default key or a vault named default. Without one, every launch stops with “isn’t bootstrapped yet (no default vault is registered) — run sc system first”, even with -v or $SUPERCLAUDE_VAULT set. Commands that only need a vault, such as sc ls, work with -v or $SUPERCLAUDE_VAULT, and otherwise stop with an error that names the registered vaults and suggests sc vault default <name>. HOME is used to compute the profiles home when SUPERCLAUDE_HOME is unset, and to expand ~ in config paths.

Point a manifest at a plugin path

A manifest (.claude/superclaude.toml) can start a path with any $UPPER_SNAKE/ environment variable. SC_PLUGINS, SC_VAULT_PLUGINS and SC_PROMPTS have a computed default, so a manifest that uses them works with nothing exported. Export one to point it somewhere else.

plugins = [
  "$SC_PLUGINS/sc-memory",
  "$SC_VAULT_PLUGINS/<name>",
]

$SC_VAULT_PLUGINS is the only one that needs a vault. If no vault resolves, a manifest that uses it fails to render. --with <plugin> takes the same $VAR/... specs on the command line. See superclaude.toml for the full manifest.

Choose which editor opens

sc edit, --sc-edit and the editor a session opens all share one resolution order:

OrderSource
1SUPERCLAUDE_EDITOR
2zed, when it is on PATH
3VISUAL
4EDITOR

SUPERCLAUDE_EDITOR comes first on purpose. A shell profile that still sets EDITOR=nano would otherwise decide what every session opens. With none of the four set, sc edit config stops with an error that names all of them.

Move the daemon’s runtime directory

The runtime directory holds the daemon’s socket, lock, pid file and daemon.log.

VariableDefaultWhat it does
SUPERCLAUDE_RUNTIME_DIRsee belowThe runtime directory, used as given.
XDG_RUNTIME_DIRnoneWhen set, the runtime directory is $XDG_RUNTIME_DIR/superclaude.
TMPDIR/tmpThe fallback runtime directory is $TMPDIR/superclaude-<uid>.

Check the running daemon with sc daemon status.

Turn one feature off for one launch
VariableEffect
SUPERCLAUDE_NO_PLUGIN_REFRESHAny value other than empty, 0, false or no makes sc system skip the plugin refresh, the same as --no-plugin-refresh. An empty plugins/ tree is still populated.
SUPERCLAUDE_ISOLATE_VAULTOpts this launch into vault isolation (macOS), the same as --isolate-vault.
SUPERCLAUDE_NO_VAULT_ISOLATIONTurns vault isolation off for one launch when [vault_isolation].enabled = true. An explicit --isolate-vault still wins.
SUPERCLAUDE_NO_HOOK_INJECTSkips the daemon hooks sc adds to every session. The persistent form is [hooks].auto_inject = false.
SUPERCLAUDE_NO_STATUSLINESkips the status line sc adds to every session. The persistent form is [statusline].auto_inject = false.
SC_RELATIVE_WORKTREE_ROOTWhere sc creates worktrees, relative to the project’s code_repo. Default ../worktrees.
CLAUDE_CODE_AUTO_COMPACT_WINDOWOverrides [claude].autocompact for one launch.
NO_COLORTurns off color in sc output and the status line.
SUPERCLAUDE_NO_VAULT_ISOLATION=1 sc <project> <agent>
CLAUDE_CODE_AUTO_COMPACT_WINDOW=900000 sc <project> <agent>
Keep keys out of config.toml

A key in config.toml can name an environment variable instead of holding a literal value. sc expands ${VAR} in the keys below when it reads them. An unset variable expands to an empty string.

WhereExample
[endpoints.<name>].key_csvkey_csv = "${OPENAI_API_KEY}", which may expand to a comma-separated list of keys
[dist].keykey = "${RELEASE_KEY}", for a private release server
[share].keykey = "${SUPERCLAUDE_KEY}", the superclaude key shares use

The variable names are yours to choose. The chat relay also reads SC_RELAY_SLACK_BOT_TOKEN, SC_RELAY_SLACK_APP_TOKEN and SC_RELAY_DISCORD_TOKEN, and each one beats the matching token in config.toml. See config.toml.

Install sc somewhere other than ~/.local/bin

The install script reads SC_INSTALL_DIR, default $HOME/.local/bin, as the directory for sc and its superclaude symlink. See Install.

curl -fsSL https://superclaude.io/install.sh | SC_INSTALL_DIR="$HOME/bin" sh

Variables sc exports into a session#

These are set on every normal launch: sc <project> <agent>, bare sc in a workspace, and sc system.

VariableValueIf already set
CLAUDE_MODEsuperclaudeAlways overwritten
SUPERCLAUDE_VAULTthe active vault’s pathKept, unless -v names a vault
SUPERCLAUDE_VAULT_NAMEthe vault’s registered name, which can differ from its directory nameSet only when SUPERCLAUDE_VAULT is unset and sc resolves the vault from the workspace path
SUPERCLAUDE_WORKSPACE_IDa name such as personal/<project>/<agent>, or systemKept
CLAUDE_MEMORY_HUB<vault>/memoriesKept
SC_WORKFLOWS<vault>/workflowsKept
CLAUDE_CODE_FORK_SUBAGENT1Kept
CLAUDE_CODE_ENABLE_FUNCTION_HOOKS1Kept
CLAUDE_ENV_FILE<profiles home>/bashtoolenv.shAlways overwritten
CLAUDE_CODE_AUTO_COMPACT_WINDOW[claude].autocompact, default 700000Kept
CLAUDE_CODE_MAX_CONTEXT_TOKENS[claude].context_window, unset by defaultKept
VISUAL, EDITORthe resolved editorOverwritten, but only when SUPERCLAUDE_EDITOR is set or zed is on PATH
SUPERCLAUDE_DAEMON_PORTthe daemon’s control portKept
SUPERCLAUDE_ISOLATE_VAULT1Set only for --isolate-vault
What each export is for
  • CLAUDE_MODE tells hooks the session came through sc, so a session started with plain claude is flagged at session start.
  • SUPERCLAUDE_WORKSPACE_ID is a name, not a path: the workspace’s location under the profiles home, with the p and a segments dropped. It is left unset for a workspace outside the profiles home.
  • CLAUDE_MEMORY_HUB is the vault’s memory hub. It is exported only when <vault>/memories exists. Without it, sc-memory works from the project’s own .claude/memory only.
  • SC_WORKFLOWS is the vault’s store for the multi-agent workflow scripts a session runs. sc creates the directory if it is missing and also passes it to Claude Code with --add-dir.
  • CLAUDE_CODE_FORK_SUBAGENT enables Claude Code’s fork subagent type, which sc-memory’s background consolidation uses. CLAUDE_CODE_ENABLE_FUNCTION_HOOKS enables in-process function hooks, which several bundled plugins ship. Both are off by default in Claude Code.
  • CLAUDE_ENV_FILE is a script Claude Code sources before every Bash tool command. sc creates it on first launch with one line that unsets the HTTP proxy variables, and never overwrites it afterwards. Add your own lines to it.
  • The context variables come from [claude] in config.toml. Values from 100000 to 1000000 are exported. "auto" exports nothing. An unset autocompact exports 700000; an unset context_window exports nothing. They are variables rather than flags because Claude Code ranks the environment above --autocompact and settings.
  • VISUAL and EDITOR get the same value. For zed the exported value is zed --wait, so Claude Code waits for the file to close. Your shell’s own EDITOR is not changed.
  • SUPERCLAUDE_DAEMON_PORT is exported when the launch uses the daemon, so plugin hooks can find it.
My session runs on a gateway profile

When a session runs on a gateway profile, through -u <profile> or a non-direct default_profile, sc starts the daemon, checks that the profile is ready, and then points Claude Code at the gateway. These are always overwritten.

VariableValue
ANTHROPIC_BASE_URLthe daemon’s gateway, on the local control port
ANTHROPIC_AUTH_TOKENthe placeholder sc-go; the daemon adds the real key per request
ANTHROPIC_CUSTOM_HEADERSX-SC-Profile: <profile>, which tells the daemon which profile to route
ANTHROPIC_DEFAULT_OPUS_MODEL, _SONNET_MODEL, _HAIKU_MODEL, _FABLE_MODELa label such as <profile> · <model> · opus, or the bare role name when config.toml cannot be read
ANTHROPIC_SMALL_FAST_MODELthe haiku role’s label
ANTHROPIC_DEFAULT_*_MODEL_NAMEthe model picker label, <profile> · <endpoint>/<model>
CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC1

A hybrid profile, where at least one role uses a passthrough endpoint, sets only ANTHROPIC_CUSTOM_HEADERS from this table. Claude Code keeps its own login, its own model ids and api.anthropic.com as its base URL. sc puts the daemon’s local proxy in the session’s request path, and the proxy routes each request by role: a passthrough role goes on to api.anthropic.com unchanged, and any other role goes to the gateway.

Each model label keeps its role word, which is how the daemon maps a request back to a role. The label is also what the status line shows. sc --no-daemon launches plain Claude Code and sets none of these. -u with any profile other than direct, together with --no-daemon, is an error.

My session runs incognito

-i replaces the per-session exports in the table above with a fixed set. It sets no feature gates, no CLAUDE_MEMORY_HUB, no SC_WORKFLOWS, no editor and no CLAUDE_ENV_FILE. SUPERCLAUDE_VAULT and SUPERCLAUDE_WORKSPACE_ID are still inherited.

VariableValue
CLAUDE_MODEincognito
CLAUDE_INCOGNITO1, so hooks can detect the mode
DISABLE_TELEMETRY, DO_NOT_TRACK, DISABLE_ERROR_REPORTING1
DISABLE_AUTOUPDATER, DISABLE_BUG_COMMAND, DISABLE_FEEDBACK_COMMAND, CLAUDE_CODE_DISABLE_FEEDBACK_SURVEY1
CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC1
CLAUDE_CODE_DISABLE_AUTO_MEMORY, CLAUDE_CODE_SKIP_PROMPT_HISTORY, CLAUDE_CODE_DISABLE_FILE_CHECKPOINTING1
CLAUDE_CODE_AUTO_CONNECT_IDE, ENABLE_CLAUDEAI_MCP_SERVERS0

ANTHROPIC_API_KEY is passed through from your shell unchanged. The filesystem sandbox around an incognito session is macOS-only; on Linux the variables still apply. See Use cases for a read-only review with -i.

I run sc from inside a session

A session launched by sc already carries SUPERCLAUDE_VAULT, so a nested sc keeps the parent’s vault, workspace identity and daemon port.

Test against a throwaway home#

SUPERCLAUDE_VAULT outranks the default in config.toml. Pointing SUPERCLAUDE_HOME somewhere else does not clear it, because a different function reads each variable. A test run started from inside a session therefore targets the real vault unless you clear both first:

unset SUPERCLAUDE_VAULT CLAUDE_MEMORY_HUB
export SUPERCLAUDE_HOME="$(mktemp -d)"
sc vault ls

Confirm that sc vault ls shows the throwaway home before you run anything that writes.

Check what a launch would set#

sc <project> <agent> --dry-run prints the resolved environment and argv without starting Claude Code. It marks which variables sc added and masks values that look like credentials. It still starts the daemon and the gateway, so treat it as a launch. See Change an agent for the other report selectors.

View as Markdown