Claude Code... but with Profiles.
A transparent wrapper around Claude Code that enables multiple subscription profiles. Each profile gets its own isolated config directory and macOS keychain entry, allowing concurrent sessions across different Claude subscriptions (e.g., work and personal).
Claude Profile leverages Claude Code's built-in CLAUDE_CONFIG_DIR environment variable. When set, Claude Code automatically hashes the directory path (SHA-256) into its macOS keychain service name, producing a unique credential store per profile. No patching or hacking required -- it uses official, documented behavior.
Default keychain entry: "Claude Code-credentials"
Profile keychain entry: "Claude Code-credentials-<sha256[:8]>"
Each profile is a directory under ~/.claude-profiles/<name>/ containing:
config/-- used asCLAUDE_CONFIG_DIR(Claude's settings, credentials, sessions)claude-profile.yaml-- profile-specific metadata (color code)
curl -fsSL https://raw.githubusercontent.com/diranged/claude-profile/main/install.sh | shThis detects your OS and architecture, downloads the latest release, verifies the SHA-256 checksum, and installs to /usr/local/bin.
To install a specific version or to a custom directory:
# Pin a version
curl -fsSL https://raw.githubusercontent.com/diranged/claude-profile/main/install.sh | VERSION=v0.1.0 sh
# Custom install directory
curl -fsSL https://raw.githubusercontent.com/diranged/claude-profile/main/install.sh | INSTALL_DIR=~/.local/bin shDownload a prebuilt binary from the Releases page. Binaries are available for Linux, macOS, and Windows on both amd64 and arm64.
Requires Go 1.25+:
git clone https://github.com/diranged/claude-profile.git
cd claude-profile
make install # Builds and copies to $GOPATH/bingo install github.com/diranged/claude-profile-go/cmd/main.go@latest-
Create a profile:
claude-profile create work
The interactive wizard will:
- Create the isolated config directory
- Offer to copy your existing
~/.claudeconfig files (CLAUDE.md, settings.json) - Let you pick a banner/statusline color
- Configure the Claude Code statusline automatically
-
Authenticate:
# OAuth (interactive) claude-profile -P work auth login # SSO claude-profile -P work auth login --sso # Or launch Claude and use /login inside the REPL claude-profile -P work
-
Use it as a drop-in replacement for
claude:claude-profile -P work claude-profile -P work "explain this code" claude-profile -P personal --model opus -
Use an environment variable instead of
-p:export CLAUDE_PROFILE=work claude-profile "explain this code"
Once your profiles are set up, shell aliases make switching effortless. Add these to your ~/.zshrc or ~/.bashrc:
# Personal Claude — just type "myclaude"
alias myclaude='claude-profile -P personal'
# Work Claude with a shared project config directory
alias workclaude='claude-profile -P work --add-dir ~/git/work/common-claude'
# Quick one-shot questions against different profiles
alias askwork='claude-profile -P work -p'
alias askpersonal='claude-profile -P personal -p'You can pass any Claude flags through — the alias is just a shortcut for the profile selection:
myclaude # Interactive REPL
myclaude "explain this function" # One-shot question
workclaude --model opus -c "run tests" # Specific model + command
workclaude auth login --sso # Re-authenticateThis pairs well with CLAUDE_PROFILE for scripts:
# In a work-specific script or .envrc:
export CLAUDE_PROFILE=work
claude-profile "summarize the recent changes"Interactive wizard that creates a new profile. Steps through config bootstrapping, color selection, and statusline setup.
claude-profile create work
claude-profile create personalLists all profiles with their authentication status.
$ claude-profile list
work (keychain)
personal (file)
experiment (none)Auth status is one of:
- keychain -- OAuth credentials stored in macOS Keychain
- file -- credentials stored in
.credentials.json(plaintext fallback) - none -- no credentials found
Displays detailed information about a profile.
$ claude-profile show work
Profile: work
Config dir: /Users/you/.claude-profiles/work/config
Keychain service: Claude Code-credentials-6061db4b
Auth: keychain
Subscription: pro
Rate limit tier: t3
Expires: 2025-01-15T12:00:00Z
Scopes: user:inference, user:readRemoves a profile's directory and its macOS keychain entry. Prompts for confirmation by default.
claude-profile delete old-profile
claude-profile delete old-profile --force # Skip confirmationWhen no subcommand matches, all arguments are forwarded to the real claude binary. This is the primary usage mode -- claude-profile acts as a transparent wrapper.
# These all pass through to claude:
claude-profile -P work
claude-profile -P work "explain this function"
claude-profile -P work --model opus -c "run tests"
claude-profile -P work auth login
claude-profile -P work auth login --ssoThe -p/--profile flag (and --profile=value / -pvalue forms) is stripped before forwarding. All other flags and arguments pass through untouched. Claude Profile acts as a transparent wrapper.
Acts as a Claude Code statusline provider. Prints a colored line showing the active profile name, auth method, and subscription type. Optionally chains to another statusline command.
# Standalone
claude-profile statusline
# Chaining with another statusline tool
claude-profile statusline -- bunx -y ccstatusline@latestThis is configured automatically by the create wizard in the profile's settings.json:
{
"statusLine": {
"type": "command",
"command": "/path/to/claude-profile statusline",
"padding": 0
}
}If an existing statusline command is detected during creation, it is preserved by chaining:
{
"statusLine": {
"type": "command",
"command": "/path/to/claude-profile statusline -- bunx -y ccstatusline@latest",
"padding": 0
}
}Profile isolation relies on Claude Code's own keychain hashing behavior:
- claude-profile sets
CLAUDE_CONFIG_DIRto~/.claude-profiles/<name>/config - Claude Code computes
SHA-256(CLAUDE_CONFIG_DIR)and takes the first 8 hex characters - The keychain service name becomes
Claude Code-credentials-<hash> - Each profile gets a completely independent credential store
This matches Claude Code's internal V51() function. The hash is deterministic -- the same config directory always produces the same keychain entry.
Example:
Config dir: /Users/you/.claude-profiles/work/config
SHA-256: 6061db4b...
Keychain: Claude Code-credentials-6061db4b
The statusline command reads profile info from environment variables set at launch time:
| Variable | Description |
|---|---|
CLAUDE_PROFILE_NAME |
Active profile name |
CLAUDE_PROFILE_AUTH |
Auth status (keychain/file/none) |
CLAUDE_PROFILE_SUB |
Subscription type (pro/max/free/unknown) |
CLAUDE_PROFILE_COLOR |
ANSI 256-color code for the profile |
These are injected into the Claude process environment by the passthrough handler, making them available to the statusline command when Claude Code invokes it.
Each profile has an ANSI 256-color code used for the launch banner and statusline text. The create wizard offers these presets:
| Color | Name | Code |
|---|---|---|
| Green (default) | 108 | |
| Blue | 33 | |
| Orange | 208 | |
| Pink | 204 | |
| Cyan | 51 | |
| Red | 196 | |
| Purple | 141 | |
| Yellow | 226 | |
| Custom | 0-255 |
The color is stored in claude-profile.yaml inside the profile directory and can be edited directly:
color: 204Claude Profile does not handle authentication itself. It sets up the isolated environment and then delegates to Claude Code's built-in auth mechanisms.
claude-profile -P work auth login
# Or inside Claude's REPL: /loginCredentials are stored in the macOS Keychain under a profile-specific service name.
claude-profile -P work auth login --ssoANTHROPIC_API_KEY=sk-ant-... claude-profile -P workNo keychain entry is created. The API key is passed through the environment.
CLAUDE_CODE_USE_BEDROCK=1 claude-profile -P workCredentials come from AWS environment variables or IAM roles. Claude Profile detects this and skips the keychain credential check.
CLAUDE_CODE_USE_VERTEX=1 claude-profile -P workCredentials come from GCP environment. Claude Profile detects this and skips the keychain credential check.
| Variable | Description |
|---|---|
CLAUDE_PROFILE |
Default profile name (alternative to -p flag) |
CLAUDE_PROFILES_DIR |
Override profiles base directory (default: ~/.claude-profiles) |
CLAUDE_PROFILE_DEBUG |
Enable debug logging (set to any non-empty value) |
CLAUDE_CONFIG_DIR |
Set automatically by claude-profile per-profile |
CLAUDE_CODE_USE_BEDROCK |
Signals Bedrock auth; skips keychain check |
CLAUDE_CODE_USE_VERTEX |
Signals Vertex auth; skips keychain check |
ANTHROPIC_API_KEY |
Direct API key auth; skips keychain check |
CLAUDE_PROFILE_NAME |
Set in Claude's env for statusline use |
CLAUDE_PROFILE_AUTH |
Set in Claude's env for statusline use |
CLAUDE_PROFILE_SUB |
Set in Claude's env for statusline use |
CLAUDE_PROFILE_COLOR |
Set in Claude's env for statusline use |
See LICENSE for details.
