Skip to content

[BUG] ${CLAUDE_PLUGIN_ROOT} portability #11984

Description

@jtsylve

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

The plugin guide and example implementations suggest using the CLAUDE_PLUGIN_ROOT environment variable for portability. When running in Windows native (not WSL) CLAUDE_PLUGIN_ROOT is not compatible with bash paths.

When executing in cmd.exe, CLAUDE_PLUGIN_ROOT is set to a path that uses Windows-style back slashes. In Powershell, it uses forward slashes, but uses the C:/ prefix, which is also not compatible with bash.

CLAUDE_PLUGIN_ROOT should be normalized to work with Bash on all platforms.

What Should Happen?

Prompts that reference bundled scripts and execute them via bash should behave properly, regardless of operating system.

Error Messages/Logs

Steps to Reproduce

Create a plugin that has a bundled command which references and is instructed to execute a bundled shell script.

Follow the best practice guidance and reference the path to this bundled shell script using ${CLAUDE_PLUGIN_ROOT}/path/to/script.sh.

Install the plugin and execute the command. The command will likely fail to find the script because the unnormalized path will be malformed.

Claude Model

Not sure / Multiple models

Is this a regression?

I don't know

Last Working Version

No response

Claude Code Version

2.0.47

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

Windows Terminal

Additional Information

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:toolsbugSomething isn't workinghas reproHas detailed reproduction stepsplatform:windowsIssue specifically occurs on Windows

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions