Skip to content

v2.2.0 - Per-account variables, flags and links

Latest

Choose a tag to compare

@PriyanshuGeTRekT PriyanshuGeTRekT released this 02 Nov 17:25
c62dff7

Per-account settings for people who run tools against their accounts: environment variables, launch flags, and claude:// links that open where you want them.

Thanks to @orty for the environment variables (#11) and to @Reel-Box for the launch flags and link proposal (#8).

New

  • Environment variables per account (#11). "ProfileEnv": { "Work": { "MY_VAR": "value" } } in %LOCALAPPDATA%\ClaudeProfiles\settings.json sets those variables only for the Claude the switcher starts for that account, so an MCP server or tool can tell your accounts apart.
  • Launch flags per account (#8). "ProfileArgs": { "Work": "--flag --other=1" } (or a list) goes on every launch of that account, from the window, the tray, -Launch, links and the shortcuts you already have.
  • Open a claude:// link in a chosen account (#8). -OpenLink <url> -Account Work opens one link there, whether sign-in routing is on or not. -OpenLinksIn Work remembers an account for every link that is not a sign-in, such as a link to a Claude Code session; with sign-in routing on, the router sends them there instead of your original account. -OpenLinksIn Default undoes it, and -Status shows where other links go.

For all three, keys are the profile's folder id (the name -List shows in brackets, or the plain name when there are none). Two limits apply: a copy that is already running keeps the environment and flags it started with, and Default on the Store build starts through the shell, which takes neither.

Fixed

  • Under PowerShell 7, an environment variable set for one account's launch was left behind, empty, in the switcher's process, so a later launch of another account from the same process would have inherited it. The shortcuts run under Windows PowerShell 5.1, where this did not happen; it mattered only if you ran the switcher from pwsh yourself.

Downloads

File Use it if you want to
Install-ClaudeProfileSwitcher.cmd Install or upgrade in one step. Double-click it; it downloads the latest script, installs it and opens the switcher.
ClaudeProfileSwitcher-v2.2.0.zip Get everything offline. Unzip, then double-click Install.cmd, or Claude Profile Switcher.cmd to run it without installing.
ClaudeSwitcher.ps1 Just the script, for PowerShell users or the one-line install below.
SHA256SUMS.txt Check a download with Get-FileHash <file>.
irm https://github.com/PriyanshuGeTRekT/Claude-Code-Desktop-Switcher/releases/latest/download/ClaudeSwitcher.ps1 -OutFile "$env:TEMP\ClaudeSwitcher.ps1"; powershell -ExecutionPolicy Bypass -File "$env:TEMP\ClaudeSwitcher.ps1" -Install

Upgrading from 2.1.0 changes nothing you did not ask for: your accounts, sign-ins, names, shortcuts and settings stay as they are.

Tested

  • The five test suites pass in CI on Windows PowerShell 5.1 and PowerShell 7, including the new ProfileLaunch suite for these settings.
  • Launch flags, environment variables, -OpenLink and -OpenLinksIn were run end to end on Windows 11 against a stand-in Claude.exe that records what it receives: the folder, then the flags, then the link, with the account's variables set.
  • Not run against a real second account: opening a real Claude Code session link with -OpenLink. If a session link opens in the right account but does not resolve there, please say so on #8.

Known gaps

  • Huorong antivirus has been reported to delete the switcher's shortcuts as Trojan/LNK.Runner.ad (#10). The shortcuts run a headless PowerShell, which is what that signature looks for. A bisect is under way on the issue to find which part of the launch chain trips it; a supported option will follow.
  • After Claude's idle auto-update force-closes every window, only your original account comes back (#9). A watchdog that reopens your other accounts is being worked on.
  • The installer (non-Store) build is still untested end to end by the maintainer.

Full changes: v2.1.0...v2.2.0