I Have Five Claude Accounts and No Idea Which One This Terminal Is Spending
说明与用途
Termexo 让用户在每个终端中查看并切换活跃的 Claude 账户,防止意外使用订阅,重启后恢复正确环境,并避免已登录账户的登录提示。
问题
Users running multiple Claude Code or Codex terminals cannot easily identify which account a terminal is using, leading to accidental subscription usage and confusion.
结果
Termexo allows users to see and switch the active Claude account per terminal without risking accidental usage, restores the correct environment after restarts, and prevents the first‑run wizard from prompting for login on already‑signed‑in accounts.
工作流
- 1. Prepare launch spec with desired accountProfileId, profileId, and mcpProfileId using prepareLaunch()
- 2. Close the running terminal with terminalGateway.close()
- 3. Restart the terminal with restartTerminalWithProfile() using the prepared command and profile information
- 4. On app restart, relaunch_environment() rebuilds the terminal’s environment from stored account data
证据
Termexo gives every managed account its own directory. "Switching accounts" therefore means changing an environment variable — and a running process cannot be told to change its own environment.
If preparation fails — the account directory cannot be created, a credential is gone — the error is thrown before close(), and the running session is untouched.
- 记录日期: 2026-09-08T01:53:09.496Z