Claude-switch CLI tool automates switching between Claude Max accounts when hitting usage caps

✍️ OpenClawRadar📅 Published: March 18, 2026🔗 Source
Claude-switch CLI tool automates switching between Claude Max accounts when hitting usage caps
Ad

Problem and solution

A developer encountered workflow interruptions when Claude Code hit usage caps during coding sessions. Having multiple Claude Max accounts helped, but manually switching between them required logging out, opening a browser, logging back in, and waiting for authentication to complete - a process that "killed the flow every time."

The developer used Claude Code itself to build claude-switch, a tool that automates credential switching. The irony noted: "the tool hitting my limits helped me build the workaround."

Technical implementation

The entire tool is about 250 lines of bash, written and shipped in one Claude Code session. It works by reading and writing the auth tokens Claude Code stores in the macOS system Keychain. The developer describes the approach as "nothing clever, just the same credential swap you'd do manually."

Ad

Usage commands

First-time setup requires saving both accounts:

claude-switch save work
claude-switch save personal

When hitting a usage cap mid-session:

claude-switch use personal

The tool also includes functionality to list saved accounts and has zsh completions.

Availability and testing

claude-switch is free, open source under MIT license, with installation instructions in the GitHub repository README. The developer notes limited testing: "I've only tested it on my machine so far" and welcomes feedback, "especially if it breaks on your setup."

📖 Read the full source: r/ClaudeAI

Ad

👀 See Also