Skip to main content

Shell environment variables

Set in every terminal​

Every terminal Saggar starts carries these values on top of your shell's own:

VariableValue
TERMxterm-256color
TERM_PROGRAMsaggar
SAGGAR1
SAGGAR_SESSIONThe terminal's restore identifier. It stays the same across relaunches, so a restored shell keeps the same id.
CLAUDE_CODE_ENABLE_TODO_TOOLS1, so Claude Code reports plan progress Saggar can show
CLAUDE_CODE_SESSIONEND_HOOKS_TIMEOUT_MS5000, so Claude Code's session-end hooks have time to record the turn

Prompts and tools can use SAGGAR=1 or TERM_PROGRAM=saggar to detect the app. Provider hooks and the saggar CLI use SAGGAR_SESSION to address the calling terminal without guessing.

Set with shell integration on​

Settings ▸ Sessions ▸ Track commands with prompt marks is on by default. With it on, zsh and fish still start as login shells, but bash starts as sh with no -l, and Saggar's shim sources the login files that mode skips. Nushell loads Saggar's snippet from a vendor autoload directory. With it off, every shell is a plain login shell.

VariableValue
SAGGAR_CLI_DIRA folder holding Saggar's own saggar command. The shims append it to PATH when nothing else answers to saggar, so the CLI works before you install it.
XDG_DATA_DIRSFor fish and Nushell, ~/.saggar/shell-integration is prepended so their vendor snippets load.
DISABLE_AUTO_UPDATEtrue for zsh only when a startup command is waiting, so Oh My Zsh's update prompt can't swallow it.

To load its scripts, shell integration temporarily redirects ZDOTDIR (zsh) or ENV (bash) and sets SAGGAR_ORIG_ZDOTDIR, SAGGAR_ORIG_ENV, SAGGAR_ZSH_MARKS, SAGGAR_BASH_MARKS, and SAGGAR_STARTUP_COMMAND. The shims restore your original values and unset their own before the first prompt, so your shell config loads unchanged.

Set for agent teams​

A Claude Code session started as a team lead also gets CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1 and SAGGAR_TEAM_LEAD, the lead's session id, which teammates carry.

Read, not set​

Saggar reads these from its own environment or from a hook's:

VariableEffect
SAGGAR_AGENTSet by installed provider hooks so the saggar CLI knows which agent is calling.
SAGGAR_DEBUGTurns on extra logging in the CLI's turn recording.
SAGGAR_USER_STORE_ROOTRelocates ~/.saggar, including diagnostics. Meant for tests and scripted runs.
KILN_BASE_URLPoints the app at a different Marginal Utility backend for development.