#!/bin/bash # omarchy:summary=Print the config home of the active Claude, Codex, or Grok account # omarchy:args= # omarchy:hidden=true # Prints nothing while the primary account (~/.claude, ~/.codex) is active, so # a launch only sets CLAUDE_CONFIG_DIR / CODEX_HOME when there's somewhere # else to point it. Without a registry, no Python starts at all: this runs on # every `claude` and `codex` typed at a prompt. registry="${XDG_STATE_HOME:-$HOME/.local/state}/omarchy/agents/accounts/${1:-}.json" if [[ ${1:-} != "claude" && ${1:-} != "codex" && ${1:-} != "grok" ]]; then echo "Usage: omarchy-agent-account-home " >&2 exit 1 fi # A running session pins its home, including an empty value for Main. Claude's # implicit default also selects ~/.claude.json, so Main must stay implicit. account_pin="OMARCHY_AGENT_${1^^}_HOME" if [[ -v $account_pin ]]; then printf '%s' "${!account_pin}" elif [[ -f $registry ]]; then exec omarchy-agent-account-state home "$1" fi