⌨️CLAUDE_PLUGIN_ROOT
Also known as ${CLAUDE_PLUGIN_ROOT}
The path to the folder a plugin is in, for its hooks.
Think of it like
It is like a label on a toolbox. It says where the box is kept.
Example
Jack ships a plugin with a format script. Its hook calls the script through CLAUDE_PLUGIN_ROOT, so it works on every user's machine.
Why it matters
Each user installs the plugin in a different place. This finds it.
Definition
Example code
json
{
"type": "command",
"command": "\"${CLAUDE_PLUGIN_ROOT}\"/scripts/format.sh"
}Common mistake
Key takeaways
- 1The plugin's folder. Where installed.
- 2For bundled scripts. In hooks.
- 3Data goes elsewhere. PLUGIN_DATA.