Show HN: Claude-account – switch Claude Code accounts without logging in again
37 points by hamza_rehman 7 hours ago | 22 comments
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
pandoro 5 hours ago
I use this: https://gist.github.com/KMJ-007/0979814968722051620461ab2aa0...
replySimple and works great but requires one alias per account
dotancohen 5 hours ago
Does it share the global ~/.claude/CLAUDE.md file? For some use case I'd like that, for others it could be problematic.
replycute_boi 5 hours ago
Do you expect vibe-coded slop to care about such things? Also, there's already another app, https://github.com/realiti4/claude-swap, which is also vibe-coded, but it's maintained and tested.
replydotancohen 4 hours ago
> Do you expect vibe-coded slop to care about such things?
I'm divorced - I no longer have any expectations. I ask.hmokiguess 3 hours ago
I built the same thing for myself, but I like your implementation so much better.
replybdemirkir 5 hours ago
Or use https://omp.sh and add multiple accounts. omp tracks usage and when limit is reached it uses the next account.
replyAlexErrant 5 hours ago
Sadly incompatible with Claude subs.
replypwython 4 hours ago
I use the Claude Code desktop app for work, and the CLI for personal, so I'm always logged into both accounts!
replybaron3dl 4 hours ago
don't people get banned for doing this kind of thing?
replyrew0rk 4 hours ago
The threat of account bans and a less than friendly appeal system does make me wary of trying it, even though this would be incredibly useful.
replyttoinou 2 hours ago
A lot of them also don’t get banned, right ? There are vibecoders youtubers switching accounts all the time
replySo what’s the differenve ?
dpoloncsak 4 hours ago
If it's honestly 'One account is paid for by my employer and used as a tool for my job' and 'One account is for personal use, where I work on passion-projects and the likes' I think it's fine....? Not a lawyer but I'd assume as long as you're not using it to bypass usage limits Anthropic wouldn't even really notice or care.
replybrentmitchell25 5 hours ago
Another way for those who use mise. You can auto-switch accounts by directory:
reply~/development/account1/mise.toml:
[env]
CLAUDE_CONFIG_DIR = "{{ env.HOME }}/.claude-account1"
acuteaura 5 hours ago
revolutionary. you can do this with 2 lines of shell code.
replyi do this: https://github.com/acuteaura/universe/blob/main/overlays/cla...
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?