Show HN: Claude-account – switch Claude Code accounts without logging in again (github.com)

54 points by hamza_rehman ↗ HN
I use separate Claude Code accounts for work and personal projects. Having to log out and go through the login flow every time I switched accounts became annoying, so I built a small CLI to solve it.

The commands are intentionally simple:

claude account add myworkaccount claude account add mypersonalaccount claude account use myworkaccount claude account current

After switching, Claude Code works normally:

claude claude "fix this bug in main.py" Repository: https://github.com/hamzarehmandeveloper/claude-account

Give it a try

21 comments

[ 3.0 ms ] story [ 42.2 ms ] thread
Does it share the global ~/.claude/CLAUDE.md file? For some use case I'd like that, for others it could be problematic.
Another way for those who use mise. You can auto-switch accounts by directory:

~/development/account1/mise.toml:

[env]

CLAUDE_CONFIG_DIR = "{{ env.HOME }}/.claude-account1"

appreciate you building this! I have two Claude max accounts. The way I do it is that I have two app launchers (claude desktop). I use the desktop app and a different data directory for each launcher like `open -n -a /Applications/Claude.app --args --user-data-dir="<its profile directory>"`. I got my first Claude to make me two different launchers for the two apps, and it's been working perfectly. wdyt?

The only problem I've noticed is with Claude in Chrome. It seems to not work well in the second account. And this makes sense because it was designed just for one app. Do you find yourself having the same problem with this setup? have you tried the second one with the Claude in Chrome ext?

don't people get banned for doing this kind of thing?
I use the Claude Code desktop app for work, and the CLI for personal, so I'm always logged into both accounts!
does this also extend to codex?
Not currently It is specific to Claude Code right now
I built the same thing for myself, but I like your implementation so much better.
Is it even safe to switch accounts frequently? worried about them imposing a ban
Cool but I would like to reuse my entire account directory and just switch accounts and nothing else. Now I just do `/logout` and then go through the login flow again because I don't want to lose access to all memories and transcripts.

Is that supported?

No, I kept the whole CLAUDE_CONFIG_DIR isolated because I didn’t want it to directly copying or replacing Claude’s credential files. It felt too easy to get wrong
Can you be logged into two accounts at once? It's not the switching, but the different sessions on different accounts that I find myself doing.

As some have said, easy enough to build yourself, but I think it' nice not to have to test it and make sure it works.

Is this safe to use? as some print from other accounts may leak and will it not harm the accounts?
And knowing Anthropic being developer friendly we can expect them to ban this in 3... 2...