bug: asdf is shimming things it does not manage
Describe the Bug
This is a reopening of https://github.com/asdf-vm/asdf/issues/1955#issuecomment-3358434414. Many of us are still experiencing this issue, where asdf is shimming things that it does not manage and causing a lot of headaches. There has been more discussion on that issue since it was closed, but I don't think maintainers are seeing it (because it's closed). So, I'm sorry to do this but this is effectively a "bump" on that issue.
This is related as well: https://github.com/asdf-vm/asdf/issues/2138
Steps to Reproduce
User installs 2 versions of python using asdf-python plugin and sets the python version in a .tool-versions file.
The user then creates and activates a virtual environment. Using pip the user installs a package inside the virtual environment, which contains some executable that asdf shims. The user expects that the executable can be located when they are in the virtual environment:
$ (.venv) which myexecutable ...path/to/.venv/lib/site-packages/mypackage/myexecutable.bin But upon deactivating the virtual environment, the user expects that the executable should not be found (no myexecutable in... etc). Instead, asdf` takes over:
$ which myexecutable No version is set for command myexecutable Consider adding one of the following versions in your config file at /path/to/.tool-versions The user expects only python or nodejs etc to have this behavior with asdf, but it starts popping up all over their system.
Expected Behaviour
Do not shim packages that are not managed by asdf
Actual Behaviour
asdf shims packages that it should not shim
Environment
OS:
Darwin my-mac.local 23.5.0 Darwin Kernel Version 23.5.0: ...
x86_64
SHELL:
zsh 5.9 (x86_64-apple-darwin23.0)
ASDF:
version: v0.14.0-3a3a3a3
ASDF environment variables:
ASDF_DIR=/usr/local/opt/asdf
ASDF_DATA_DIR=/Users/you/.asdf
ASDF_CONFIG_FILE=/Users/you/.asdfrc
ASDF_DEFAULT_TOOL_VERSIONS_FILENAME=/Users/you/.tool-versions
ASDF_USER_SHIMS_DIR=/Users/you/.asdf/shims
ASDF_USER_BIN=/Users/you/.asdf/bin
asdf plugins affected (if relevant)
No response
Here is another example Originally, I installed Claude-Code with npm install -g @anthropic-ai/claude-code. Now, Anthropology suggests using brew to install Claude. However, after uninstalling npm uninstall -g @anthropic-ai/claude-code and installing it using brew. The asdf hijacks the Claude.
claude No version is set for the command Claude Consider adding one of the following versions in your config file at /Users/howie/.tool-versions nodejs 22.16.0