Skip to content

Conversation

@fardeenxyz
Copy link

Summary

  • Add support for detecting Claude Code when installed via asdf version manager
  • Check both ASDF_DIR environment variable and default ~/.asdf/shims location
  • Pass asdf-related environment variables to subprocesses for proper shim resolution
  • Detect symlinks from /usr/local/bin/claude pointing to asdf shims

Details

This fixes detection for users who install Claude Code via:

asdf plugin add claude-code
asdf install claude-code latest
asdf global claude-code latest

Changes

  • Add find_asdf_installations() for Unix and Windows platforms
  • Add "asdf" to source_preference() ranking
  • Pass ASDF_DIR, ASDF_DATA_DIR, ASDF_CONFIG_FILE env vars in create_command_with_env()
  • Augment PATH with ~/.asdf/bin and ~/.asdf/shims

Testing

Tested locally with asdf-installed Claude at ~/.asdf/shims/claude

Add support for detecting Claude Code when installed via asdf version manager.

- Add find_asdf_installations() for Unix and Windows platforms
- Check ASDF_DIR env var and default ~/.asdf/shims location
- Add asdf to source_preference() ranking
- Pass ASDF_DIR, ASDF_DATA_DIR, ASDF_CONFIG_FILE env vars to subprocess
- Augment PATH with ~/.asdf/bin and ~/.asdf/shims
- Detect symlinks from /usr/local/bin/claude pointing to asdf shims

This fixes detection for users who install Claude Code via:
  asdf plugin add claude-code
  asdf install claude-code latest
  asdf global claude-code latest
Copilot AI review requested due to automatic review settings January 10, 2026 19:17
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request adds support for detecting Claude Code installations managed via asdf, a version manager tool. The implementation follows the existing pattern used for NVM installations by checking both environment variables and default installation paths.

Changes:

  • Added asdf to installation source preference ranking (priority 6, after NVM but before local-bin)
  • Implemented find_asdf_installations() for both Unix and Windows platforms to detect Claude in asdf shims
  • Enhanced create_command_with_env() to pass asdf environment variables and augment PATH for asdf installations
  • Added asdf shims directory to the standard installation paths checked

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Prevent duplicate detections when ASDF_DIR points to default location:
- Track checked paths in HashSet to skip duplicates
- Only check default ~/.asdf if not already found via ASDF_DIR
- Remove duplicate standard path check (already handled by find_asdf_installations)
- Remove overly broad /asdf/shims/ substring check (keep /.asdf/shims/ only)

Applies to both Unix and Windows implementations.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant