npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

ccrotate

v1.0.13

Published

A simple CLI tool to manage and rotate multiple Claude Code accounts, helping you bypass rate limits

Downloads

69

Readme

🔄 ccrotate

Seamlessly rotate between multiple Claude accounts to bypass rate limits

A powerful CLI tool designed for claude-code users who need to manage multiple Claude accounts efficiently. Say goodbye to rate limit frustrations! 🚀

npm version License: MIT Node.js

✨ Features

  • 🔀 Smart Account Rotation - Switch between accounts with a single command
  • 📸 Snapshot Management - Save your current Claude session instantly
  • 🎯 Intelligent Switching - Automatic next-account detection with fallback
  • 💾 Safe Storage - Atomic file operations prevent data corruption
  • 📦 Backup & Restore - Export/import profiles with compression and integrity checking
  • 🔄 Account Testing - Verify and refresh tokens automatically
  • 🎨 Beautiful CLI - Colorful, intuitive interface with clear feedback
  • Lightning Fast - Quick account switches without losing context
  • 📦 Optimized Distribution - Single executable with minimal runtime dependencies

🚀 Quick Start

Installation

npm install -g ccrotate

Basic Usage

  1. Login to your first Claude account using claude-code
  2. Save your account: ccrotate snap
  3. Login to another account and repeat step 2
  4. Start rotating: ccrotate next or ccrotate switch [email protected]

📖 Commands

📸 ccrotate snap [--force]

Save your currently active Claude account credentials.

ccrotate snap              # Save with confirmation prompt
ccrotate snap --force      # Force save without confirmation

📋 ccrotate list (alias: ls)

Display all saved accounts with status indicators.

ccrotate list
# Output:
# Saved Accounts:
# ★ 1. [email protected] (last used: 1/15/2024)
#   2. [email protected] (last used: 1/14/2024)

🔄 ccrotate switch <email>

Switch to a specific account by email address.

ccrotate switch [email protected]
# ✓ Switched to account: [email protected]

⏭️ ccrotate next

Rotate to the next account in your saved list.

ccrotate next
# Switching: [email protected] -> [email protected]
# ✓ Switched to account: [email protected]

🗑️ ccrotate remove <email> (alias: rm)

Remove a saved account from your rotation.

ccrotate remove [email protected]
# ? Are you sure you want to remove account [email protected]? No / Yes

📤 ccrotate export

Export all saved profiles as a compressed, shell-safe string with CRC verification.

ccrotate export
# ✓ Profiles exported (Shell-Safe compression + CRC verification):
# 3 accounts: 2146 → 1209 chars (-44%)
# CRC32: f7dd8ae3 (data integrity guaranteed)
# 
# "mp-gz-b64:f7dd8ae3:H4sIAAAAAAAAA5XRT..."

📥 ccrotate import <data>

Import profiles from a compressed string with automatic CRC verification.

ccrotate import "mp-gz-b64:f7dd8ae3:H4sIAAAAAAAAA5XRT..."
# ✓ CRC verification passed: f7dd8ae3
# Found 3 accounts to import:
# [email protected], [email protected], [email protected]
# ? Do you want to proceed with the import? Yes
# ✓ Successfully imported 3 accounts.

🔄 ccrotate refresh (alias: rf)

Test all saved accounts and refresh expired tokens automatically.

ccrotate refresh
# 🔄 Testing accounts and refreshing tokens...
# 1  [email protected]  ✅ Active    Hi there! How can I assist you today?
# 2  [email protected]  ❌ Failed    Invalid or expired token
# 3  [email protected]  ✅ Active 🔄 Hi! I'm Claude, an AI assistant...

🏗️ How It Works

ccrotate manages your Claude accounts by:

  1. Reading current credentials from ~/.claude/.credentials.json and ~/.claude.json
  2. Storing account profiles in ~/.ccrotate/profiles.json
  3. Switching accounts using atomic file operations for safety
  4. Identifying accounts by email from oauthAccount.emailAddress
  5. Compressing data using MessagePack + Gzip + Base64 for efficient backup/restore

Data Structure

{
  "[email protected]": {
    "credentials": { /* Full credentials.json content */ },
    "userId": "user-id-here",
    "oauthAccount": { 
      "emailAddress": "[email protected]",
      /* Other OAuth info */
    },
    "lastUsed": "2024-01-15T10:30:00.000Z"
  }
}

🔧 Requirements

  • Node.js 18.0.0 or higher
  • claude-code CLI tool installed and configured
  • Cross-platform support (Windows, Linux, macOS)

⚠️ Important Notes

  • Account Safety: This tool works with session-based tokens. Please be mindful of Claude's terms of service.
  • Data Security: Credentials are stored in plain text, consistent with claude-code's approach.
  • Backup Recommended: Consider backing up your ~/.ccrotate/ directory.

🛠️ Development

# Clone and install
git clone https://github.com/somersby10ml/ccrotate.git
cd ccrotate
pnpm install

# Development build with sourcemap
pnpm run build:dev

# Production build (minified)
pnpm run build

# Test locally with source
node bin/ccrotate.js --help

# Test built CLI
./dist/cli.js --help

# Package testing (dry-run)
pnpm run publish:dist:dry

# Publish to npm
pnpm run publish:dist

🏗️ Build System

ccrotate uses esbuild for optimized distribution:

  • Source: bin/ccrotate.js + lib/ directory
  • Output: Single dist/cli.js executable with external runtime dependencies
  • Optimized dependencies: Only core libraries (React Ink, Commander, Chalk) are installed
  • Package size: ~15KB unpacked, ~5KB compressed (excluding dependencies)

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.

📝 License

This project is licensed under the MIT License - see the LICENSE file for details.

🌟 Support

If ccrotate helps you manage your Claude accounts better, consider:

  • ⭐ Starring this repository
  • 🐛 Reporting issues on GitHub
  • 💡 Suggesting new features