Skip to content

Document plugin formats and environment variables#9634

Open
alexdioso wants to merge 3 commits intomicrosoft:mainfrom
alexdioso:clarify-plugin-formats
Open

Document plugin formats and environment variables#9634
alexdioso wants to merge 3 commits intomicrosoft:mainfrom
alexdioso:clarify-plugin-formats

Conversation

@alexdioso
Copy link
Copy Markdown
Contributor

Added sections on plugin formats and environment variables. I had to dig through the vscode source to figure out why plugin hooks weren't working properly. Turns out that the plugin root is not provided to hooks when using Copilot format plugins. OpenPlugin and Claude format plugins get different plugin root environment variables. These changes should help clear up when each plugin format type is used and what root environment variable is provided (if any).

Plugin file path selection

Environment variables for plugin type

Added sections on plugin formats and environment variables.
Copilot AI review requested due to automatic review settings April 8, 2026 18:37
Copy link
Copy Markdown
Contributor

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 PR updates the agent plugins documentation to clarify how VS Code detects different plugin formats based on plugin.json location, and which plugin-root environment variable (if any) is available for hooks.

Changes:

  • Documented how VS Code auto-selects the plugin format based on the plugin file path.
  • Added a table describing which plugin-root variable is available per plugin format.

Comment on lines +67 to +71
### Plugin Environment Variables
| Plugin format | Plugin root |
|---------------|------------------|
| Claude | `${CLAUDE_PLUGIN_ROOT}` |
| Copilot | (Not Defined) |
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

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

The table under "Plugin environment variables" lists values like ${CLAUDE_PLUGIN_ROOT} / ${PLUGIN_ROOT}, which reads like a configuration token, not an environment variable name. Consider either (1) listing the actual env var names (CLAUDE_PLUGIN_ROOT, PLUGIN_ROOT) or (2) renaming the column/section to explicitly describe tokens vs injected environment variables, so readers know what to use in JSON vs in a shell script.

Suggested change
### Plugin Environment Variables
| Plugin format | Plugin root |
|---------------|------------------|
| Claude | `${CLAUDE_PLUGIN_ROOT}` |
| Copilot | (Not Defined) |
### Plugin root tokens
| Plugin format | Plugin root token |
|---------------|-------------------|
| Claude | `${CLAUDE_PLUGIN_ROOT}` |
| Copilot | (Not defined) |

Copilot uses AI. Check for mistakes.
ntrogh and others added 2 commits April 13, 2026 11:15
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

@ntrogh ntrogh left a comment

Choose a reason for hiding this comment

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

@alexdioso Thanks for contributing. I added some corrections for style and technical accuracy.

> Plugins can include hooks and MCP servers that run code on your machine. Review the plugin contents and publisher before installing, especially for plugins from community marketplaces.

## Plugin formats
The plugin format is auto-selected based on the plugin file path (relative to the plugin root).
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
The plugin format is auto-selected based on the plugin file path (relative to the plugin root).
VS Code auto-detects the plugin format by checking for format-specific manifest paths. Copilot format is used as the default when no other format markers are found.

| Plugin format | Plugin file path(s) |
|---------------|------------------|
| Claude | `.claude-plugin/plugin.json` |
| Copilot | `plugin.json`, `.github/plugin/plugin.json` |
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
| Copilot | `plugin.json`, `.github/plugin/plugin.json` |

| Plugin format | Plugin root |
|---------------|------------------|
| Claude | `${CLAUDE_PLUGIN_ROOT}` |
| Copilot | (Not Defined) |
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
| Copilot | (Not Defined) |
| Copilot | (Not defined) |

| Copilot | `plugin.json`, `.github/plugin/plugin.json` |
| OpenPlugin | `.plugin/plugin.json` |

### Plugin environment variables
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
### Plugin environment variables
### Plugin environment variables
Some plugin formats provide a root token that you can use in hook commands and MCP server configurations to reference files within the plugin directory. VS Code expands the token at runtime and also sets it as an environment variable in the hook or server process.

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.

3 participants