Summary
After installing via npx claude-code-multi-accounts install, every cc-switch invocation crashes immediately with MODULE_NOT_FOUND, because the published package is missing bin/lib/actions/rename.cjs.
Reproduction
npx claude-code-multi-accounts install
node ~/.claude/multi-account-switch/bin/cc-switch.cjs # or `cc-switch`
Output:
Error: Cannot find module './lib/actions/rename.cjs'
Require stack:
- ~/.claude/multi-account-switch/bin/cc-switch.cjs
at Module._resolveFilename (node:internal/modules/cjs/loader)
...
code: 'MODULE_NOT_FOUND'
Cause
bin/cc-switch.cjs:17 does:
const renameAction = require('./lib/actions/rename.cjs');
…and renameAction.runRenameAction is wired in (the --rename / rename path). But bin/lib/actions/ only ships:
list.cjs remove.cjs switch.cjs sync.cjs usage.cjs
rename.cjs is absent, so the require throws at load time and the whole CLI is unusable (not just the rename subcommand).
Suggested fix
Ship bin/lib/actions/rename.cjs exporting runRenameAction. It is called as:
runRenameAction(existingStore, renameIndex, aliasString, {
writeStore, options, config,
getEntryLabel, getDisplayAccounts,
getStoredAccountsHeading, formatAccountSummary,
});
so it just needs to set/clear entry.alias on the indexed account, writeStore(...), then print the stored-account list — mirroring remove.cjs. (Likely the file just wasn't included in the npm files allow-list / publish.)
Environment
- Installed via
npx claude-code-multi-accounts install
- Internal
STORE_VERSION 0.2.9
- macOS (Darwin), Node.js v25.9.0
Summary
After installing via
npx claude-code-multi-accounts install, everycc-switchinvocation crashes immediately withMODULE_NOT_FOUND, because the published package is missingbin/lib/actions/rename.cjs.Reproduction
Output:
Cause
bin/cc-switch.cjs:17does:…and
renameAction.runRenameActionis wired in (the--rename/renamepath). Butbin/lib/actions/only ships:rename.cjsis absent, so therequirethrows at load time and the whole CLI is unusable (not just the rename subcommand).Suggested fix
Ship
bin/lib/actions/rename.cjsexportingrunRenameAction. It is called as:so it just needs to set/clear
entry.aliason the indexed account,writeStore(...), then print the stored-account list — mirroringremove.cjs. (Likely the file just wasn't included in the npmfilesallow-list / publish.)Environment
npx claude-code-multi-accounts installSTORE_VERSION0.2.9