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.
- Auth env vars are stripped by default
- ANTHROPIC_API_KEY, ANTHROPIC_AUTH_TOKEN, and CLAUDE_CODE_OAUTH_TOKEN are removed from the child process.
- Setting CLAUDE_ACCOUNT_PRESERVE_AUTH_ENV=1 lets those variables take precedence.
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
Frostbite: A new CPU architecture discovered, designed and verified by AI
AI agents designed a CPU from scratch, claiming 4.59x perf/W over a traditional core
Restricting AI agents in mobile operating systems platforms from capturing data
Signal now blocks OS-level AI agents from reading its screen on iOS 27 and Android
Actions Speak Louder than Words: Stateful Privacy Sniffing of LLM Agents via Behavioral Covert Channels in Web Interactions
Agents' link choices alone let attackers rebuild user queries at F1 0.89; SOR cuts it to 0.39.
Tracking and Limiting Unsupported Claim Propagation in Multi-Agent LLM Systems: A Provenance-Aware Framework
Passing claims with source, evidence and history kept equivalence at 5 agent stages at 96% versus 31%.
LLM assisted reverse engineering
Pointing an agent at binaries with skills and MD notes made years-long hacks feasible
Metrics-in-the-Loop: Complexity Feedback Reshapes Agent-Written Code
Injecting per-turn complexity reports into coding agents cut code erosion without changing correctness
Why is Gemini 4 Carbon taking so long?
Carbon took nearly an hour on bug fixes that Astra and Opus finished in minutes, mostly from extra unrequested work.
Weight-Space Programming builds neural networks like a 1990s researcher
LLM hand-wrote MNIST weights to 91.3%, using 1990s-style techniques