Show HN: Claude-account – switch Claude Code accounts without logging in again
TL;DR Highlight
Isolated per-account config folders let you switch Claude Code accounts without logging in again.
Who Should Read
A developer who juggles work and personal Claude Code accounts and is tired of logging in each time.
Core Mechanics
- Each account gets its own folders
- It creates an isolated config and credential-storage directory per profile.
- Normal commands pass straight through to the official claude executable.
- Commands live under claude account
- It provides add, use, list, current, and remove.
- current prints only the profile name, which suits scripts.
- Switching affects only new processes
- Running sessions keep the account they started with.
- It never touches tokens
- Claude Code itself handles login, logout, and token refresh.
- The state file holds only profile names, paths, and the real claude executable path, never tokens.
- macOS needs Claude Code 2.1.144 or later
- That version supports Keychain credentials scoped per config directory.
- CLAUDE_CONFIG_DIR and CLAUDE_SECURESTORAGE_CONFIG_DIR both point to the same profile directory.
Community Reactions
- Separate desktop app launchers worked for one user
- A commenter runs two Claude max accounts via launchers with different --user-data-dir values.
- They reported that Claude in Chrome doesn't work well on the second account.
- Simpler DIY alternatives exist
- One commenter suggested a gist using one alias per account, which they said is simple and works well.
- Another shared a mise setup that sets CLAUDE_CONFIG_DIR per directory.
- Questions about sharing memory and history
- A commenter asked whether the global CLAUDE.md is shared.
- Another user only wants to swap accounts, so they run /logout and log in again to keep memories and transcripts.
- Concerns about account bans
- Several commenters worried that switching accounts often could get them banned.
How to Apply
- Try per-folder accounts with mise first
- Today, create a mise.toml in a project folder and set CLAUDE_CONFIG_DIR under [env] to a per-account path.
- Run claude in that folder and confirm each one logs in separately.
- Install claude-account and create two profiles
- Verify the release archive with its checksum, then run ./claude-account install.
- Register accounts with claude account add work and claude account add personal.
- Check the current account in scripts
- Call claude account current at the start of automation scripts.
- Add a condition that aborts if it isn't the intended profile.
- Check for API key env var conflicts
- See whether ANTHROPIC_API_KEY or similar is set in your shell.
- Unset them to use profile auth, or set PRESERVE_AUTH_ENV=1 if the variables should win.
Try It
# Paste into a terminal (macOS/Linux) — after installing, create two accounts and switch
claude account add work
claude account add personal
# Check and switch accounts
claude account list
claude account use personal
claude account current
# Next: open a new terminal and run claude to confirm it opens as personal without logging in againTerminology
Related Papers
Same Simulation, Different Evidence: Where Retrieved Tool Output Costs LLM Agents Accuracy
Saving long tool output to files cut GPT-5.1 accuracy by 11.3 points; naming the authoritative file restored it.
Fake News, Real Crashes: Information Injection Attacks on LLM Financial Trading Agents
Fake headlines hijacked LLM trading agents 62% of the time versus 14% for prompt injection.
Harness Engineering 101: The LLM is the brain, the harness is the body
An agent is a loop managing a JSON array; 16 chapters build one from scratch
Harness2 by Google Research – Recursive Agent Harnessing
Recursively refining the harness with fixed model weights raised benchmark scores by up to 11.8 points.
Ousted Savannah police officer gave ICE agent husband access to Flock system
A police officer shared her Flock login with her ICE-agent husband; an audit found 983 searches and she was fired
Tmux and Claude Code: Sessions, Send-Keys, and the Ceiling
Running Claude Code agents in tmux works well, but limits appear around four agents.