Skip to content

Environment variable contract

This page covers the variables that matter to the process tree and to a pane’s environment, not every AGENTMUX_* variable in the code (there are over two hundred; most are test, debug or build switches). Every variable named here exists.

This document is the canonical reference for every AGENTMUX_* (and the WAVEMUX_AGENT_ID alias) environment variable that flows through the AgentMux process tree.


agentmux-launcher (J0 Job Object owner)
│ sets: path vars, BACKEND_WS/WEB/PID, AUTH_KEY, SRV_PIPE_PATH
│ LAUNCHER_PIPE, HOME, SPLASH_EVENT, INSTANCE_ID
│
├── agentmux-srv (sidecar, J0 member)
│ reads: path vars, AUTH_KEY, APP_PATH, SRV_PIPE_PATH
│ sets own env: LOCAL_URL (after binding), DATA_HOME, CONFIG_HOME
│ strips: AUTH_KEY from its own process env after reading, then
│ hands a pane only the variables on PANE_ENV_KEEP
│
└── agentmux-cef (Chromium host, J0 member)
reads: BACKEND_WS/WEB/PID, AUTH_KEY, LAUNCHER_PIPE/PID
HOME, SPLASH_EVENT, INSTANCE_ID, RUNTIME_MODE, path vars
│
└── [PTY shell per pane] (child of srv, not host)
reads: AGENTMUX, BLOCKID, TABID, VERSION, BUILD,
INSTANCE_CHANNEL, LOG_DIR, LOCAL_URL, AUTH_KEY,
AGENT_ID, AGENT_SLUG, AGENT_DISPLAY, INSTANCE_SLUG,
TERM, COLORTERM, TERM_PROGRAM, PATH (augmented)
shell integration sends OSC 16162;E back to srv

Source files cited throughout:


These variables identify the agent persona assigned to a pane and drive focused-border colour, pane title, and jekt auto-registration.

AttributeValue
Who sets itsrv shell controller (shell.rs) from block cmd:env metadata (never from global settings cmd_env); crates/srv/src/server/app_api/agent_open.rs on agent.open; agent_config.rs for MCP env injection
Who reads itPTY shell process; shell integration scripts (bash.sh, pwsh.ps1, zsh.sh) encode it into OSC 16162;E on every prompt; shell.rs reads it to decide jekt auto-registration
Example valueAgentX, Aria, Terminal
LifetimeSet once at pane spawn; persists for the lifetime of the PTY session

Priority chain (shell.rs):

  1. Block metadata cmd:env["AGENTMUX_AGENT_ID"]
  2. Alias: WAVEMUX_AGENT_ID in the same block cmd:env (read-only fallback for jekt registration)

Global settings cmd_env["AGENTMUX_AGENT_ID"] and the srv process env are deliberately not consulted.

Strip logic (shell.rs): if none of the above sources provides a value, AGENTMUX_AGENT_ID and the WAVEMUX_AGENT_ID are actively removed from the PTY child’s environment so a parent AgentMux pane’s identity does not bleed into a new plain terminal pane.

PITFALL — jekt pseudo-agent: AGENTMUX_AGENT_ID='Terminal' is the string that a plain (non-agent) pane would show if the strip logic were absent. Do not configure this value unless you actually want the pane treated as a named agent named “Terminal”. The jekt registry will accept it and route messages there.

PITFALL — OSC 16162;E feedback loop: The shell integration re-emits the value on every prompt via an OSC sequence that the srv parses. If you export AGENTMUX_AGENT_ID=X inside a running shell, the next prompt triggers an identity update that the frontend applies immediately. This is intentional (live agent re-binding), but setting the var to an empty string emits {} rather than nothing, which clears the pane’s displayed identity.


An AGENTMUX_* variable reaches a pane only if it is on the allow-list PANE_ENV_KEEP in crates/srv-core/src/backend/pane_env.rs. Everything else that srv holds (the instance’s data, config and cache folders, the channel, the runtime mode) is removed from the pane’s environment, so a build started from a pane can’t adopt the launching instance’s identity. The list is an allow-list on purpose: a variable added later is kept out until someone adds it with a reason.

GroupVariables
The instance’s loopback APIAGENTMUX_LOCAL_URL, AGENTMUX_AUTH_KEY
Which paneAGENTMUX_BLOCKID, AGENTMUX_TABID
Which buildAGENTMUX_VERSION, AGENTMUX_BUILD, AGENTMUX_INSTANCE_CHANNEL, AGENTMUX_LOG_DIR
Agent identityAGENTMUX_AGENT_ID, AGENTMUX_AGENT_SLUG, AGENTMUX_AGENT_DISPLAY, AGENTMUX_INSTANCE_SLUG

AGENTMUX itself (the nesting sentinel) is always set to 1 and never stripped. On Linux, the AppImage’s own APPIMAGE, APPDIR, OWD and ARGV0, and this version’s folder in LD_LIBRARY_PATH, are removed too.

An agent’s turn gets more variables than a plain pane, which srv sets when it starts the turn: AGENTMUX_AGENT_UID, AGENTMUX_AGENT_TOKEN (the agent’s own token), the former names and slugs after a rename, the git author and committer identity, and the GitHub-broker switches. crates/srv-core/src/backend/agent_env_scope.rs lists each with the reason it reaches a container agent or doesn’t. The MCP server entry in an agent’s .mcp.json (crates/srv-core/src/backend/mcp_json_identity.rs) also carries the signing keys for jekts (AGENTMUX_JEKT_KEY and the LAN and WAN keys). Treat those as secrets and never log them.


All path variables are set by the launcher from DataPaths::to_env_vars() (data_paths.rs) and consumed by downstream binaries via DataPaths::from_env() (data_paths.rs). The launcher is the single source of truth; downstream binaries must not recompute paths.

~/.agentmux/ ← AGENTMUX_INSTANCE_DIR anchor (home_dir field)
├── shared/ ← AGENTMUX_SHARED_DIR
├── channels/<channel>/ ← AGENTMUX_INSTANCE_DIR (Installed/Portable)
│ ├── config/ ← AGENTMUX_CONFIG_DIR
│ ├── agents/ ← AGENTMUX_AGENTS_DIR
│ └── versions/<ver>/
│ ├── data/ ← AGENTMUX_DATA_DIR (+ alias AGENTMUX_DATA_HOME)
│ ├── logs/ ← AGENTMUX_LOG_DIR
│ ├── cef-cache/ ← AGENTMUX_CEF_CACHE_DIR
│ └── runtime/ ← AGENTMUX_INSTANCE_RUNTIME_DIR
└── dev/<branch>/[<clone_id>/] ← AGENTMUX_INSTANCE_DIR (Dev mode)
└── (same children, no version/ nesting)
AttributeValue
Who sets itLauncher, via DataPaths::to_env_vars() (data_paths.rs)
Who reads itsrv, host via DataPaths::from_env()
ExampleC:\Users\<name>\.agentmux\channels\stable
PurposeChannel root; config and agents directories hang directly off this

AttributeValue
Who sets itLauncher (data_paths.rs)
Who reads itsrv for SQLite database location (objects.db, sagas.db); DataPaths::from_env()
ExampleC:\Users\<name>\.agentmux\channels\stable\versions\<version>\data

Alias: srv also publishes AGENTMUX_DATA_HOME (crates/srv/src/bootstrap/stores.rs). New code should read AGENTMUX_DATA_DIR.


AttributeValue
Who sets itLauncher (data_paths.rs)
Who reads itsrv config.rs, which re-exports it as AGENTMUX_CONFIG_HOME for config_watcher_fs.rs (settings.json and related config files)
ExampleC:\Users\<name>\.agentmux\channels\stable\config

Alias: AGENTMUX_CONFIG_HOME (base.rs). Same caveats as DATA_DIR/DATA_HOME above.


AttributeValue
Who sets itLauncher (data_paths.rs); the srv shell controller passes it on to the pane’s process (spawn_command.rs)
Who reads itShell integration muxlog helper (bash.sh, pwsh.ps1); memory_heartbeat.rs; any process in a pane that wants to locate logs
Example/home/alice/.agentmux/channels/stable/versions/<version>/logs or C:\Users\<name>\.agentmux\channels\stable\versions\<version>\logs

In a terminal pane the value is the running instance’s own log folder, the version’s logs/ folder, under the home override if one is set. The host and srv logs are in it, with the pointer files muxlog reads (see Log discovery). The launcher’s own log is in ~/.agentmux/logs/.


AttributeValue
Who sets itLauncher (data_paths.rs)
Who reads itCEF host for Chromium profile / cache directory
ExampleC:\Users\<name>\.agentmux\channels\stable\versions\<version>\cef-cache

Regenerable; can be deleted without data loss.


AttributeValue
Who sets itLauncher (data_paths.rs)
Who reads itsrv agent definition storage; channel-wide (does not include the version segment)
ExampleC:\Users\<name>\.agentmux\channels\stable\agents

AttributeValue
Who sets itLauncher (data_paths.rs)
Who reads itsrv and launcher for single-instance lock files, IPC port file, named-pipe path
ExampleC:\Users\<name>\.agentmux\channels\stable\versions\<version>\runtime

AttributeValue
Who sets itLauncher (data_paths.rs)
Who reads itIdentity/OAuth code; provider auth dirs live here so credentials persist across channel/version upgrades
ExampleC:\Users\<name>\.agentmux\shared

Channel-independent and version-independent. Provider credential directories live under shared/providers/<provider>/, so a new channel or version needs no new login. With AGENTMUX_ISOLATED_AUTH=1 a channel keeps its own accounts and credential folders instead (see Isolation and update switches).


AttributeValue
Who sets itLauncher (Windows only, crates/launcher/src/host_spawn.rs) to the runtime/ directory containing the host binary
Who reads itCEF host for asset resolution (crates/cef/src/commands/window/creation.rs): index.html, frontend bundle
ExampleC:\Users\<name>\Desktop\agentmux-portable\runtime

Purpose: Shields against a Windows bug where GetModuleFileName returns the load-time path even after the directory is renamed or unlinked. The launcher resolves the real exe path and exports the parent dir. Not set on Unix (fallback to current_exe().parent() is reliable there).


AttributeValue
Who sets itThe test harness, and task dev (to its own home, <clone>/.dev-home/<vite port>, unless AGENTMUX_DEV_USE_REAL_HOME=1)
Who reads itdata_paths.rs, crates/srv/src/bootstrap/stores.rs, crates/srv-core/src/registry/paths.rs
PurposeReplaces ~/.agentmux root with another folder so tests and dev builds don’t touch the real user data

SECURITY: Do not set this in production. Any process that sets this variable can redirect the entire AgentMux state tree to an arbitrary path.


AGENTMUX_DEV_USE_REAL_HOME (task dev only)

Section titled “AGENTMUX_DEV_USE_REAL_HOME (task dev only)”
AttributeValue
Who sets itA developer, before task dev
Who reads ittask dev (scripts/dev-home.mjs)
Example1

1 makes task dev run on the real ~/.agentmux instead of a home of its own, and the start-up banner says REAL. A dev build on the real home refuses to start when a pending migration would move the shared stores ahead of the installed build. See Which home task dev uses.


AttributeValue
Who sets itLauncher, computed once by RuntimeMode::current() (runtime_mode.rs)
Who reads itsrv and host via RuntimeMode::from_env() / from_env_with_clone()
Valuesinstalled, portable, dev:<branch>
Exampledev:main, installed, portable

Detection priority (launcher):

  1. AGENTMUX_RUNTIME_MODE env override (CI / testing)
  2. agentmux-portable.marker file next to launcher binary
  3. Exe path contains dist/cef-dev/, target/debug/, or target/release/
  4. AGENTMUX_DEV_BRANCH env override (CI)
  5. Default: installed

PITFALL — dev builds inside an agent pane: If you run task dev from inside an agent pane in a portable build, the child process inherits the parent’s AGENTMUX_RUNTIME_MODE=portable (and AGENTMUX_CHANNEL=stable). The dev host uses resolve_path_only (data_paths.rs) which ignores the env and relies on the exe path to detect dev mode — preventing cross-contamination. Do not override AGENTMUX_RUNTIME_MODE in an agent pane’s environment unless you know exactly what you are doing.


AttributeValue
Who sets itLauncher (data_paths.rs) from channel resolution; also a user override for Installed/Portable modes
Who reads itcrates/srv/src/bootstrap/stores.rs for pre-migration snapshot naming; DataPaths::from_env() in crates/common/src/data_paths.rs (required field — missing value causes from_env() to return None)
Examplestable, beta, local-main, experiment
ConstraintsMax 64 chars; cannot be shared, snapshots, dev, versions, channels, runtime; default maps to stable

