How to Set Up Multiple Claude Code Accounts for Marketing Agency Client Management
Learn how to set up multiple Claude Code accounts for marketing agency client management. This comprehensive guide covers step-by-step methods for secure configuration, context switching, client isolation, credential management, and audit logging—ensuring efficient and compliant workflows for agencies managing multiple clients with Claude Code.
How To
byMetaflow AILast Updated on
TL;DR
Use Claude Code's scope system: Managed → User → Project → Local settings create a flexible hierarchy for multi-client management
Separate config directories: Create ~/.claude-configs/client-name/ for each client to ensure complete isolation
Environment variable switching: Use CLAUDE_HOME with shell aliases for instant context switching between clients
Project-level isolation: Put .claude/settings.json in each repository for team-shared configs, .claude/settings.local.json for personal overrides
Secure credential management: Use apiKeyHelper scripts instead of hardcoding API keys in configuration files
Permission boundaries: Leverage the permissions system to deny cross-client file access and restrict dangerous operations
Automation wins: Create shell scripts and git hooks to automatically detect and switch client configurations based on project directory
Session isolation: Each config directory maintains separate session history, auto-memory, and authentication state
Managed settings for agencies: Deploy agency-wide security policies via MDM (macOS), Group Policy (Windows), or /etc/claude-code/ (Linux)
Audit everything: Enable OpenTelemetry logging with client-specific headers for compliance and billing tracking
Managing multiple clients as a marketing agency comes with unique challenges—especially when you're using AI-powered development tools like Claude Code. Each client deserves isolated environments, secure data handling, and context-specific configurations. This comprehensive guide shows you exactly how to set up multiple Claude Code accounts and configurations to keep your agency's client work organized, secure, and efficient.
Why Marketing Agencies Need Multiple Claude Code Configurations
The Client Separation Problem
Marketing agencies juggling multiple clients face a constant challenge: context switching. When you're building a landing page for Client A in the morning and debugging email automation for Client B in the afternoon, you need clean separation between projects. Without proper account isolation, you risk:
Cross-contamination of code contexts: Claude Code learns from your project structure and codebase. Mixing client contexts means Claude might suggest Client A's proprietary solutions when working on Client B's project.
Credential leakage: API keys, database credentials, and authentication tokens stored in one client's environment could accidentally appear in another's codebase.
Billing confusion: When multiple clients share a single Claude Code configuration, tracking usage and costs becomes a nightmare.
Managing multiple Claude accounts isn't just about convenience—it's about maintaining professional boundaries and protecting client confidentiality.
Data Privacy and Security Requirements
Client data is sacred. Marketing agencies often handle sensitive information: customer databases, proprietary marketing strategies, unreleased product details, and financial data. A single misconfigured Claude Code session could expose one client's data to another.
Proper multi-account management ensures:
Each client's codebase remains isolated
API keys and credentials never cross client boundaries
Session history and auto-memory features don't leak information between projects
Compliance requirements (GDPR, CCPA, SOC 2) are maintained through proper data segregation
Context Switching Efficiency
Beyond security, there's productivity. Switching between client projects means changing:
Authentication credentials
Project-specific instructions and coding standards
Custom MCP (Model Context Protocol) servers
Approved tools and permissions
Git configurations and commit attribution
Without a systematic approach to manage multiple Claude Code profiles, you'll waste hours reconfiguring settings every time you switch clients. The right setup lets you jump between client contexts in seconds, not minutes. This is where using an ai marketing workspace approach can streamline your daily operations by keeping contexts cleanly separated.
Method 1: Configuration Scope System for Multi-Client Management
Claude Code uses a powerful scope system that determines where configurations apply and who they're shared with. Understanding these scopes is the foundation for managing multiple client accounts effectively.
What Are Configuration Scopes and How They Work
Claude Code organizes settings into four hierarchical scopes:
Managed scope (highest priority): Server-managed settings deployed by IT/DevOps that cannot be overridden
User scope: Personal settings stored in `~/.claude/` that apply across all projects
Project scope: Team-shared settings in `.claude/` within the repository
Local scope (most specific): Personal overrides in `.claude/settings.local.json` that apply only to the current project
This hierarchy means more specific scopes override broader ones. A permission denied in project settings will block access even if it's allowed in user settings.
The `apiKeyHelper` setting lets you specify a custom script that generates authentication values dynamically, perfect for rotating credentials or using client-specific API key management systems.
Method 2: Environment Variable Configuration
Environment variables provide a flexible way to manage multiple Claude Code sessions simultaneously without modifying configuration files.
Using Custom Configuration Directories
The most powerful approach is creating entirely separate configuration directories for each client and using shell aliases or scripts to switch between them.
macOS/Linux/WSL Setup:
# Add to your ~/.bashrc or ~/.zshrc
export CLAUDE_CONFIG_CLIENT_A="$HOME/.claude-configs/client-a"
export CLAUDE_CONFIG_CLIENT_B="$HOME/.claude-configs/client-b"
export CLAUDE_CONFIG_CLIENT_C="$HOME/.claude-configs/client-c"
# Create aliases for quick switching
alias claude-a='CLAUDE_HOME="$CLAUDE_CONFIG_CLIENT_A" claude'
alias claude-b='CLAUDE_HOME="$CLAUDE_CONFIG_CLIENT_B" claude'
alias claude-c='CLAUDE_HOME="$CLAUDE_CONFIG_CLIENT_C" claude'
Windows PowerShell Setup:
# Add to your PowerShell profile ($PROFILE)
$env:CLAUDE_CONFIG_CLIENT_A = "$env:USERPROFILE\.claude-configs\client-a"
$env:CLAUDE_CONFIG_CLIENT_B = "$env:USERPROFILE\.claude-configs\client-b"
$env:CLAUDE_CONFIG_CLIENT_C = "$env:USERPROFILE\.claude-configs\client-c"
# Create functions for quick switching
function Claude-A {
$env:CLAUDE_HOME = $env:CLAUDE_CONFIG_CLIENT_A
claude $args
}
function Claude-B {
$env:CLAUDE_HOME = $env:CLAUDE_CONFIG_CLIENT_B
claude $args
}
function Claude-C {
$env:CLAUDE_HOME = $env:CLAUDE_CONFIG_CLIENT_C
claude $args
}
Creating Aliases for Quick Switching
Enhance your workflow with intelligent alias functions that automatically switch to the correct configuration based on your current directory:
# Advanced auto-detection alias
function claude-auto() {
local current_dir=$(pwd)
case "$current_dir" in
*/clients/client-a/*|*/client-a-*)
echo "🔵 Switching to Client A configuration..."
CLAUDE_HOME="$CLAUDE_CONFIG_CLIENT_A" claude "$@"
;;
*/clients/client-b/*|*/client-b-*)
echo "🟢 Switching to Client B configuration..."
CLAUDE_HOME="$CLAUDE_CONFIG_CLIENT_B" claude "$@"
;;
*/clients/client-c/*|*/client-c-*)
echo "🟡 Switching to Client C configuration..."
CLAUDE_HOME="$CLAUDE_CONFIG_CLIENT_C" claude "$@"
;;
*)
echo "⚪ Using default Claude configuration..."
claude "$@"
;;
esac
}
# Make it your default
alias claude='claude-auto'
Marketing agencies often need to run multiple Claude Code sessions in parallel—reviewing code for one client while another session handles automated testing. This is where ai agents for agencies can truly shine, enabling teams to efficiently juggle client work and maintain clear separation at scale.
Creating Isolated Session Directories
Each Claude Code configuration maintains its own session history, auto-memory, and state. By using separate configuration directories, you automatically get isolated sessions:
# Terminal 1: Working on Client A
CLAUDE_HOME="$HOME/.claude-configs/client-a" claude
# Terminal 2: Simultaneously working on Client B
CLAUDE_HOME="$HOME/.claude-configs/client-b" claude
# Terminal 3: Client C emergency fix
CLAUDE_HOME="$HOME/.claude-configs/client-c" claude
Avoiding Authentication Conflicts
When running multiple Claude Code instances, authentication conflicts can occur. Here's how to prevent them:
For clients with strict data retention policies, you can disable session persistence entirely:
{
"cleanupPeriodDays": 0
}
This deletes all transcripts at startup and prevents new session files from being written—perfect for handling sensitive client work.
Security Best Practices for Multi-Client Setups
API Key Management and Storage
Never hardcode API keys in configuration files. Use secure storage mechanisms:
Option 1: Environment-based key management
# Store in a secure environment file (never commit to git)
echo "CLIENT_A_API_KEY=sk-ant-..." > ~/.claude-configs/client-a/.env
echo "CLIENT_B_API_KEY=sk-ant-..." > ~/.claude-configs/client-b/.env
# Load before running Claude
source ~/.claude-configs/client-a/.env && claude
Get the correct UUID from your Claude Console organization settings.
Check 3: Clear authentication cache
# Backup first
cp ~/.claude-configs/client-a/.claude.json ~/.claude-configs/client-a/.claude.json.backup
# Remove auth section and re-authenticate
claude --config ~/.claude-configs/client-a
File Permission Conflicts
Permission errors often stem from misconfigured ownership or access rights.
# Take ownership
takeown /F "$env:USERPROFILE\.claude-configs" /R /D Y
# Grant full control
icacls "$env:USERPROFILE\.claude-configs" /grant:r "$env:USERNAME:(OI)(CI)F" /T
Automating Account Switching with Scripts
Creating a Client Switcher Script
Build a sophisticated client switcher that handles all configuration details:
#!/bin/bash
# claude-switch.sh - Intelligent client configuration switcher
set -euo pipefail
CONFIGS_DIR="$HOME/.claude-configs"
CURRENT_CLIENT_FILE="$HOME/.claude-current-client"
show_usage() {
cat << EOF
Usage: claude-switch CLIENT_NAME
Available clients:
$(ls -1 "$CONFIGS_DIR" | sed 's/^/ - /')
Current client: $(cat "$CURRENT_CLIENT_FILE" 2>/dev/null || echo "none")
EOF
}
switch_client() {
local client="$1"
local config_path="$CONFIGS_DIR/$client"
if [ ! -d "$config_path" ]; then
echo "❌ Error: Client '$client' not found"
show_usage
exit 1
fi
echo "🔄 Switching to client: $client"
export CLAUDE_HOME="$config_path"
echo "$client" > "$CURRENT_CLIENT_FILE"
# Load client-specific environment variables
if [ -f "$config_path/.env" ]; then
source "$config_path/.env"
fi
# Show client info
echo "✅ Active configuration: $config_path"
echo "📊 Model: $(jq -r '.model // "default"' "$config_path/settings.json" 2>/dev/null)"
echo "🔐 Auth method: $(jq -r '.forceLoginMethod // "auto"' "$config_path/settings.json" 2>/dev/null)"
# Start Claude Code
claude "$@"
}
if [ $# -eq 0 ]; then
show_usage
exit 0
fi
switch_client "$@"
# List available clients
claude-switch
# Switch to a specific client
claude-switch client-a
# Switch and run a command
claude-switch client-b "review the latest PR"
# Add to ~/.bashrc or ~/.zshrc
claude_prompt() {
if [ -n "${CLAUDE_HOME:-}" ]; then
local client=$(basename "$CLAUDE_HOME")
echo " 🤖$client"
fi
}
PS1='$(claude_prompt) \u@\h:\w\$ '
VS Code integration:
Create `.vscode/tasks.json` in each client project:
// ~/.claude/settings.json
{
"companyAnnouncements":
"Remember: All client work requires code review before deployment",
"Security reminder: Never commit API keys or credentials"
,
"permissions": {
"deny":
"Read(.env*)",
"Read(**/secrets/**)"
}
}
Billing and Usage Tracking
Track Claude Code usage per client for accurate billing:
# $PROFILE (Microsoft.PowerShell_profile.ps1)
# Define client configurations
$script:ClaudeClients = @{
"client-a" = "$env:USERPROFILE\.claude-configs\client-a"
"client-b" = "$env:USERPROFILE\.claude-configs\client-b"
"client-c" = "$env:USERPROFILE\.claude-configs\client-c"
}
# Auto-detect based on current directory
function Initialize-ClaudeConfig {
$currentPath = Get-Location
foreach ($client in $script:ClaudeClients.Keys) {
if ($currentPath -like "*\$client\*") {
$env:CLAUDE_HOME = $script:ClaudeClients$client
Write-Host "🤖 Configured for $client" -ForegroundColor Cyan
return
}
}
}
# Run on every directory change
$ExecutionContext.InvokeCommand.LocationChangedAction = {
Initialize-ClaudeConfig
}
Linux/WSL Considerations
Systemd user service for background configuration:
ini
# ~/.config/systemd/user/claude-client-a.service
Unit
Description=Claude Code Client A Configuration
Service
Type=oneshot
Environment="CLAUDE_HOME=%h/.claude-configs/client-a"
ExecStart=/usr/local/bin/claude-switch client-a
Install
WantedBy=default.target
Best Practices Summary
Do's
✅ Use separate configuration directories for each client to ensure complete isolation
✅ Leverage project-scoped settings (.claude/settings.json) for team-shared configurations
✅ Implement the apiKeyHelper pattern for secure, dynamic credential management
✅ Create shell aliases or scripts for quick context switching
✅ Use managed settings to enforce agency-wide security policies
✅ Document client-specific standards in CLAUDE.md files
✅ Set up audit logging for compliance-sensitive clients
✅ Test configurations in isolation before deploying to production
Don'ts
❌ Never hardcode API keys in configuration files
❌ Don't share configuration directories between clients
❌ Avoid running multiple instances with the same CLAUDE_HOME
❌ Don't commit .claude/settings.local.json to version control
❌ Never allow unrestricted file system access in client configurations
❌ Don't skip authentication isolation between client accounts
❌ Avoid mixing client contexts in the same terminal session
Conclusion
Setting up multiple Claude Code accounts for marketing agency client management doesn't have to be complicated. By leveraging Claude Code's configuration scope system, environment variables, and project-level settings, you can create isolated, secure, and efficient workflows for each client.
The key is understanding the hierarchy: managed settings for agency-wide policies, user settings for personal preferences, project settings for team collaboration, and local settings for individual overrides. Combined with intelligent automation through shell scripts and git hooks, you can switch between client contexts in seconds while maintaining the highest security standards.
Whether you're managing two clients or twenty, this systematic approach ensures:
Complete data isolation between client projects
Secure credential management without hardcoded secrets
Efficient context switching with minimal cognitive overhead
Compliance-ready audit trails for regulated industries
Team collaboration without sacrificing individual productivity
Start with the basic configuration scope approach, add environment variable automation as you scale, and implement enterprise-grade managed settings when handling sensitive client work. Your agency's multi-client Claude Code setup will become a competitive advantage—freeing your team to focus on delivering exceptional results instead of wrestling with configuration management.
FAQs
What is Claude Code and how does it benefit marketing agencies?
Claude Code is an AI-powered development tool designed to streamline workflows for marketing agencies. It allows for the creation of isolated environments for each client, enhancing security, data privacy, and productivity by preventing context switching issues and credential leakage.
How do I set up multiple Claude Code configurations for different clients?
To set up multiple Claude Code configurations, create separate configuration directories for each client, such as ~/.claude-configs/client-name/. This ensures complete isolation of settings, credentials, and session history for each client project.
What is the scope system in Claude Code?
The scope system in Claude Code organizes settings into four hierarchical levels: Managed, User, Project, and Local. This hierarchy allows more specific settings to override broader ones, ensuring tailored configurations for different use cases.
How can I manage API keys securely in Claude Code?
Avoid hardcoding API keys in configuration files. Instead, use apiKeyHelper scripts or secure environment variables to dynamically manage authentication credentials, ensuring they remain confidential and client-specific.
What measures can I take to prevent cross-client data access?
Implement strict permission rules in your Claude Code configurations to deny access to unauthorized files. Use the permissions system to enforce boundaries, ensuring that one client’s data cannot be accessed from another’s environment.
How can I automate client configuration switching in Claude Code?
You can automate client configuration switching by creating shell scripts or aliases that set the CLAUDE_HOME environment variable based on the current working directory. This allows for quick context switching without manual reconfiguration.
What are the best practices for managing multiple Claude Code sessions?
Best practices include using separate configuration directories for each client, setting up unique authentication methods, implementing audit logging for compliance, and maintaining clear documentation of client-specific standards in a CLAUDE.md file.
How do I ensure compliance with data privacy regulations while using Claude Code?
To ensure compliance, maintain clear separation of client data, use secure credential management practices, enable audit logging for tracking, and adhere to industry-specific regulations through proper configuration and settings management.