atriumatrium

Adapter environment

Per-adapter environment variables applied to agent panes.

atrium can inject environment variables into panes running a specific adapter. This is useful for adapter-specific tuning that should not leak into other terminals — authentication keys, per-adapter feature flags, or TTY quirks like Claude Code's CLAUDE_CODE_NO_FLICKER.

Setting variables from the UI

The fastest path is the gear icon on any adapter's launcher tile — it opens the adapter's settings dialog with the environment variables editor front and center. The same dialog is reachable from Settings → Tools → [adapter] → Environment variables.

The editor is a table of keys and values:

  • Add row to declare a new variable.
  • Delete row icon on each row.
  • Value field — masked when the key looks like a secret (*_KEY, *_TOKEN, *_SECRET, *_PASSWORD), with a show/hide toggle.
  • Paste a .env block into any key field to expand it into rows in one gesture. Atrium parses KEY=value, export KEY=value, quoted values (single or double), and strips # comment lines and trailing # comment tails on unquoted values. Multi-line values are not supported; everything else round-trips cleanly.
Changes are saved immediately. Shells that are currently running receive a USR1 signal, re-source ~/.atrium/shell/env.sh, and pick up the new values — you do not need to press Enter or relaunch the agent for env changes to apply. Note that most adapters cache environment at launch, so runtime changes take effect on the next tool call or on the next resume.

Setting variables from config

Power users can hand-edit config.adapterEnvVars.<adapter-name> in ~/.atrium/config.json:

{
  "adapterEnvVars": {
    "claude-code": {
      "CLAUDE_CODE_NO_FLICKER": "1",
      "ANTHROPIC_API_KEY": "sk-..."
    },
    "codex": {
      "OPENAI_API_KEY": "sk-..."
    }
  }
}

atrium watches the file and applies the same USR1 propagation automatically on save.

Precedence

Environment resolution order for a pane running an adapter:

  1. System environment (the user's shell defaults).
  2. atrium's own variables (ATRIUM_CLI_PATH, ATRIUM_PANE_ID, etc.).
  3. Per-adapter variables from config.adapterEnvVars.<adapter>.
  4. Launcher-specific flags (from --adapter-flags on the CLI, or the launcher option fields in the UI).
Later entries win. To override a system variable only for a specific adapter, set it in adapterEnvVars.<adapter>.

Useful variables by adapter

Claude Code

  • CLAUDE_CODE_NO_FLICKER=1 — smoother partial-output rendering inside atrium. Set by default.
  • ANTHROPIC_API_KEY — authentication for the Claude API. Also respected via claude login.

Codex

  • OPENAI_API_KEY — Codex authentication.

Gemini

  • GOOGLE_API_KEY / GEMINI_API_KEY — Gemini authentication.

Secrets

atrium stores configuration in plaintext JSON under ~/.atrium/config.json with 0600 permissions. Values are readable by any process running as your user. Do not put long-lived API keys in config if you share your machine — use the tool's own credential store (keychain, ~/.config/claude/, etc.) and leave atrium's env-var slot for per-adapter tuning only. The UI's masking in Settings → Tools is a visual guard, not a secret-store.

Variables atrium sets for you

These are always injected and cannot be overridden by user config (overrides are silently dropped if they collide):

  • ATRIUM, ATRIUM_CLI_PATH, ATRIUM_DATA_DIR
  • ATRIUM_PANE_ID, ATRIUM_WORKSPACE_ID, ATRIUM_TAB_ID
  • ATRIUM_HOOK_PORT
  • ATRIUM_TASK_ID, ATRIUM_TASK_RUN_ID (when the pane is bound to a task)
  • ATRIUM_EXISTING_PROMPT_COMMAND (preserves the user's existing bash PROMPT_COMMAND)
  • ATRIUM_REAL_ZDOTDIR, ATRIUM_BOOTSTRAP_ZDOTDIR (zsh integration internals)