bash tool and interactive ! commands. Atomic runs Bash in non-interactive mode (bash -c), which doesn’t expand aliases by default. On native Windows, leave shellCommandPrefix unset and see Run Atomic on Windows.
Before you begin
Before you configure shell aliases, confirm the following:- You run Atomic on macOS, Linux, or WSL with Bash available.
- Your shell aliases live in a startup file such as
~/.zshrcor~/.bashrc.
Configure shellCommandPrefix
Follow these steps to load your aliases before each Bash command and confirm they expand:
1
Add shellCommandPrefix to settings.json
Open Replace the following:
~/.atomic/agent/settings.json (or a trusted project’s .atomic/settings.json; project settings replace the global value, and Atomic also reads legacy ~/.pi/agent/settings.json) and add shellCommandPrefix:SHELL_PROFILE_PATH: the shell startup file containing your alias definitions, such as~/.zshrcor~/.bashrc.
2
Reload settings
Inside Atomic, run
/reload (or restart Atomic) so the updated shellCommandPrefix applies.3
Confirm that aliases expand
Run
!alias inside Atomic and confirm that your aliases appear in the output without errors or extra printed lines.Scope and caveats
Keep the following limits in mind when usingshellCommandPrefix:
- Applies to model and interactive shell commands: Atomic prepends
shellCommandPrefixfollowed by a newline (<prefix>\n<command>) to every modelbashtool call and every interactive!and!!command. - Keep the prefix silent and error-free: Any syntax error,
set -efailure, orexitinsideshellCommandPrefixstops every shell command from running. Any text printed to stdout by the prefix appears at the top of every command output returned to the model. grep '^alias 'and Bash syntax limits:grep '^alias ' ~/.zshrcimports only single-line alias definitions starting at column 0. It skips shell functions, exported environment variables, indented or conditional aliases, and Zsh-only syntax such asalias -goralias -s(which fails in Bash). Becauseshopt -s expand_aliasesis Bash-specific, it also fails if nobashbinary exists on a Unix system and Atomic falls back to/bin/sh.- Blueprint worktrees: When resuming inside a blueprint worktree that sets
$ENVRC, Atomic appends the blueprint environment setup aftershellCommandPrefix.
Troubleshooting
Use the following checks if shell commands fail after settingshellCommandPrefix:
- Every shell command exits immediately with a syntax error: Remove Zsh-only alias flags (
alias -g,alias -s) from the lines matched bygrep '^alias ', or put Atomic-safe aliases in a dedicated file such as~/.atomic-aliasesand source it directly (shopt -s expand_aliases\nsource ~/.atomic-aliases). - Unexpected text appears before every command output: Silence any commands inside
shellCommandPrefixby redirecting stdout (>/dev/null). - Interactive
!commands fail on native Windows: RemoveshellCommandPrefixfromsettings.jsonon native Windows.
Next steps
Explore related shell configuration guides:- Settings: Shell: configure
shellPathandshellCommandPrefix. - Run Atomic on Windows: configure Git Bash and PowerShell on Windows.