I use Claude Code for both my personal projects and my day job. The problem: those are two totally different Microsoft environments with different rules. My work tenant is locked down and blocks third-party MCP servers. My personal setup has no such restriction and runs a bunch of MCPs. Cramming both into one config was messy — and risky, because the wrong tool or the wrong account could fire in the wrong context.
So I split it into two fully isolated profiles I switch between with a single command.
The key trick: CLAUDE_CONFIG_DIR
Claude Code loads its entire config from one directory — MCP servers, plugins, memory, permissions, even its own login. Point an environment variable at a different folder and you get a clean, completely separate profile.
Personal = the default ~/.claude (MCPs on)
Work = ~/.claude-work (no Microsoft MCP — CLI/REST only)
Nothing leaks between them. Different memory, different plugins, different permissions, different sign-in.
One command to switch
I dropped two functions into my PowerShell profile:
function claude-personal { $env:CLAUDE_CONFIG_DIR=$null; claude @args }
function claude-work { $env:CLAUDE_CONFIG_DIR="$env:USERPROFILE\.claude-work"; claude @args }
Now claude-work launches the locked-down work brain and claude-personal launches my normal one. That's the whole switch.
Why the work profile uses CLI instead of MCP
Since work won't allow MCP servers for Microsoft, the work profile's CLAUDE.md has a hard rule baked in:
No Microsoft MCP. Use CLI/REST only:
CLI for Microsoft 365, Azure CLI, Power Platform CLI, Graph.
Here's the insight that made this click for me: first-party Microsoft CLIs are usually allowed by corporate Conditional Access even when third-party MCP connectors are blocked — because you authenticate with Microsoft's own app IDs, not a third party's. So I didn't actually lose access to anything. I just reach it through the CLI/REST layer instead of an MCP tool. Same APIs underneath.
Bonus: I built it "MCP-ready"
If work ever approves MCP, I don't rebuild anything — the work profile has a commented block that turns the relevant MCP servers back on with one command. The CLI/REST setup just stays as a fallback.
Why I like it
Zero cross-contamination between work and personal
Each profile has its own memory, plugins, permissions, and login
Switch contexts in about one second
Compliant with work policy without crippling what I can do
If you're running Claude Code across multiple contexts — work, clients, personal — CLAUDE_CONFIG_DIR plus a couple of aliases is a really clean way to keep them apart.
Happy to share my full setup doc if that'd help anyone — just say the word in the comments. 👇