Chat plugins: auto-discover worktree-root plugin.json in trusted worktree windows
- Dominant language
- TypeScript
- Stars
- 193k
- Forks
- 42.4k
- PR merge metrics
- PR metrics pending
Description
## Problem
I'm developing a VS Code agent plugin in a Git worktree, but VS Code doesn't appear to load the plugin from the active worktree. Instead it seems to resolve another copy/version of the plugin.
What is a work-tree-specific setup that allows VSCode to resolve plugin.json in the scope of each git work-tree directory?
## Worktree scenario
```text
repo.worktrees/
main/plugin.json
feature-a/plugin.json # branch-specific copy
feature-b/plugin.json # branch-specific copy
```
1. Create or detect multiple Git worktrees.
2. Run **Git: Open Worktree in New Window** and select `feature-a`.
3. The trusted worktree root contains `plugin.json`.
4. There is no worktree-local opt-in without a global user setting or absolute path.
5. Open `feature-b`; the desired source is now that worktree's root copy.
## Expected behavior
Support a worktree-local plugin source for trusted workspaces. For example:
- Detect `plugin.json` at each trusted workspace-folder root.
- Prompt once to enable it, or expose a workspace-local enablement toggle.
- Resolve components relative to that worktree root.
- Keep enablement isolated per workspace/worktree.
- Do not recursively load sibling worktrees or the parent worktree container.
## Related work
- #303853 requests workspace-scoped `chat.pluginLocations`.
- #315123 is an open PR changing it to `ConfigurationScope.WINDOW`.
- #308791 requests recursive discovery under a common parent.
This request is specifically worktree-root discovery/enablement. If #315123 is the intended solution, this scenario would be useful validation coverage and documentation.
## Screenshot

## Environment
- VS Code Insiders `1.131.0-insider`
- Commit `29215ba85809234979befc6b0d1fb4b0ab884383`
- Windows x64
## Current workaround
```jsonc
"chat.pluginLocations": {
".": true
}
```
This resolves per window, but globally opts every workspace into root plugin discovery rather than providing worktree-local enablement.
Contributor guide
Assessment
This issue has not been assessed yet.