How to use two Claude Code accounts without breaking your workflow?
Everything comes to a dead stop. You're in the middle of a sprint, the assistant is rewriting your files like a pro, you have three windows open because you keep jumping from one project to another, and then, disaster. "Usage limit reached."
Claude Code, the tool I use every day, works in five-hour chunks per week. When the counter hits zero, you can go make yourself a coffee, nothing else will happen until it resets. It's the little percentage I watch melt away in my statusline, and I explained to you this morning why this gauge melts so fast and how to finally see where your hours are going.
The obvious solution is a second subscription. The problem isn't paying twice. It's what gets broken along the way. You've trained your assistant: it knows your instructions, your history, your tools, your quirks. If the backup account shows up without all that, you start from scratch every time you switch. Needless to say, you'll never switch.
The quota wall, highway version: you were in the middle of a sprint, and it came to a dead stop
Two doors, one room
The secret can be summed up in one sentence: we keep two separate vaults for the two identities, but we make them open onto the same content.
Your program stores everything you've configured in one specific folder, and that's where it looks for its identifier at startup. The backup account will have its own folder, therefore its own identifier, therefore its own budget. So far, nothing to do with each other, and that's exactly what we want. Then we put shortcuts between the two. Not copies, shortcuts. A shortcut is one more door opening onto the same room: you haven't duplicated the library, you've just added a second entrance.
Two doors in the same wall, one room behind them. That's exactly what a shortcut is
Result: both accounts read the same instructions, the same history, the same tools. Nothing is duplicated, so nothing gets messed up on one side when you correct something on the other. When the first one hits its limit, you open the second, it already has everything in mind. No reconfiguration, no copy that gets outdated, nothing.
What the shortcut doesn't carry over
Two things need to be said frankly, because this is where tutorials pretend.
The first: it's not free. A second account means a second subscription. The trick doesn't give you more hours for the same price, it just keeps you from stopping halfway through or buying another month in a panic.
The second, and this is the nastiest part: what you're doing right now, the conversation in progress, doesn't live in your folder. It lives on the servers of the company that runs Claude Code, and that gives it back to you as you go. Your instructions, your history, your tools, those are properly shared. But the conversation from earlier, the one where you were sweating over a piece of code, the backup account knows nothing about it. If you switch without warning, it shows up like a colleague nobody handed the file to.
The handoff was what was missing. Without it, the second one starts behind
The workaround is that simple: before cutting off, you ask your assistant to write down exactly where it was, and you give that note to the next one. A handoff, like on a track. It's a little longer than a hard switch, but it's what separates "I pick up exactly where I left off" from "I start from scratch, swearing."
If you're a developer
You can skip this part if you don't touch your machine's settings, the idea is already there. Here, it's the instructions, line by line, for Windows.
We start with two folders: yours, .claude, and the backup account's, .claude-secours. The file containing your identifier, .credentials.json, stays separate in each one, and that's what gives you the two budgets. Everything else, the brain, is shared through shortcuts.
First move, once and for all: create the backup folder and set up the shortcuts. Open your PowerShell terminal and paste this.
$sourceBase = "$HOME\.claude"
$targetBase = "$HOME\.claude-secours"
if (-not (Test-Path $targetBase)) {
New-Item -ItemType Directory -Path $targetBase -Force | Out-Null
}
$itemsToLink = @(
"agent-memory", "agents", "commands", "hooks", "plans", "plugins",
"projects", "skills", "startup", "statusline", "templates",
"CLAUDE.md", "LESSONS.md", "WORKFLOW.md", "HISTORY.md", "TODO.md",
"config.json", "settings.json", "settings.local.json", "settings_zai.json"
)
foreach ($item in $itemsToLink) {
$source = Join-Path $sourceBase $item
$target = Join-Path $targetBase $item
if (Test-Path $source -and -not (Test-Path $target)) {
$isDir = (Get-Item $source) -is [System.IO.DirectoryInfo]
$linkType = if ($isDir) { "Junction" } else { "SymbolicLink" }
New-Item -ItemType $linkType -Path $target -Target $source -Force | Out-Null
}
}Second move: two commands, one for each account. Open your PowerShell profile with notepad $PROFILE and add this.
# ton instance principale
function claude {
Remove-Item Env:\CLAUDE_CONFIG_DIR -ErrorAction SilentlyContinue
$nativeCommand = (Get-Command claude -CommandType Application, ExternalScript | Select-Object -First 1).Path
& $nativeCommand @args
}
# ton instance de secours
function claude-secours {
$env:CLAUDE_CONFIG_DIR = "$HOME\.claude-secours"
$nativeCommand = (Get-Command claude -CommandType Application, ExternalScript | Select-Object -First 1).Path
& $nativeCommand @args
}Two switches for the same setup: one for the main account, one for the backup
Then, it's sorted. You type claude, you work on your main account. The counter hits zero? You type claude-secours login the very first time to link the second subscription, then simply claude-secours the following times. The backup account reads your shared files instantly, and you carry on.
The setting that does it all is CLAUDE_CONFIG_DIR : it tells the program which folder to look in for your configuration. The first command erases it, back to the normal folder. The second points it to the backup folder. This is documented in the official docs.
Two honest caveats before you start. File shortcuts require developer mode or administrator rights on Windows, folder shortcuts go through without asking for anything. And this setup does not carry over the current conversation, hence the handoff that follows.
Under Linux, the same recipe, a different language
If you also develop on a server, the logic does not change one bit. What changes are the tools: no more PowerShell or junctions, we switch to a Bash script and simple symbolic links. And good news, the administrator rights issue disappears: you are at home in your folder, you do whatever you want.
Create a file init_claude_secours.sh and paste this into it. It uses the same list as earlier, plus three elements that you probably share with your server when going back and forth between the two: your .ps1 scripts and the list of authorized machines.
#!/bin/bash
SOURCE_BASE="$HOME/.claude"
TARGET_BASE="$HOME/.claude-secours"
# Création du répertoire de secours
if [ ! -d "$TARGET_BASE" ]; then
mkdir -p "$TARGET_BASE"
echo -e "\e[36mRépertoire créé : $TARGET_BASE\e[0m"
fi
# Liste stricte des éléments à lier
ITEMS=(
"agent-memory" "agents" "commands" "hooks" "plans" "plugins"
"projects" "skills" "startup" "statusline" "templates"
"CLAUDE.md" "LESSONS.md" "WORKFLOW.md" "HISTORY.md" "TODO.md"
"config.json" "settings.json" "settings.local.json" "settings_zai.json"
"check.ps1" "switch.ps1" "ssh-allowed-hosts.txt"
)
for ITEM in "${ITEMS[@]}"; do
SOURCE_PATH="$SOURCE_BASE/$ITEM"
TARGET_PATH="$TARGET_BASE/$ITEM"
# Si la source existe
if [ -e "$SOURCE_PATH" ]; then
# Si le lien n'existe pas encore dans le secours
if [ ! -e "$TARGET_PATH" ]; then
ln -s "$SOURCE_PATH" "$TARGET_PATH"
echo -e "\e[32mLien créé avec succès : $ITEM\e[0m"
else
echo -e "\e[90mDéjà lié : $ITEM\e[0m"
fi
else
echo -e "\e[33mIgnoré (introuvable dans la source) : $ITEM\e[0m"
fi
done
echo -e "\e[37mSynchronisation Linux terminée.\e[0m"Make it executable and run it:
chmod +x init_claude_secours.sh
./init_claude_secours.sh
Next, the profile. The equivalent of PowerShell's $PROFILE is ~/.bashrc, or ~/.zshrc if you're using Zsh. Open it with nano ~/.bashrc and add these two functions at the end.
# Fonction pour le compte Claude principal
claude() {
unset CLAUDE_CONFIG_DIR
command claude "$@"
}
# Fonction pour le compte Claude de secours
claude-secours() {
# L'assignation sur la même ligne limite la variable à l'exécution de cette commande
CLAUDE_CONFIG_DIR="$HOME/.claude-secours" command claude "$@"
}command claude plays the same role as our Windows trick: it targets the original binary and prevents the function from calling itself in a loop. And the assignment on the same line is clever, the variable only lives for as long as the command, it doesn't hang around in your session. Save with Ctrl+O, Enter, Ctrl+X, reload with source ~/.bashrc, and that's it.
The initialization doesn't change: claude-secours login in the terminal, you authenticate with the second account, and the server switches over by itself without touching your main session keys. You end up with exactly the same behavior on your Windows machine and on your server.
Handing over cleanly
When your gauge is approaching 95%, don't switch over abruptly. First ask the main account to document its state. Send it this, word for word:
Génère un fichier nommé TRANSFERT_SECOURS.md à la racine de mon projet. Ce fichier doit contenir : le plan d'action global en cours, ce qui a été validé jusqu'à présent, les bugs en cours d'analyse, et la consigne exacte de la prochaine étape que tu t'apprêtais à coder.Then close it properly with Ctrl+C, open your new session with claude-secours, and give it this instruction:
Lis attentivement le fichier TRANSFERT_SECOURS.md et exécute la prochaine étape.
The newcomer takes over the previous one's entire reasoning, and you pick your work back up exactly where you left it. It's the little ritual that turns a backup account into a simple extension of the first one, instead of a stranger.
Who it's worth it for
If you tinker for a few hours a week for fun, forget all this. You never hit the wall, and paying for two subscriptions so you don't have to wait for a reset is a waste.
If you live in it, like me with my three windows open on three projects in parallel, it's insurance. The kind you don't like paying for and are pretty glad to have the evening everything stops right in the middle. The real problem, when you get down to it, isn't the quota. It's that I spend a little too much time on it. But my wife has already put that better than I have.
Sources
- Claude Code: environment variables, the official documentation that documents
CLAUDE_CONFIG_DIR




Join the conversation
You need an account to comment on this article. Creating one is free and takes under a minute.
No comments yet.