User-settable: For Installed and Portable modes, setting this before launch redirects the entire state tree to ~/.agentmux/channels/<value>/. Useful for parallel-channel testing. Ignored in dev mode when using resolve_path_only (see above).


AttributeValue
Who sets itLauncher (data_paths.rs) only when RuntimeMode::Dev { clone_id: Some(...) }
Who reads itRuntimeMode::from_env_with_clone() (runtime_mode.rs) to reconstruct the full Dev variant
Exampledeadbeefcafebabe (16-char hex FNV-1a hash of the clone’s workspace root path)

Ensures two clones of the same branch land in separate subdirectories (~/.agentmux/dev/<branch>/<clone_id>/), preventing lockfile collisions when running task dev from two clones simultaneously.


AttributeValue
Who sets itCI pipelines or developer shell before launching
Who reads itruntime_mode.rs as step 4 of mode detection (after portable marker and exe-path checks)
Examplemain, agenta-feature-x

Allows forcing dev mode for a specific branch without matching the exe-path heuristics. Value is sanitized (path traversal stripped). If the sanitized value is empty, mode falls through to Installed.


AttributeValue
Who sets itYou, before AgentMux starts
Who reads itsrv’s build cache cleanup (crates/srv-core/src/backend/build_cache_service.rs)
Example1, 0

1, true or on lets this srv clear idle agents’ build folders; 0, false or off never does. Unset: only an srv started by its launcher on the real home cleans (the installed release, or a local package), and only one at a time per computer. A task dev build, a headless srv, a binary run from a source tree and an instance with a home of its own don’t. An instance with a home of its own never cleans, even with 1. The settings that tune the cleanup are in Build Cache Settings.


AttributeValue
Who sets itsrv shell controller (shell.rs), shellexec.rs; baked at compile time via env!("CARGO_PKG_VERSION")
Who reads itShell integration muxlog helper to locate pointer files (bash.sh, pwsh.ps1); crates/srv-core/src/migrations/prepare.rs reads it from env as a fallback
Example<version>

Available in every PTY pane shell session. Required by muxlog to resolve the current-host-v<AGENTMUX_VERSION>.path pointer file.


AttributeValue
Who sets itYou, before launch. The launcher doesn’t set it
Who reads itThe CEF host (crates/cef/src/app/mod.rs, crates/cef/src/commands/window/gpu_trace.rs), to turn on dev-only switches such as the GPU tier and the GPU trace
See alsoAGENTMUX_RUNTIME_MODE=dev:<branch> carries the runtime mode

AGENTMUX_BUILD_CHANNEL_DEFAULT (compile-time)

Section titled “AGENTMUX_BUILD_CHANNEL_DEFAULT (compile-time)”
AttributeValue
Who sets itBuild script (crates/common/build.rs) from the env at compile time
Who reads itdata_paths.rs as option_env! — baked into the binary, not read at runtime
Examplestable (release CI), local-main (local task package on main branch)

This is a compile-time variable, not a runtime env var. Setting AGENTMUX_BUILD_CHANNEL_DEFAULT before running cargo build bakes a different default channel into the resulting binary. The agentmux-common build script emits cargo:rerun-if-env-changed=AGENTMUX_BUILD_CHANNEL_DEFAULT so incremental compilation detects the change.


AttributeValue
Who sets itYou, before AgentMux starts
Who reads itThe CEF host (crates/cef/src/pane_backend.rs), once at startup, for the whole process
Exampleviews

Windows only. views makes the browser panes overlay panes, like those on macOS and Linux, so a page stays inside its pane’s border while the window is resized. Anything else, or unset, keeps the default: child-window panes. A browser pane in a floating window is a child window either way. macOS and Linux always use overlay panes and ignore it. See Browser pane type on Windows.


AttributeValue
Who sets itYou, before AgentMux starts
Who reads itThe CEF host (crates/cef/src/browser_panes/views_clip.rs), once at startup
Exampleoff

Overlay browser panes (Linux, and Windows with AGENTMUX_PANE_BACKEND=views) stay live when a menu, tooltip or dialog covers part of them: the covered part is cut out and the rest of the page keeps running. off, 0 or hide turns that off, and a covered pane is hidden whole behind a still picture of its page instead.


