Search for Python virtualenv in .venv/

Status Closed — not planned
Maintainer reply None cached
Activity 11 comments · opened Mar 2, 2025 · closed Jan 8, 2026

I usually create a virtualenv as a dotfile/dotdir for Python projects, naming it .venv/, which is the standard convention for Pycharm projects. However, I’ve noticed that claude-code searches for virtualenv directories (ex. venv/) within the project directory but doesn’t automatically discover the hidden one.

As a result, it often requires manual prompting to source the virtual environment after each compact. To address this issue, I’ve added an instruction to CLAUDE.md to locate my virtual environment in that directory, but it seems to be largely ignored.

I believe this can be divided into two enhancements:

  • Improve Python project virtualenv detection by checking for .venv/ during /init and other relevant times
  • If possible, enhance the ability to follow setup instructions from CLAUDE.md about virtualenv more consistently or make it "sticky" (?)

View original on GitHub ↗

This issue has 11 comments on GitHub. Read the full discussion on GitHub ↗