Claude Code Environment Manager. ccenv lets you swap logical working states in a single Git checkout without worktrees.
- Bun v1.1+
- Git
- tar
curl -fsSL https://raw.githubusercontent.com/masudahiroto/ccenv/main/install.sh | bashOr manually clone the repo and run via Bun:
bun ./src/ccenv.ts --helpOptional: add a shell alias:
alias ccenv="bun /path/to/ccenv/src/ccenv.ts"Create and use an environment:
ccenv create feature-a
ccenv enter feature-a
# ...make changes...
ccenv exitActivate for convenience:
eval "$(ccenv activate feature-a)"
ccenv enterRun a one-off command inside an environment:
ccenv run --env feature-a -- sh -c "echo hello > example.txt"Apply environment changes onto the current workspace:
ccenv apply feature-aCheck system status:
ccenv statusUpdate ccenv to the latest version:
ccenv updateccenv can automatically manage environments for AI agents to prevent them from conflicting with your manual work or each other.
Install hooks for gemini-cli:
ccenv install gemini-cliThis configures .gemini/settings.json to automatically enter the active environment before tools run and exit afterwards.
Install hooks for claude-code:
ccenv install claude-codeThis configures .claude/settings.json to ensure Claude works safely within the ccenv managed environment.
ccenv snapshots Git state into .ccenv/envs/<name>:
staged.patchfor staged changesunstaged.patchfor unstaged changesuntracked.tar.gzfor untracked filesinfo.jsonfor metadata
enter stores the current workspace as default, cleans the tree, and restores the target env.
exit saves the env, cleans the tree, and restores default.
bun test.ccenv/is untracked by default. Avoid storing other data inside it.
