Created
March 30, 2026 23:10
-
-
Save SofianeHamlaoui/284bf7c5d6be5db1a989ebc2768f463d to your computer and use it in GitHub Desktop.
Using Multiple Claude Accounts simultaneously
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CLAUDE_ACCOUNTS=( | |
| "$HOME/.claude-v1" | |
| "$HOME/.claude-v2" | |
| "$HOME/.claude-v3" | |
| "$HOME/.claude-v4" | |
| ) | |
| claude() { | |
| local binary | |
| binary=$(command -v claude 2>/dev/null) | |
| for dir in "${CLAUDE_ACCOUNTS[@]}"; do | |
| echo "→ Trying account: $dir" | |
| CLAUDE_CONFIG_DIR="$dir" "$binary" "$@" | |
| local exit_code=$? | |
| if [[ $exit_code -eq 0 ]]; then | |
| return 0 | |
| fi | |
| echo "⚠ Account $dir exited with code $exit_code — switching to next account..." | |
| done | |
| echo "✗ All accounts exhausted." | |
| return 1 | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment