How-to
Auto-activate with a .cvm file
Bind a repository (or subdirectory) to an environment the way direnv binds env vars.
- Confirm shell hooks are installed (
cvm init) and reloaded after upgrades. - Create a
.cvmfile in the project root:# Claude environment for this project project-backend-apiFirst non-empty, non-
#line wins. cdinto the tree — hooks search upward, runcvm use, and setCVM_AUTO=1.- Leave the tree — auto sessions deactivate. A manual
cvm useclearsCVM_AUTO(pinned) so leaving the directory does not deactivate.
direnv alternative
while IFS='=' read -r key value; do
export "$key=$value"
done < <(cvm __resolve-activate project-backend-api)
PATH="$CLAUDE_CONFIG_DIR/bin:$PATH"
export PATH