claude-account 是一款仅适用于 Linux 的 Claude Code 账户切换工具,它为每个账户提供独立的配置目录,同时将命令透明地转发给官方的 Claude 可执行文件。

Stars

28

7 天增长

暂无数据

Fork 数

3

开放 Issue

0

开源协议

MIT

最近更新

2026-07-30

AI 仓库情报摘要
FR-AI / ANALYSIS

为什么值得关注

它解决了在同一个 Linux 系统上使用多个 Claude Code 账户(例如工作和个人)的实际痛点,无需重复安装整个 Claude 或直接处理凭据。

适合谁使用

  • 需要在 Linux 上管理多个 Claude Code 账户的用户(如工作与个人)
  • 开发团队或共享机器上使用不同 Claude Code 账户的成员
  • 希望通过脚本或自动化方式切换 Claude Code 账户的高级用户
  • 同时使用个人项目和公司订阅 Claude Code 的人员

典型使用场景

  • 在工作与个人 Claude Code 账户之间快速切换,免除重复登录的麻烦
  • 在 CI 或自动化任务中使用专用账户运行 Claude Code
  • 在同一个机器上测试不同订阅等级的 Claude Code 行为
  • 安全删除不再使用的凭据和个人数据,同时保留设置以便日后复用

项目优势

  • 将凭据存储完全交给 Claude Code,从不读取或复制令牌
  • 遵循 XDG 基础目录规范,并可通过 CLAUDE_ACCOUNT_HOME 覆盖
  • 透明转发:所有非账户相关的命令和参数原样传递给真实 claude 可执行文件
  • 附带简单的安装程序和垫片(shim),不替换官方二进制文件

使用前须知

  • 仅支持 Linux,不支持 macOS 或 Windows
  • 若未使用预编译发布版,需 Rust 1.85+ 从源码构建
  • 仅适用于 Claude Code,不适用于其他 Anthropic 工具或 API

README 快速开始

claude-account

A Linux-only profile switcher for Claude Code. It gives Claude Code an isolated CLAUDE_CONFIG_DIR for each account and transparently forwards normal commands to the official Claude executable.

claude account add work
claude account add personal
claude account use work
claude account list
claude account current
claude account remove personal

claude
claude "fix this bug in main.py"

Claude Code itself performs login, logout, credential storage, and token refresh. claude-account never reads or copies credential contents.

[!IMPORTANT] This is an independent community project. It is not made, endorsed, or supported by Anthropic. Claude and Claude Code are products of Anthropic.

Requirements

  • Linux
  • A working Claude Code installation
  • Rust 1.85 or later to build from source

Install a release

Download claude-account-v0.1.1-x86_64-unknown-linux-gnu.tar.gz and its .sha256 file from the [latest release][releases], then verify and install it:

sha256sum --check claude-account-v0.1.1-x86_64-unknown-linux-gnu.tar.gz.sha256
tar -xzf claude-account-v0.1.1-x86_64-unknown-linux-gnu.tar.gz
./claude-account install

The installer prints one export PATH=... line. Add that line to ~/.bashrc and open a new terminal. The shim lives in its own directory; it does not replace the official Claude executable.

Confirm the installation:

type -a claude
claude account list

The claude-account shim should appear before the official Claude executable.

Build from source

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

Commands

Add an account

claude account add work
claude account add personal --email you@example.com
claude account add company --sso
claude account add api-billing --console

This opens Claude Code's official login flow. The first profile becomes active. Adding another profile does not switch the active profile. The command also completes Claude Code's local onboarding state, so the next claude launch uses the saved login without asking you to authenticate again.

Switch accoun

项目描述

Switch between isolated Claude Code accounts on Linux without logging in again.

相关仓库与替代方案

根据分类、Topic 和编程语言匹配的相似项目。

programmersd21
精选
programmersd21 GitHub avatar

flow

flow is a minimalist terminal dashboard that displays real-time network throughput with smooth animations, multiple responsive modes, and zero configuration.

开发者工具CLI 与终端
277
S40911120
精选
S40911120 GitHub avatar

recensa

Recensa is a self-hosted web viewer that indexes Claude Code session transcripts into a local SQLite database, enabling full-text search, replay, and audit of all past agent conversations without uploading data anywhere.

AI 与机器学习大语言模型
67
l0ng-ai
精选
l0ng-ai GitHub avatar

tty7

tty7 is a fast, GPU-accelerated terminal workbench with persistent sessions, built-in input tools, SSH support, and coding agent awareness.

开发者工具CLI 与终端
359