Skip to content

mickstar/claudenv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

claudenv

A Go CLI tool for managing multiple isolated Claude Code configuration environments.

Overview

claudenv allows you to maintain separate Claude Code configurations for different projects or workflows. It manages your ~/.claude directory and ~/.claude.json file by creating isolated environments under ~/.claudenv and using symlinks to switch between them seamlessly.

claudenv screenshot

Features

  • Multiple Environments: Create and manage isolated Claude configurations (main, work, personal, project-specific, etc.)
  • Safe Initialization: Automatically backs up your existing Claude config into a "main" environment
  • Easy Switching: Switch between environments with a single keypress
  • Interactive TUI: User-friendly terminal interface built with Bubble Tea
  • Smart Protection: Prevents accidental deletion of active or main environments
  • Empty Environment Detection: Different confirmation flows for empty vs. populated environments

Installation

Install via Go

go install github.com/mickstar/claudenv/cmd/claudenv@latest

Make sure $GOPATH/bin (usually ~/go/bin) is in your PATH.

Build from Source

git clone https://github.com/mickstar/claudenv.git
cd claudenv
go build -o claudenv ./cmd/claudenv

Note: Pre-built binaries are not provided to avoid the complexity of code signing requirements (especially for macOS). The Go installation method is simple and works across all platforms.

Usage

Simply run:

claudenv

First Run - Initialization

On first run, you'll be prompted to initialize the environment system:

  1. Press i to initialize
  2. Your existing ~/.claude and ~/.claude.json will be moved to ~/.claudenv/main/
  3. Symlinks will be created in their place

Managing Environments

Navigation:

  • ↑/↓ or k/j - Navigate between environments
  • Enter - Switch to the selected environment

Actions:

  • n - Create a new environment
  • d - Delete the selected environment
  • q or Ctrl+C - Quit

Creating an Environment:

  1. Press n to open the create dialog
  2. Enter a name for your environment
  3. Optionally toggle "Switch to this environment once created" (checked by default)
  4. Press Enter to create, or Esc to cancel

Deleting an Environment:

  1. Select the environment you want to delete
  2. Press d
  3. Confirm deletion:
    • For empty environments: Type y to confirm
    • For environments with data: Type DELETE (case-sensitive) to confirm

Note: You cannot delete the "main" environment or the currently active environment.

How It Works

claudenv creates a directory structure like this:

~/.claudenv/
├── main/
│   ├── .claude/
│   └── .claude.json
├── work/
│   ├── .claude/
│   └── .claude.json
└── personal/
    ├── .claude/
    └── .claude.json

When you switch environments, claudenv updates the symlinks:

  • ~/.claude~/.claudenv/<active-env>/.claude
  • ~/.claude.json~/.claudenv/<active-env>/.claude.json

Claude Code automatically populates these directories on first use, so new environments start empty and get configured naturally when you run Claude Code.

Configuration

claudenv stores its configuration in ~/.claudenv.json:

{
  "environments": [
    {"name": "main"},
    {"name": "work"},
    {"name": "personal"}
  ],
  "location": "/Users/username/.claudenv",
  "active": "main"
}

Requirements

  • Go 1.21 or later (for installation)
  • macOS, Linux, or Windows with symlink support

License

MIT License - see LICENSE file for details.

Author

Created by mickstar

Contributing

Issues and pull requests are welcome! Please feel free to contribute on GitHub.

About

The CLI utility for managing claude's environment files.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages