Skip to content

Zoltak-Dev/ai-multi-instance

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Claude / Codex Multi-Instance

Run multiple accounts of the Claude desktop app and the Codex desktop app on Windows. The official clients only support one account at a time. This tool launches each app with a dedicated profile directory per account, allowing several accounts to run side by side and be switched instantly.

Claude / Codex Multi-Instance preview

Press 8 to switch between Claude and Codex. Profiles, shortcuts, and protocol handlers (claude:// / codex://) are managed independently for each app.

Install

Windows 10+ and the Claude and/or Codex desktop app installed.

From source (recommended) — requires Python 3.9+:

git clone https://github.com/Zoltak-Dev/ai-multi-instance.git
cd ai-multi-instance
python main.py

No pip install — the project uses only the Python standard library.

Pre-built binary (no Python required) — download ai-multi-instance-vX.Y.Z-windows.zip from Releases, unzip both .exe files in the same folder, and run ai-multi-instance.exe.

📹 Video walkthrough — installing the binary and disabling Smart App Control:

walkthrough.mp4

⚠️ Windows blocks unsigned binaries by default. Windows refuses to run any .exe without a code-signing certificate (which costs 300-600 €/year — not viable for a free project). To run the .exe:

  1. Windows SecurityApp & browser controlSmart App Control settings → switch from On to Off
  2. Launch ai-multi-instance.exe. Windows will show "Windows protected your PC" → click More infoRun anyway

If you'd rather skip all this, use the source install above — no warning, no setup.

Usage

The menu is numbered. Pick an action, then pick a profile by its number. For actions that support it, you can pass several numbers separated by spaces (1 3 5) to run on multiple profiles at once.

Creating a profile also creates a desktop shortcut. Double-click the shortcut to launch that profile directly without opening the menu.

Profiles live in their own folders, kept fully separate per app:

  • ClaudeProfiles/<name>/ for Claude
  • CodexProfiles/<name>/ for Codex

Deleting the folder is the same as deleting the profile.

How multi-instance works

Claude and Codex use different mechanisms to enforce their single-instance behavior.

The Claude desktop app respects Chromium's standard --user-data-dir flag: different value, different singleton lock, allowing multiple instances to run side by side.

Codex behaves differently. Its bootstrap.js calls app.setPath('userData', ...) to a hardcoded path before app.requestSingleInstanceLock(), so the CLI flag never reaches the singleton check and any second launch exits immediately.

OAuth login patch

Optional, toggled from the menu (7), and managed independently for each app. Claude uses the claude:// protocol, while Codex uses codex://.

When enabled, OAuth callbacks (Google for Claude, OpenAI for Codex) are routed to the last profile launched for the corresponding app, instead of whichever installation currently owns the protocol handler.

It works by registering this tool as the claude:// / codex:// handler in HKCU\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\<scheme>, with a valid Windows UserChoice hash so the desktop app can't silently reclaim the registration on its next launch. Disable it from the menu to revert.

The patch is a registry entry, so it stays active after you close the menu.

Build

Standalone .exe build via PyInstaller, for shipping to users who don't have Python:

pip install pyinstaller
pyinstaller --onefile --console --name ai-multi-instance --clean --noconfirm main.py
pyinstaller --onefile --noconsole --name launcher --clean --noconfirm launcher.pyw

The two binaries land in dist/. Ship them in the same folder — ai-multi-instance.exe looks for launcher.exe next to itself to manage desktop shortcuts and protocol handlers for both Claude and Codex.

Pre-built binaries are attached to each release.

Star History

If this tool saved you some headache, a ⭐ on the repo is appreciated — it's the only feedback signal I get and it really helps the project gain visibility.

Star History Chart

License

MIT

About

Run multiple isolated instances of the Claude and Codex desktop apps on Windows. Manage multiple accounts and profiles simultaneously without logging out.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages