When you open a Python project, the environment already active in your terminal may differ from the one its author intended. Anaconda-detect-env reports both the environment it selected and the file that led it there, so you can check the choice before running a script.

Find the environment name

The tool first looks for an explicit name in .claude/conda-env, then for the name field in environment.yml. It also checks conda-lock.yml, pyproject.toml, setup.cfg, and .python-version. If the project offers no clues and your machine has just one environment besides base, it selects that environment.

Check the result and run the script

Run this command from the tool’s repository, replacing the example path with the directory of the project you want to inspect.

python scripts/detect_conda_env.py --project-dir /path/to/project

In the output, detected_env gives the environment name and detection_source tells you where it came from. Check env_exists to see whether that environment is installed locally. If it is, use suggested_command to run your script. If it is missing, the tool suggests a command to create it.

Read the project README and see an example of the output