logo
Kurashizu Blogwhere ideas flow
  • Home
  • News
  • Blog
  • About
  • Home
  • News
  • Blog
  • About

© 2026 Kurashizu. All rights reserved.

Admin·New Post·Service Status
Powered by Cloudflare·01.11.26
← Back to news

Show HN: Claude-account – switch Claude Code accounts without logging in again

Original article
github.com|20 points|17 comments|by hamza_rehman|Jul 30, 2026

🛠️ Claude-account: Multi-Profile Management for Claude Code

CI Release License: MIT

Claude-account is a specialized utility designed exclusively for Linux users to seamlessly toggle between multiple, isolated Claude Code accounts. Instead of the tedious process of logging out and back in, this tool manages separate environments for different identities.

⚙️ How it Works

The tool acts as a "shim" (a wrapper). It assigns a unique CLAUDE_CONFIG_DIR to every profile you create and transparently forwards your commands to the actual Claude executable.


📋 Prerequisites

Before installing, ensure your system meets these criteria:

  • OS: Linux
  • Software: An existing installation of Claude Code
  • Build Tools: Rust version 1.85 or higher (only if building from source)

🚀 Installation Guide

Option A: Using a Pre-built Release

  1. Grab the claude-account-v0.1.1-x86_64-unknown-linux-gnu.tar.gz and the corresponding .sha256 file from the latest releases page.
  2. Verify the integrity and install via the terminal:
# Verify checksum
sha256sum --check claude-account-v0.1.1-x86_64-unknown-linux-gnu.tar.gz.sha256

# Extract and install
tar -xzf claude-account-v0.1.1-x86_64-unknown-linux-gnu.tar.gz
./claude-account install

[!IMPORTANT] After installation, the tool will provide an export PATH=... command. You must run this to add the shim to your environment.

This tool replaces the official Claude binary. Correction: The shim lives in its own directory and simply sits ahead of the official executable in your PATH.

Verify Installation:

type -a claude
claude account list

The claude-account path should be listed before the official Claude path.

Option B: Building from Source

git clone https://github.com/hamzarehmandeveloper/claude-account.git
cd claude-account
cargo build --locked --release
./target/release/claude-account install

🛠️ Command Reference

ActionCommandDescription
Add Profileclaude account add <name>Starts the official login flow.
Add (Email)claude account add <name> --email <email>Specify a login email.
Add (SSO)claude account add <name> --ssoUse Single Sign-On.
Add (Console)claude account add <name> --consoleUse console-based login.
Switchclaude account use <name>Sets the active profile for new sessions.
List Allclaude account listDisplays all configured profiles.
Check Currentclaude account currentReturns only the active profile name (script-friendly).
Removeclaude account remove <name>Logs out and unregisters the profile.

Nuances of Account Management:

  • Onboarding: When adding an account, the tool completes the local onboarding, meaning subsequent launches won't prompt for authentication.
  • Session Persistence: Switching profiles only affects new Claude processes; active sessions remain tied to the account they started with.
  • Data Deletion: By default, remove keeps settings and history. To wipe everything:
    • claude account remove <name> --purge --yes
    • Note: You cannot remove the active profile without the --force flag.

Passing Commands to Claude

Any command that isn't an account subcommand is passed directly to the official CLI:

  • claude "fix this bug in main.py"
  • claude --model opus
  • claude auth status --text

📂 Technical Architecture

Storage Logic

The application follows XDG standards. The storage path can be mathematically represented as: Storage={XDG_CONFIG_HOME∪XDG_DATA_HOME}\text{Storage} = \{ \text{XDG\_CONFIG\_HOME} \cup \text{XDG\_DATA\_HOME} \}Storage={XDG_CONFIG_HOME∪XDG_DATA_HOME}

Default Paths:

  • State: ~/.config/claude-account/state.json
  • Profiles: ~/.local/share/claude-account/profiles/
  • Binaries: ~/.local/share/claude-account/bin/claude
  • Executables: ~/.local/share/claude-account/libexec/claude-account

Pro Tip: Use the CLAUDE_ACCOUNT_HOME environment variable to consolidate all data into one directory.

Authentication Isolation

To prevent environment leaks, the wrapper strips the following variables from the child process:

  • ANTHROPIC_API_KEY
  • ANTHROPIC_AUTH_TOKEN
  • CLAUDE_CODE_OAUTH_TOKEN

If you need these variables to override the profile settings, set CLAUDE_ACCOUNT_PRESERVE_AUTH_ENV=1.


👨‍💻 Development

For contributors, use the following workflow:

  • Formatting: cargo fmt --check
  • Testing: cargo test --locked --all-targets
  • Linting: cargo clippy --locked --all-targets -- -D warnings

Refer to CONTRIBUTING.md for the workflow and SECURITY.md for reporting vulnerabilities.