These variables wire together the launcher, host, and srv processes. Child processes inside panes also see some of them (LOCAL_URL, BLOCKID).

AttributeValue
Who sets itsrv after binding its HTTP listener (crates/srv/src/bootstrap/network.rs): std::env::set_var("AGENTMUX_LOCAL_URL", &local_web_url)
Who reads itShell controller propagates it into PTY children (shell.rs); agentmux-bashwrap reads it for WPS publish authentication (crates/bashwrap/src/mps_client.rs); jekt registry writer uses it for cross-instance registration (shell.rs)
Examplehttp://127.0.0.1:49312
LifetimeSet once per srv startup; changes only when srv restarts

The URL is an ephemeral loopback HTTP endpoint (port 0 at binding, OS-assigned). It is the address of the srv’s web listener (not the WebSocket listener).

PITFALL: agentmux-bashwrap (the streaming bash runner) reads both AGENTMUX_LOCAL_URL and AGENTMUX_AUTH_KEY to authenticate WPS publish calls. If either is absent the wrapper silently skips publishing and Claude’s bash output does not stream to the drone/log pane.


AttributeValue
Who sets itThe launcher generates a UUID v4 per run (srv_spawner.rs) and sets it on both srv and host
Who reads itsrv reads it at startup (config.rs) and removes it from its own process environment. Panes and agent processes get it again by design: it is on PANE_ENV_KEEP (crates/srv-core/src/backend/pane_env.rs), and crates/srv-core/src/backend/shellintegration/lib/muxclient.mjs and agentmux-bashwrap (mps_client.rs) read it, with AGENTMUX_LOCAL_URL, to authenticate to the instance’s loopback API
Example550e8400-e29b-41d4-a716-446655440000 (UUID v4)

SECURITY: srv removes the key from its own environment so that children it spawns by other paths don’t inherit the bearer token. A pane is different: the shell helpers (muxsh, muxlog, muxopen and the rest) need it, so a pane’s process holds an authenticated handle to the instance that spawned it. Anything started from a pane can use it. The allow-list comments in pane_env.rs call this the largest remaining coupling.

SECURITY: Do not log this value. It authenticates all WebSocket connections to the srv instance for the lifetime of that srv process.

Container agents don’t get this value. Their docker exec environment carries a per-pane token starting amxc_ in the same variable, which srv accepts on every route except the ones that run commands on the host, read host files or belong to the app itself (crates/srv-core/src/backend/route_audience.rs; the amxc_ prefix is TOKEN_PREFIX in crates/srv-core/src/backend/container/credential.rs). See Trust model.


AGENTMUX_BACKEND_WS / AGENTMUX_BACKEND_WEB / AGENTMUX_BACKEND_PID

Section titled “AGENTMUX_BACKEND_WS / AGENTMUX_BACKEND_WEB / AGENTMUX_BACKEND_PID”
AttributeValue
Who sets itLauncher on the host process env (crates/launcher/src/host_spawn.rs)
Who reads itCEF host sidecar.rs to skip spawning its own srv when one is already running
ExampleAGENTMUX_BACKEND_WS=ws://127.0.0.1:49313 / AGENTMUX_BACKEND_WEB=http://127.0.0.1:49312 / AGENTMUX_BACKEND_PID=12345

These three vars form the launcher-managed srv hand-off. When all three are present, the host skips spawn_backend() and connects to the launcher-owned srv instead. If AGENTMUX_BACKEND_WS is set but empty or malformed, the host hard-fails rather than silently spawning a second srv (crates/cef/src/lib.rs).

PITFALL: Dev builds launched from inside an agent pane inherit these vars from the parent. The host uses launcher_is_genuine_parent() (checks AGENTMUX_LAUNCHER_PID against getppid()) to distinguish a genuine launcher hand-off from an inherited stale value. Without this check, a developer running task dev inside a pane would silently connect the new host to the parent’s srv.


AttributeValue
Who sets itLauncher (srv_spawner.rs) passes it to srv; launcher also advertises it to itself via env for re-use
Who reads itsrv (crates/srv/src/bootstrap/plumbing.rs): if set, opens a named-pipe IPC server for launcher ↔ srv control channel; CEF host srv_ipc.rs to connect its IPC bridge
Example\\.\pipe\agentmux-srv-3f9a8c1d (Windows) / /tmp/agentmux-srv-3f9a8c1d.sock (Unix)

