paskvilwiki

up: programming

using multiple claude accounts

work on the company account, side projects on your own

last updated 2026-11

got a company Claude account, and side projects of your own? you don't want company tokens spent on your hobby repo, and you don't want your personal artifacts, memory and integrations sitting in the company account either. the fix is simple - give each account its own config dir, and make sure every session starts in the right one

this assumes you've read working with claude cli - CLAUDE.md, memory etc. are explained there

the goal

the rules the setup has to meet - the rest of the page is one way to get there:

  • work projects run on the company account, personal ones on your own
  • nothing is shared between the two - no common CLAUDE.md, settings, memory or symlinks
  • a plain claude that isn't clearly on one side must fail (stop at the login screen), never quietly use either account
  • it's obvious at a glance which account a session is on

let claude do it

you don't have to do any of this by hand - start claude and hand him this page:

i want separate claude profiles for work and personal stuff, set up as described in https://wiki.paskvil.com/claude-accounts/ - go through it with me, ask what you need, and prepare everything you can before i close this session

what he can't figure out on his own, and will ask you:

  • which projects are work and which are personal - folder patterns are easiest (~/Projects/work/*, ~/Projects/mine/*)
  • which parts of your global CLAUDE.md go to which side
  • which MCP servers, skills and hooks each side needs
  • aliases or direnv (below)

aliases or direnv?

two ways to pick the account - talk it through with claude, and pick what feels more natural:

  • aliases - you choose every time you start: claude-work or claude-personal, in any folder. explicit, but you have to remember
  • direnv - the account follows the folder: everything under ~/Projects/work/ is work, under ~/Projects/mine/ personal, and a plain claude just works there. nothing to remember, but a session started anywhere else hits the login screen (which is the point)

aliases

in ~/.bashrc (~/.zshrc on zsh):

alias claude-work='CLAUDE_CONFIG_DIR=~/.claude-work command claude'
alias claude-personal='CLAUDE_CONFIG_DIR=~/.claude-personal command claude'
claude() { echo "pick one: claude-work / claude-personal" >&2; return 1; }

works in any folder and in the IDE terminals - the IDE plugins' own "open claude" button doesn't go through the aliases, use the terminal instead

direnv

an .envrc in each parent folder, then direnv allow in it:

# ~/Projects/work/.envrc
export CLAUDE_CONFIG_DIR="$HOME/.claude-work"
# ~/Projects/mine/.envrc
export CLAUDE_CONFIG_DIR="$HOME/.claude-personal"
  • needs direnv's hook in your shell rc - the IDE terminals pick it up too, the plugins' buttons may not
  • a project with its own .envrc needs source_up in it, or it hides the parent one

how it works

  • Claude Code keeps everything - login, settings, CLAUDE.md, memory, skills, plugins, saved sessions - in one config dir, ~/.claude by default
  • CLAUDE_CONFIG_DIR=<dir> points it at another one - a separate dir = a separate login = a separate account
  • artifacts and claude.ai integrations (Jira, Figma…) belong to the logged-in account - so a personal session publishes to your personal account and doesn't see the company Jira, and the other way around
  • only the user-level config splits - a repo's own CLAUDE.md and .claude/ work the same in both profiles

setup

the catch - the session doing the setup runs from ~/.claude, the very folder that gets moved. so claude prepares everything he can while running, and the move itself happens after you close him

1. prepare (in a running session)

  • create ~/.claude-personal
  • split the global CLAUDE.md in two - both keep the general parts (writing style, collaboration feedback…), each gets its own side's specifics (company tools and conventions on one, your git identity and public-repo rules on the other). the personal one goes straight to ~/.claude-personal/CLAUDE.md, the work one is written for after the move
  • skills/, settings.json (permissions, hooks, auto mode rules) - copy what the personal side needs, trim it to that side, and let the two diverge afterwards. something worth having on both sides later gets added on each side on its own (just ask both sessions)
  • copy your personal projects' folders from ~/.claude/projects/ to ~/.claude-personal/projects/ - the whole projects/<path>/ folder, not just memory/, the saved sessions (/resume history) live there too
  • set up the aliases or the .envrc files
  • write a script for the move (next step)

2. the move (all claude sessions closed)

close all claude sessions - running ones keep the old paths - and run the script. it:

  • renames ~/.claude -> ~/.claude-work, so the work side keeps its login, memory and sessions
  • moves ~/.claude.json into it (~/.claude-work/.claude.json) - it lives next to ~/.claude, not inside, and holds the login state, trusted folders and user-scope MCP servers
  • creates an empty ~/.claude - with no login there, a plain claude (or the IDE plugin's button) stops at the login screen instead of spending the wrong account's tokens
    • don't log in there out of habit - that's the one way the mix-up comes back

3. log in and check

  • start the personal side, /login with your own account
  • start the work side - it should still be logged in. if not, the .claude.json move went wrong, ask the session to check
  • /status on each side shows which account it's on - make sure the two differ
  • a plain claude outside both sides should stop at the login screen

4. clean up (in a work session)

  • fix hardcoded ~/.claude paths - they now point at the empty profile. hooks in settings.json, paths in the global CLAUDE.md, plugin and IDE settings
  • re-add the MCP servers the personal side needs - the user-scope ones went with .claude.json to the work side
  • once the personal side works, delete your personal projects' folders from ~/.claude-work/projects/

5. status line

show work / personal in each profile's status line (from CLAUDE_CONFIG_DIR), so a session in the wrong account is obvious at first glance - ask claude to set it up, /statusline

todo - the actual status line snippet, once it's done

gotchas

  • ANTHROPIC_API_KEY in your environment overrides the login - in both profiles. if it's set (.bashrc, .envrc, a project's .env loaded by your shell), both sides use that key
  • on macOS the login is kept in the keychain, not in the config dir - check with /status that the two profiles really have separate logins
  • todo - whatever else comes up during the actual switch…