Skip to content

lephudao/ccacct

Repository files navigation

ccacct

Switch Claude Code (Claude.ai subscription) accounts on macOS using Keychain, then resume your last context via claude --continue.

This tool is macOS-only for now because it relies on Keychain.

Why this exists

Claude Code supports /login to switch accounts. This CLI adds:

  • profiles (save multiple Claude.ai subscription logins)
  • fast switching via Keychain
  • one command to switch + resume context (ccacct switch <profile>)

Install (from source)

npm i
npm run build
npm link

Install (after publishing)

npm i -g ccacct

First-time setup: save your profiles

For each account you want to save:

  1. Open Claude Code:
claude
  1. In Claude Code, run:
/login

and sign in to the desired Claude.ai account.

  1. Exit Claude Code, then save the current credential as a named profile:
ccacct save acc1

Repeat for your other accounts:

ccacct save acc2
ccacct save acc3

Switch account and keep context

From inside your project directory:

ccacct switch acc2

That will:

  1. switch the Keychain credential to acc2
  2. run claude --continue to resume your most recent session in this directory

Passing args through to claude

Use -- to pass arguments to claude:

ccacct switch acc2 -- --resume

Commands

  • ccacct save <profile> — save the currently logged-in Claude Code credential into a profile
  • ccacct use <profile> — switch to a profile (does NOT launch Claude)
  • ccacct switch <profile> -- [args] — switch then run claude --continue
  • ccacct list — list profiles (local index only; credentials are in Keychain)
  • ccacct doctor — quick environment checks

Security

  • Credentials are stored in macOS Keychain.
  • Profile index is stored at ~/.config/ccacct/profiles.json (names only).

Troubleshooting

  • If save says it can't read a credential: open claude, run /login, then try again.
  • If switch works but Claude still appears on the old account: in Claude Code run /status to confirm; some versions may store credentials under a slightly different Keychain service name. Open an issue with your ccacct doctor output.

License

MIT

About

No description, website, or topics provided.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published