Absent in task dev mode (no launcher in the loop). The presence of this var is the discriminator between launcher-managed and standalone execution.


AttributeValue
Who sets itLauncher on the host env (crates/launcher/src/host_spawn.rs)
Who reads itCEF host crates/cef/src/launcher_ipc/mod.rs to connect the launcher ↔ host control channel; the Unix-socket variant reads it too (crates/cef/src/launcher_ipc/mod.rs)
ExampleSame path format as AGENTMUX_SRV_PIPE_PATH with a different leaf name

Absent in standalone / dev mode. Host logs a warning and continues without the IPC bridge.


AttributeValue
Who sets itLauncher on the host env, on every platform (crates/launcher/src/host_spawn.rs)
Who reads itCEF host (launcher_is_genuine_parent, crates/cef/src/parent_process.rs) to verify the launcher is still alive and is genuinely the current parent
Example5432

Used to distinguish a genuine launcher hand-off from an inherited stale AGENTMUX_BACKEND_WS value (when the host is launched inside an agent pane). The host compares its real parent process id to this value (getppid() on Unix, the process snapshot on Windows).


AttributeValue
Who sets itLauncher on both srv and host (crates/launcher/src/host_spawn.rs, srv_spawner.rs)
Who reads itCEF host sidecar.rs; identifies the srv instance for multi-instance coordination
Examplev<version>

Formatted as v<version>. Not the same as AGENTMUX_VERSION (which is the raw semver string without the v prefix injected into PTY children).


AttributeValue
Who sets itLauncher (crates/launcher/src/host_spawn.rs)
Who reads itCEF host crates/cef/src/client/navigation.rs signals this named Win32 event when the first page load completes, causing the launcher to dismiss the splash window
ExampleA Win32 event object name, unique per run

Used exclusively for splash-screen synchronisation on Windows. Has no effect on Unix builds.


AttributeValue
Who sets itsrv shell controller (shell.rs); websocket handler for agent process spawns (crates/srv/src/server/agent_handlers/input.rs); shellexec.rs
Who reads itagentmux-bashwrap (bash_wrap.rs) to scope WPS publishes to the correct pane; shell integration scripts have access to it in the PTY environment
Example550e8400-e29b-41d4-a716-446655440001 (block UUID)

Unique per pane block. The streaming bash runner uses this to route output chunks to the correct pane subscription.


AttributeValue
Who sets itsrv shell controller (shell.rs); shellexec.rs
Who reads itShell integration and any process that needs to know which tab it belongs to
Example550e8400-e29b-41d4-a716-446655440002 (tab UUID)

AttributeValue
Who sets itYou, before starting AgentMux (optional)
Who reads itCEF host at startup (crates/cef/src/cdp_port.rs, requested_cdp_port)
ValuesUnset or empty: CDP server off in release builds, on (port 9223) in dev builds. 1024–65535: on, preferring that port. 1/on/true/yes/auto: on, preferring 9222 (release) or 9223 (dev). 0/off/false/no: off, dev builds included

Controls Chromium’s unauthenticated remote-debugging (CDP) server. AgentMux’s own browser automation doesn’t need it. If the preferred port is taken an OS-assigned port is used, and the port in use is written to authkey.dev. See Network exposure.


AttributeValue
Who sets itLauncher (srv_spawner.rs), host sidecar.rs; re-set in srv process env at startup (crates/srv/src/bootstrap/stores.rs)
Who reads itsrv base.rs (MUX_APP_PATH_ENV); used to locate bundled tool binaries (jq.exe, rg.exe, etc.) alongside the launcher
ExampleC:\Users\<name>\Desktop\agentmux-portable

Group 5 — Terminal Emulator Capability Variables

Section titled “Group 5 — Terminal Emulator Capability Variables”

Set by the srv shell controller (shell.rs) on every interactive shell pane. These are standard terminal capability variables; values are fixed constants.

AttributeValue
Set toxterm-256color
WhyConPTY on Windows fully supports VT/ANSI sequences. Without TERM, CLI tools (including Claude Code) use different Unicode width tables, causing ANSI colour offset on Windows. shell.rs
AttributeValue
Set totruecolor
WhySignals 24-bit colour support. Without this, tools that check for truecolor fall back to 256-colour palettes. shell.rs
AttributeValue
Set toagentmux
WhyAllows CLI tools to detect they are running inside AgentMux and enable specific integrations. shell.rs

Variables set by the shellintegration.rs / get_shell_startup() logic (shellintegration.rs) at shell spawn time.

AttributeValue
Who sets itsrv shell controller (shell.rs)
Set to1
PurposePresence-check sentinel for shell integration scripts. Scripts test [[ -n "$AGENTMUX" ]] to confirm they are running inside AgentMux

Shell integrations prepend nothing to $PATH based on its value.


AttributeValue
Who sets itshellintegration.rs at zsh spawn
ZDOTDIR~/.agentmux/shell/<instance-hash>/zsh (one folder per instance) — causes zsh to load AgentMux’s .zshrc instead of ~/.zshrc
AGENTMUX_ZDOTDIRSame path — preserved so the integration .zshrc can source the real ~/.zshrc

The AgentMux zsh .zshrc sources ~/.zshrc explicitly (zsh.sh) to preserve user configuration.


AttributeValue
StatusAlias: a read-only fallback for AGENTMUX_AGENT_ID
Who reads itshell.rs reads it as the lowest-priority fallback for jekt registration only
Strip logicIt is removed from PTY children when no explicit agent identity is configured (shell.rs)

AgentMux never writes them. Use the AGENTMUX_* variables in new configurations.


AttributeValue
StatusAlias for AGENTMUX_DATA_DIR
Who sets itsrv crates/srv/src/bootstrap/stores.rs re-publishes it for backward compatibility if config.data_home is non-empty
Who reads itcrates/srv-core/src/backend/base.rs (MUX_DATA_HOME_ENV); crates/srv/src/bootstrap/stores.rs; sidecar.rs (pre-unification path)

Use AGENTMUX_DATA_DIR in new code.


AttributeValue
StatusAlias for AGENTMUX_CONFIG_DIR
Who sets itsrv crates/srv/src/bootstrap/store_boot.rs
Who reads itbase.rs; config_watcher_fs.rs

Use AGENTMUX_CONFIG_DIR in new code.


