cvm
Documentation
GitHub
How-to

Auto-activate with a .cvm file

Bind a repository (or subdirectory) to an environment the way direnv binds env vars.

  1. Confirm shell hooks are installed (cvm init) and reloaded after upgrades.
  2. Create a .cvm file in the project root:
    # Claude environment for this project
    project-backend-api

    First non-empty, non-# line wins.

  3. cd into the tree — hooks search upward, run cvm use, and set CVM_AUTO=1.
  4. Leave the tree — auto sessions deactivate. A manual cvm use clears CVM_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