Problem Overview
If type-checking is not using your project’s.venv dependencies, or you see venv_path=None in logs, this guide will help you diagnose and fix the issue.
Why .venv Might Not Switch
Cache Behavior: Late .venv Creation
Cache Behavior: Late .venv Creation
This is the most common reason.Scenario:
Why does this happen? typemux-cc caches the venv for each document on first open. If
.venv doesn’t exist yet (e.g., created later by a hook or script), the cache stores None. Subsequent requests reuse the cached value without re-searching.- You create a git worktree:
git worktree add ../my-project-worktree feat/new-feature - Claude Code opens a file from the worktree (no
.venvexists yet) - typemux-cc caches
venv_path=Nonefor that file - You create
.venv:cd ../my-project-worktree && uv sync - Type-checking still doesn’t work because the cache still has
None
.venv (see below).Missing pyvenv.cfg
Missing pyvenv.cfg
typemux-cc only recognizes If it doesn’t exist, your “virtualenv” might be:
.venv directories that contain a pyvenv.cfg file. This is intentional to avoid silently using the wrong environment.Check if pyvenv.cfg exists:- A conda environment (not supported)
- A Poetry environment (not supported)
- A manually created directory without proper venv structure
File Outside Git Repository
File Outside Git Repository
typemux-cc searches for If this returns an error, the file is not in a git repository.Solution: Initialize a git repository:
.venv upward from the file location, stopping at the git repository root. If the file is outside a git repository, venv detection may fail.Check if file is in a git repo:typemux-cc works without git, but uses repository boundaries to determine where to stop searching for
.venv. This prevents searching too far up the filesystem tree.Symlinked .venv Directory
Symlinked .venv Directory
If If it shows
.venv is a symlink, venv detection may fail in some cases depending on how symlinks are resolved.Check if .venv is a symlink:->, it’s a symlink.Solution: Use an actual directory instead of a symlink, or ensure the symlink target contains pyvenv.cfg:Reopening Files to Trigger Re-Detection
When you create.venv after files are already open, you must reopen those files to clear the cache:
Verification Steps
After reopening the file, verify that venv detection is working:1. Enable File Logging
If not already enabled:2. Check Logs for Venv Path
Open a Python file and check the logs:venv_path=None, the venv was not detected.
3. Test Import Resolution
Open a Python file and try importing a package that’s only in your.venv:
Debugging with RUST_LOG=trace
For detailed venv search logs, enable trace-level logging:- Which directories were searched
- Where the search stopped (git root)
- Why
.venvwas or wasn’t found
Common Scenarios
Git Worktree Workflow
Problem: Created worktree, added.venv later, type-checking still doesn’t work.
Solution:
Monorepo: Wrong .venv Detected
Problem: Multiple.venv directories exist, and the wrong one is being used.
Behavior: typemux-cc uses the closest .venv to the file being edited.
Example:
project-a/src/main.py, typemux-cc will use project-a/.venv, not the root .venv.
This is expected behavior. If you want to use a different venv, remove or rename the closer
.venv directory..venv Created by Hook
Problem: A git hook or script creates.venv automatically, but type-checking doesn’t work.
Why: The file was opened before the hook ran, so venv_path=None is cached.
Solution: Reopen files after the hook completes:
Still Not Working?
If venv detection still fails after trying all the above:-
Enable trace logging:
- Restart Claude Code
-
Open a Python file and check trace logs:
- Share the logs when reporting the issue (include the “searching for venv” section)