VariableRead byEffect
AGENTMUX_ISOLATED_AUTHEvery process, through isolated_auth_enabled() (crates/common/src/data_paths/isolation.rs)Exactly 1 gives the instance its own accounts, provider credential folders and identity store (identity-store.db). Any other value, or unset, shares them across every channel, version and dev build: shared/
AGENTMUX_ISOLATED_SETTINGSHost, launcher and srv (same file)Exactly 1 gives the channel its own settings.json; any other value shares one file; unset isolates every channel except stable
AGENTMUX_ISOLATED_MUXBUScrates/common/src/muxbus_reconnect.rsExactly 1 keeps this channel’s MuxBus sign-in apart; any other value shares the one sign-in; unset keeps it shared except on a local build channel, where it depends on whether the OS asks again for the sign-in
AGENTMUX_SETTINGS_DIRsrv (config_watcher_fs.rs)The folder holding settings.json, overriding every other rule. The host sets it to its config folder
AGENTMUX_NO_AUTO_UPDATEsrv (the background update check)Any non-empty value turns off the background update check; update:auto in settings.json turns it off per user
VariableGroupSet ByAvailable In Pane?
AGENTMUX_AGENT_IDIdentityblock metadata / settingsYes
AGENTMUX_AGENT_SLUG, AGENTMUX_AGENT_DISPLAY, AGENTMUX_INSTANCE_SLUGIdentitysrvYes
AGENTMUX_BUILD, AGENTMUX_INSTANCE_CHANNELRuntimesrvYes
WAVEMUX_AGENT_IDIdentity (alias)user configYes (stripped if no identity)
AGENTMUX_INSTANCE_DIRPathslauncherNo
AGENTMUX_DATA_DIRPathslauncherNo
AGENTMUX_CONFIG_DIRPathslauncherNo
AGENTMUX_LOG_DIRPathslauncher + shell controllerYes
AGENTMUX_CEF_CACHE_DIRPathslauncherNo
AGENTMUX_AGENTS_DIRPathslauncherNo
AGENTMUX_INSTANCE_RUNTIME_DIRPathslauncherNo
AGENTMUX_SHARED_DIRPathslauncherNo
AGENTMUX_HOMEPathslauncher (Windows only)No
AGENTMUX_HOME_OVERRIDEPaths (test, task dev)test harness, task devNo
AGENTMUX_RUNTIME_MODERuntimelauncherNo
AGENTMUX_CHANNELRuntimelauncher / userNo
AGENTMUX_CLONE_IDRuntimelauncher (dev mode)No
AGENTMUX_DEV_BRANCHRuntimeCI / user (pre-launch)No
AGENTMUX_DEV_USE_REAL_HOMERuntime (task dev)user (pre-launch)No
AGENTMUX_BUILD_CACHE_CLEANRuntimeuser (pre-launch)No
AGENTMUX_VERSIONRuntimeshell controllerYes
AGENTMUX_BUILD_CHANNEL_DEFAULTRuntime (build-time)build scriptNo
AGENTMUX_DEVRuntimeuser (pre-launch)No
AGENTMUX_PANE_BACKENDRuntime (Windows)user (pre-launch)No
AGENTMUX_PANE_CLIPRuntimeuser (pre-launch)No
AGENTMUX_LOCAL_URLIPCsrv (after bind)Yes
AGENTMUX_AUTH_KEYIPClauncherYes (on PANE_ENV_KEEP; stripped from srv’s own environment)
AGENTMUX_BACKEND_WSIPClauncher → hostNo
AGENTMUX_BACKEND_WEBIPClauncher → hostNo
AGENTMUX_BACKEND_PIDIPClauncher → hostNo
AGENTMUX_SRV_PIPE_PATHIPClauncher → srv + hostNo
AGENTMUX_LAUNCHER_PIPEIPClauncher → hostNo
AGENTMUX_LAUNCHER_PIDIPClauncher → hostNo
AGENTMUX_INSTANCE_IDIPClauncher → srv + hostNo
AGENTMUX_SPLASH_EVENTIPC (Windows)launcher → hostNo
AGENTMUX_BLOCKIDIPCshell controllerYes
AGENTMUX_TABIDIPCshell controllerYes
AGENTMUX_APP_PATHIPClauncher → srvNo
TERMTerminalshell controllerYes
COLORTERMTerminalshell controllerYes
TERM_PROGRAMTerminalshell controllerYes
AGENTMUXShell integrationshell controllerYes
ZDOTDIRShell integration (zsh)shell controllerYes
AGENTMUX_ZDOTDIRShell integration (zsh)shell controllerYes
AGENTMUX_DATA_HOMEAliassrvNo
AGENTMUX_CONFIG_HOMEAliassrvNo

TopicFile
PTY env injection (shell controller)crates/srv-core/src/backend/blockcontroller/shell/lifecycle.rs
Identity strip logiccrates/srv-core/src/backend/blockcontroller/shell/lifecycle.rs
Jekt auto-registrationcrates/srv-core/src/backend/blockcontroller/shell/lifecycle.rs
DataPaths struct and env var namescrates/common/src/data_paths.rs
DataPaths::to_env_vars()crates/common/src/data_paths.rs
DataPaths::from_env()crates/common/src/data_paths.rs
RuntimeMode detectioncrates/common/src/runtime_mode.rs
AGENTMUX_LOCAL_URL set pointcrates/srv/src/bootstrap/network.rs
AUTH_KEY stripcrates/srv/src/config.rs
AUTH_KEY re-inject for streaming bashcrates/srv/src/server/agent_handlers/input.rs
Shell integration deploymentcrates/srv-core/src/backend/shellintegration.rs
Bash integration scriptcrates/srv-core/src/backend/shellintegration/bash.sh
PowerShell integration scriptcrates/srv-core/src/backend/shellintegration/pwsh.ps1
Zsh integration scriptcrates/srv-core/src/backend/shellintegration/zsh.sh
Launcher → srv env varscrates/launcher/src/srv_spawner.rs
Launcher → host env vars (Windows)crates/launcher/src/host_spawn.rs
Launcher → host env vars (Unix)crates/launcher/src/host_spawn.rs
WSH retirement (AGENTMUX sentinel history)docs/specs/archive/SPEC_RETIRE_WSH_2026_04_12.md
Data channels designdocs/specs/SPEC_DATA_CHANNELS_2026_05_24.md