[BUG] When working with python, venvs are ignored
Environment
- Platform (select one):
- [x] Anthropic API
- [ ] AWS Bedrock
- [ ] Google Vertex AI
- [ ] Other:
- Claude CLI version: 1.0.35 (Claude Code)
- Operating System: Debian Sid
- Terminal: Ghostty
Bug Description
When doing python development, the basic hygiene is to use a venv somehow. I've had to manually command the model to use venvs and not try to install global python packages when it's really inappropriate to do so. This should at least ideally be pretty basic practice for it, but multiple times now I've run into sessions that attempt to work on the global python.
Steps to Reproduce
- Start a session on a python project, could have a venv already or not
- Prompt something about code changes or python packages
Expected Behavior
Claude should know better than to try to call pip on global python unless the situation specifically requires it. It seems to me like this is common enough knowledge in its training data that it should be a frequent part of the commands it requests to run. It should check for venvs or ask about them and then source them.
Actual Behavior
Tries to call global pip or tries to use global python package versions when venv is present.