Claude environment manager - switch between Claude Code configurations
Project description
cenv - Claude Environment Manager
Manage isolated Claude Code configurations like pyenv manages Python versions. Switch between different Claude setups (work, personal, experiments) with complete isolation.
Installation
# Install from PyPI (recommended)
pip install claude-env
# Or using uvx (no installation required)
uvx claude-env --help
# Or install from source with uv (for development)
git clone https://github.com/vtemian/claude-env.git
cd claude-env
uv pip install -e .
# Or using pip
pip install -e .
Quick Start
# Initialize cenv (migrates your current ~/.claude to default environment)
cenv init
# Create a new environment for work
cenv create work
# Switch to work environment
cenv use work
# List all environments (* marks active)
cenv list
# Show current environment
cenv current
# Delete an environment
cenv delete work
Features
- Complete Isolation: Each environment has its own CLAUDE.md, settings.json, agents, plugins
- Symlink-based: Fast switching with no data copying
- Safety Checks: Warns when Claude is running
- GitHub Templates: Clone environment configs from repositories
- Shared Credentials: API keys stored in macOS Keychain work across all environments
Configuration
cenv can be configured via environment variables or a config file.
Config File
Create ~/.cenvrc:
# Git operation timeout in seconds (default: 300)
git_timeout = 600
# Logging level (default: INFO)
log_level = DEBUG
Environment Variables
export CENV_GIT_TIMEOUT=600
export CENV_LOG_LEVEL=DEBUG
Configuration Precedence
- Environment variables (highest priority)
~/.cenvrcfile- Built-in defaults (lowest priority)
Available Options
CENV_GIT_TIMEOUT/git_timeout: Git operation timeout in seconds (default: 300)CENV_LOG_LEVEL/log_level: Logging level - DEBUG, INFO, WARNING, ERROR, CRITICAL (default: INFO)
Commands
cenv init
Initialize cenv by migrating your existing ~/.claude to ~/.claude-envs/default/.
cenv init
cenv create <name>
Create a new environment. By default, copies from the default environment.
# Create from default
cenv create work
# Create from GitHub repository
cenv create work --from-repo https://github.com/user/claude-work-setup
cenv use <name>
Switch to a different environment. Prompts for confirmation if Claude is running.
cenv use work
# Force switch without confirmation
cenv use work --force
cenv list
List all available environments. Active environment is marked with →.
cenv list
cenv current
Show the currently active environment.
cenv current
cenv delete <name>
Delete an environment. Cannot delete the default environment or currently active environment.
cenv delete work
# Skip confirmation
cenv delete work --force
How It Works
cenv uses symlinks for fast, efficient environment switching:
~/.claude → symlink to active environment
~/.claude-envs/
├── default/ Your original setup
├── work/ Work configuration
└── personal/ Personal configuration
Each environment contains:
CLAUDE.md- Global instructionssettings.json- Settings and preferencesagents/- Custom agentsplugins/- Installed pluginshistory.jsonl,sessions/, etc.
Use Cases
Work vs Personal: Separate configurations for professional and personal use
cenv create work
cenv create personal
Experimentation: Test new plugins or settings without affecting your main setup
cenv create experiment
# Try new things...
cenv delete experiment
Team Templates: Share environment configs via GitHub
cenv create work --from-repo https://github.com/company/claude-work-template
Security
- Git clone operations use shallow clones (
--depth 1) and have a 5-minute timeout - All operations use custom exception types for better error handling
- Comprehensive logging available with
--verboseflag - See SECURITY.md for security considerations
Logging
Enable verbose logging:
cenv --verbose list
Write logs to file:
cenv --log-file ~/cenv.log list
Trash and Recovery
Deleted environments are moved to trash instead of permanently deleted:
# Delete an environment (moves to trash)
cenv delete myenv
# List deleted environments
cenv trash
# Restore from trash
cenv restore myenv-20251111-143022
Development
# Install with dev dependencies
make install
# Run tests (fast)
make test
# Run tests with coverage
make test-cov
# Run type checking (strict)
make typecheck
# Run linting
make lint
# Auto-fix linting issues
make format
# Run all checks (lint + typecheck + test-cov)
make check
# Clean build artifacts
make clean
License
MIT
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file claude_env-0.1.0.tar.gz.
File metadata
- Download URL: claude_env-0.1.0.tar.gz
- Upload date:
- Size: 126.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e5d2f0a3c4cc4b4fbeb2646f07d53bee5e171d9bd7d81a1db055a1c23819500e
|
|
| MD5 |
ac291d1b8b0a2849c868f4cde0ca5e62
|
|
| BLAKE2b-256 |
d547ad4b8ec3df3949b56600a6514344e9d6f64be3a98f74ee229e58e1c95ef7
|
Provenance
The following attestation bundles were made for claude_env-0.1.0.tar.gz:
Publisher:
publish.yml on vtemian/claude-env
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
claude_env-0.1.0.tar.gz -
Subject digest:
e5d2f0a3c4cc4b4fbeb2646f07d53bee5e171d9bd7d81a1db055a1c23819500e - Sigstore transparency entry: 696663830
- Sigstore integration time:
-
Permalink:
vtemian/claude-env@ace3f6b04d4ad824b1e05c797a694e7d11909541 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/vtemian
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ace3f6b04d4ad824b1e05c797a694e7d11909541 -
Trigger Event:
push
-
Statement type:
File details
Details for the file claude_env-0.1.0-py3-none-any.whl.
File metadata
- Download URL: claude_env-0.1.0-py3-none-any.whl
- Upload date:
- Size: 18.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8a241793185753b3bd706b451d29de7c2f97f7ca0de6bc39b443afdfab7c97b7
|
|
| MD5 |
94faedfb7ca08b09d3dcffedce0c5770
|
|
| BLAKE2b-256 |
fdff8cc0efdae04090952b91ecf528ef219b369131dec1303d0946388f7c754d
|
Provenance
The following attestation bundles were made for claude_env-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on vtemian/claude-env
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
claude_env-0.1.0-py3-none-any.whl -
Subject digest:
8a241793185753b3bd706b451d29de7c2f97f7ca0de6bc39b443afdfab7c97b7 - Sigstore transparency entry: 696663918
- Sigstore integration time:
-
Permalink:
vtemian/claude-env@ace3f6b04d4ad824b1e05c797a694e7d11909541 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/vtemian
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ace3f6b04d4ad824b1e05c797a694e7d11909541 -
Trigger Event:
push
-
Statement type: