Skip to content

HudsonGraeme/claudeenv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

claudeenv

claudeenv is a lightweight, Rust-based CLI tool (similar to nvm for Node) that allows you to seamlessly manage and switch between multiple Claude Code accounts or credential profiles.

By default, Claude Code writes its authentication state directly to ~/.claude.json. This makes it difficult to maintain separate personal, work, or client accounts on the same machine.

claudeenv solves this by introducing named profiles stored cleanly in ~/.claudeenv/profiles/ and safely symlinking the active profile directly to ~/.claude.json. When Claude Code refreshes its authentication token, the changes are automatically saved into your active profile.

Installation

You can install the pre-compiled binary for macOS or Linux with a single command:

curl -fsSL https://raw.githubusercontent.com/HudsonGraeme/claudeenv/main/install.sh | bash

This script will download the latest release binary for your architecture (x86_64, aarch64) and place it in ~/.local/bin. Ensure that ~/.local/bin is in your $PATH.

Build from source

If you have Cargo installed:

cargo install --path .

Usage

The CLI mimics familiar profile managers:

Add a Profile

Copies your currently active Claude Code credentials (if any) into a new named profile. If you have no active credentials, it creates an empty profile and spawns claude login for you automatically!

claudeenv add work

Switch Profiles

Safely backs up any existing ~/.claude.json file, and establishes a symlink to the specified profile.

claudeenv use work

List Profiles

Shows all discovered profiles. The currently active profile is marked with an *.

claudeenv list

View Current Profile

Prints the name of the active profile (based on where the symlink points).

claudeenv current

Remove a Profile

Deletes the specific profile completely. Cannot be used to delete the currently active profile.

claudeenv remove personal

About

Easy multi-accounting for Claude Code

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors