Manage multiple Claude Code configuration profiles. Switch between work and personal accounts, different MCP server setups, or separate settings without logging in and out.
Each profile is a complete, isolated Claude Code configuration directory (settings, credentials, MCP servers, CLAUDE.md, history -- everything). Once configured, claude automatically uses your active profile -- no special launch command needed.
Linux / macOS / WSL:
curl -fsSL https://raw.githubusercontent.com/pegasusheavy/claude-code-profiles/main/install.sh | shWindows (PowerShell):
irm https://raw.githubusercontent.com/pegasusheavy/claude-code-profiles/main/install.ps1 | iexThe installer downloads the appropriate scripts and configures your shell. Restart your shell (or open a new terminal) after installing.
# Create profiles
claude-profile create work
claude-profile create personal
# Set a default
claude-profile default work
# Just use claude — it automatically uses your default profile
claude
claude --resume
claude -p "explain this code"| Command | Description |
|---|---|
claude-profile |
Show current profile status |
claude-profile use <name> |
Switch to a profile for this session |
claude-profile create <name> |
Create a new profile |
claude-profile list |
List all profiles |
claude-profile default [name] |
Get or set the default profile |
claude-profile delete <name> |
Delete a profile (with confirmation) |
claude-profile which [name] |
Show the config directory path |
claude-profile help |
Show help |
Claude Code supports a CLAUDE_CONFIG_DIR environment variable that redirects where it stores configuration and data. claude-profile provides a claude() shell function that wraps the real claude binary:
- Before each invocation, the wrapper checks if a default profile exists and auto-sets
CLAUDE_CONFIG_DIR. - If
CLAUDE_CONFIG_DIRis already set (e.g., viaclaude-profile use), it is used as-is. - The real
claudebinary is then called with all your arguments.
This means you never need to think about profiles during normal use -- just run claude as you always have.
To temporarily use a different profile in the current shell session:
# Temporarily use a different profile
claude-profile use personal
claude # uses "personal" for this shell sessionThe override lasts until you close the shell or run claude-profile use again.
Profiles are stored in platform-appropriate locations:
| Platform | Location |
|---|---|
| Linux | $XDG_DATA_HOME/claude-profiles/ (default: ~/.local/share/claude-profiles/) |
| macOS | $XDG_DATA_HOME/claude-profiles/ (default: ~/.local/share/claude-profiles/) |
| Windows | %LOCALAPPDATA%\claude-profiles\ |
Each profile directory is a complete Claude Code config directory. After creating a profile and launching Claude with it, Claude will populate it with settings.json, .credentials.json, and everything else it needs.
Profile names can contain letters, digits, hyphens, and underscores. Examples: work, personal, client-acme, side_project.
| Script | Platform | Shell |
|---|---|---|
claude-profile.sh |
Linux, macOS, WSL | bash, zsh (sourced) |
claude-profile-init.ps1 |
Windows, Linux, macOS | PowerShell 5.1+ / pwsh 6+ (dot-sourced) |
claude-profile.cmd |
Windows | cmd.exe (use with call prefix) |
If you prefer not to use the install scripts:
Linux / macOS:
# Download
mkdir -p "${XDG_DATA_HOME:-$HOME/.local/share}/claude-profile"
curl -fsSL https://raw.githubusercontent.com/pegasusheavy/claude-code-profiles/main/claude-profile.sh \
-o "${XDG_DATA_HOME:-$HOME/.local/share}/claude-profile/claude-profile.sh"
# Add to shell profile (.bashrc or .zshrc)
echo '. "${XDG_DATA_HOME:-$HOME/.local/share}/claude-profile/claude-profile.sh"' >> ~/.bashrcWindows (PowerShell):
$dir = "$env:LOCALAPPDATA\claude-profile"
New-Item -ItemType Directory -Force -Path $dir | Out-Null
Invoke-WebRequest -Uri "https://raw.githubusercontent.com/pegasusheavy/claude-code-profiles/main/claude-profile-init.ps1" -OutFile "$dir\claude-profile-init.ps1"
Invoke-WebRequest -Uri "https://raw.githubusercontent.com/pegasusheavy/claude-code-profiles/main/claude-profile.cmd" -OutFile "$dir\claude-profile.cmd"
# Add to PowerShell profile
Add-Content -Path $PROFILE -Value ". '$dir\claude-profile-init.ps1'"
# Add to PATH for cmd.exe
$path = [Environment]::GetEnvironmentVariable('Path', 'User')
if ($path -notlike "*$dir*") { [Environment]::SetEnvironmentVariable('Path', "$path;$dir", 'User') }MIT