I wanted personal Grok Build and work Grok Build running at the same time on one Mac. Two terminals felt like enough. It was not.
The naive fix fails
Opening one account in Ghostty and another in Terminal.app does nothing useful. Auth is not tied to the terminal app. It lives in a single file:
~/.grok/auth.json grok login rewrites that cache. Grok also hot-reloads auth.json, so when one session logs in, the other can pick up the new credentials mid-flight. Both terminals silently end up on the same account.
Two windows is not isolation. Shared config is shared identity.
The real fix: GROK_HOME
Grok Build lets you override the config directory with GROK_HOME. Default is ~/.grok. That directory holds auth, config, sessions, and the rest of the local state.
Give each account its own home:
mkdir -p ~/.grok-work Log the work account into that home:
GROK_HOME="$HOME/.grok-work" grok login Run work sessions with the same env:
GROK_HOME="$HOME/.grok-work" grok Personal stays on the default ~/.grok. Work stays in ~/.grok-work. They stop stepping on each other because they never share auth.json.
Aliases
I do not want to type the env var every time. Shell aliases fix that:
# ~/.zshrc
alias grok-personal='GROK_HOME="$HOME/.grok" grok'
alias grok-work='GROK_HOME="$HOME/.grok-work" grok' Personal can just be grok if you leave the default alone. I keep the explicit alias so I never wonder which account is live.
If you use Ghostty, you can also pin GROK_HOME on one profile so that window is always work. Same idea: the env var is the boundary, not the app name.
Optional: shared config, separate auth
If you already tuned config.toml for personal and want the same defaults at work, copy the config file only:
mkdir -p ~/.grok-work
cp ~/.grok/config.toml ~/.grok-work/config.toml Do not copy auth.json. That is the whole point of the split. Config can be shared. Session tokens cannot.
Skills and MCP config are per-home too. Copy those only if you want them duplicated.
A skill that sets it up
If you would rather have Grok walk through the setup, drop this skill into your personal Grok skills folder:
mkdir -p ~/.grok/skills/dual-grok-account
curl -fsSL https://imkarthikk.com/skills/dual-grok-account/SKILL.md
-o ~/.grok/skills/dual-grok-account/SKILL.md Then open Grok and run /dual-grok-account (or just ask it to set up a second Grok account). It will create the second home, optional aliases, optional config copy, and print the login command. It will not copy auth.json.
Raw skill file: dual-grok-account/SKILL.md
One gotcha with XAI_API_KEY
XAI_API_KEY only kicks in when no session token is active. If a login session is present in that GROK_HOME, the session wins. If you are debugging API-key auth, use a clean home or clear the session for that directory first.
Bottom line
Concurrent Grok Build accounts on one machine means concurrent config directories, not concurrent terminal apps. Set GROK_HOME per account, log in once per directory, alias the commands, and leave auth.json alone across homes.
Two homes. Two logins. No bleed.
