ide на основе vs code
Это ide на основе vs code(code oss), в ней будет встроенный умный апи роутинг, свой маркет с плагинами(агент харнесс, поддержка java/kotlin/мобильной разработки, командная разработка проектов, orca, оркестратор агентов
Это ide на основе vs code(code oss), в ней будет встроенный умный апи роутинг, свой маркет с плагинами(агент харнесс, поддержка java/kotlin/мобильной разработки, командная разработка проектов, orca, оркестратор агентов
> Generated by super-planner. Source: roadmap.md (phase 17). > Last updated: 2026-06-23 after council-plan + grill session.
Status: Phase 17 complete. Part A (hooks) shipped as PR #322637 — unit-tested, E2E-verified (launch + code-oss-logs), council-reviewed (one consensus dedupe finding fixed). Part B (native plugins) shipped as PR #322766 — all steps implemented, unit + automated end-to-end tested, council-reviewed, and live-E2E verified (launch + code-oss-logs): the real telegram@claude-plugins-official plugin surfaces in the Agents-window customization modal ("Plugins 1", status *Loaded*, resolved to its real ~/.claude/plugins/cache/.../0.0.6/ root), and a workspace-settings.local.json disable makes it disappear via the watcher and reappear on restore. Typecheck + eslint clean. See Implementation Notes → Part B.
> Grill correction (load-bearing): an earlier draft proposed *plumbing* > enabled native plugins into Options.plugins. That is wrong — native > ~/.claude plugins are auto-loaded by the SDK runtime via > `settingSources` (proof: claudeSkills.ts comment *"The Claude SDK loads > .claude directories automatically — skip them to avoid duplicates"* and its > isClaudeDirectory filter on Options.plugins). Options.plugins is > exclusively for client/host-provided plugins *outside* .claude > (Phase 11's clientCustomizationsDiff). Phase 17 is therefore surface-only > for both hooks and native plugins.
Surface the hooks and Claude-native plugins that a user or workspace has configured (their ~/.claude / workspace .claude) in a Claude session's customization list, with real editable file: URIs. Closes the Phase-16 gap: hooks and native plugins are invisible today even though the runtime already fires/loads them. Mirrors Phase 16's provisional/materialize (M9) semantics and its "real editable URI, no synthetic stub" rule. No SDK loading changes — both tiers already run; this phase only makes them visible and editable.
In scope
hooks block of user/project/local settings.json (+ settings.local.json) and surface each as an editable customization. Hooks already *fire* (the SDK loads them via settingSources), so this is discovery only.
enabledPlugins from the same settings scopes to on-disk plugin roots (marketplace cache + @skills-dir), parse each via the shared plugin parser, and surface the plugin + its bundled components with real URIs. The SDK already loads these via settingSources.
session did not load (filter against the SDK system/init plugin list).
Out of scope
by the runtime via settingSources; passing them would double-load (proof: claudeSkills.ts filters .claude dirs out of Options.plugins). Options.plugins stays exclusively client-provided (Phase 11) — untouched by Phase 17.
enabledPlugins edit take effect is the runtime's job on its next settingSources reload / restart; Phase 17 only refreshes the *displayed list* via the watcher. No new dirty/rebind machinery.
managed-policy hooks/plugins — excluded, matching the existing settingSources: ['user','project','local'] non-goal (roadmap Non-goals).
surfaced by Phase 16 (agents/skills disk scan).
Phase 10 / Phase 11.
HookCustomization-as-top-level protocol change — hooks stay child-only(see Decisions).
scanClaudeMcpServers, scanClaudeDiskCustomizations, buildDiscoveredCustomizations / mapDiscoveredCustomizations, ClaudeCustomizationWatcher exist under node/claude/customizations/.
clientCustomizationsDiff + rebindForRestart() restart path, Options.plugins projected from IBuildOptionsInput.plugins.
@anthropic-ai/claude-agent-sdk: SDKSystemMessage (subtype init) carries plugins: { name, path }[] (sdk.d.ts ~L3943); enabledPlugins setting shape in sdk.d.ts ~L4897.
Add two Claude-specific disk scanners under customizations/scan/ — claudeHookScan.ts and claudeNativePluginScan.ts — that reuse the shared parser layer in pluginParsers.ts (parseHooksJson, parsePlugin, readJsonFile). Wire their output into the existing getSessionCustomizations → mapDiscoveredCustomizations / buildDiscoveredCustomizations projection: hooks become per-scope DirectoryCustomization containers (contents: Hook), native plugins become PluginCustomization containers carrying their bundled components. Post-materialize, capture the SDK system/init.plugins list in the pipeline and filter native plugins by path (so a plugin the live session did not load is hidden). This is purely a discovery/projection layer — Options.plugins and the SDK loading path are untouched; the runtime already loads these via settingSources.
1. ✓ Export the minimal shared hook-parser surface. parseHooksJson and makeHookCustomization are currently private in pluginParsers.ts (~L246, ~L651); only readJsonFile (~L762) and parsePlugin (~L1109) are exported. Export the two hook helpers (and the IParsedHookGroup type if not already public) so the new scanner can reuse Claude hook parsing (disableAllHooks, HOOK_TYPE_MAP canonicalization, nested { matcher, hooks } extraction) instead of reimplementing it.
parseHooksJson / makeHookCustomization importable from node/claude/; pluginParsers.test.ts covers the now-public surface.
2. ✓ Hook scanner `scan/claudeHookScan.ts`. Mirror claudeMcpScan.ts: read the hooks block from <cwd>/.claude/settings.json, <cwd>/.claude/settings.local.json, and ~/.claude/settings.json (project-first precedence) via readJsonFile; skip a scope whose disableAllHooks === true; call parseHooksJson(settingsUri, json, workspaceRoot, userHome). Return readonly HookCustomization[] (one per source file with hooks), each carrying the real settings-file file: URI. Exclude managed.
node/claude/customizations/scan/claudeHookScan.ts (create)settings.json + settings.local.json into HookCustomization[] with real URIs; disableAllHooks drops a scope; managed never read.
3. Native-plugin scanner `scan/claudeNativePluginScan.ts`. Read enabledPlugins from the same three settings scopes (union, first-scope-wins per plugin id). For each enabled plugin resolve its on-disk root:
~/.claude/plugins/cache/<...>/; defensive: accept a candidate dir only if it contains a parseable .claude-plugin/plugin.json; on multiple version dirs pick newest mtime; on zero/ambiguous skip with logService.warn;
@skills-dir → ~/.claude/skills/<name>/.claude-plugin/plugin.json and <cwd>/.claude/skills/<name>/.claude-plugin/plugin.json. Call parsePlugin(root, fileService, workspaceRoot, userHome, boundaryUri) (already detects Claude format via .claude-plugin/plugin.json and returns { hooks, mcpServers, skills, agents, instructions }). Return { name, root: URI, parsed: IParsedPlugin }[] — consumed by the projection (step 5) for surfacing; not used for loading (the runtime auto-loads).
node/claude/customizations/scan/claudeNativePluginScan.ts (create)root, parses it, and yields components with real URIs; a missing/ambiguous dir is skipped, not errored.
4. Capture SDK `system/init.plugins` in the pipeline. Today the pipeline only flips _isResumed on the init message (claudeSdkPipeline.ts ~L507) and snapshotResolvedCustomizations returns commands/agents/mcpServers only (~L95). Stash message.plugins ({ name, path }[]) on the pipeline at init and add a plugins field to ISdkResolvedCustomizations. A rebind creates a fresh pipeline, so the new init re-captures — no staleness.
it is populated from a stubbed init.
5. Projection: hooks + native plugins in the discovery mapper. *(hooks half ✓; native-plugin half pending Part B)* In claudeSessionCustomizationDiscovery.ts:
hooks input to mapDiscoveredCustomizations; wrap per-scope hooks in a DirectoryCustomization (contents: CustomizationType.Hook, writable: true, children = the real-URI HookCustomizations) using the same makeDirectory pattern as agents/skills/rules;
nativePlugins input; map each resolved plugin to a PluginCustomization (type: CustomizationType.Plugin, uri = plugin root, children from IParsedPlugin agents/skills/hooks/mcp/rules);
buildDiscoveredCustomizations, hooks bypass the SDK filter (like rules); native plugins are filtered post-materialize by matching their resolved root.fsPath against the captured sdk.plugins[].path.
pre-materialize; post-materialize a plugin absent from sdk.plugins is hidden, hooks are not.
6. Wire scanners into `getSessionCustomizations`. *(hooks wired ✓; scanClaudeNativePlugins pending Part B)* Extend the existing Promise.all (~L841) with scanClaudeHooks(...) and scanClaudeNativePlugins(...), pass results into mapDiscoveredCustomizations / buildDiscoveredCustomizations, keeping the client-pushed tier first. No `Options.plugins` / materialize changes — the runtime already loads these via settingSources.
getSessionCustomizations returns hooks + native plugins; materialized hides unloaded native plugins; Options.plugins is unchanged from today.
7. ✓ Watcher coverage check (no new triggers). ClaudeCustomizationWatcher already watches <cwd>/.claude and ~/.claude recursively (~L363), covering settings.json, settings.local.json, @skills-dir plugins, and ~/.claude/plugins/cache. Confirm with a test; add an explicit trigger only if a resolved plugin root falls outside those subtrees. The watcher only refreshes the *displayed list* (onDidCustomizationsChange) — it does not drive any rebind.
settings.json hooks/enabledPlugins edit fires onDidChange.
8. Tests. *(hook scanner + projection tests ✓; native-plugin tests pending Part B)* New scanner tests + extend discovery tests (see Verification).
test/node/customizations/scan/claudeHookScan.test.ts (create), test/node/customizations/scan/claudeNativePluginScan.test.ts (create), test/node/customizations/claudeSessionCustomizationDiscovery.test.ts (modify), test/common/pluginParsers.test.ts (modify — public hook surface)
node agentHost suite green.> PR sequencing (grilled). Ship Part A (hooks) first (steps 1, 2, 5-hook, > 6-hook, 8), then Part B (native plugins) (steps 3, 4, 5-plugin, 6-plugin, 8). > Both are surface-only; Part A is the smaller, lower-risk slice and proves the > projection wiring before Part B adds the marketplace-cache resolver and the > init.plugins capture.
| Path | Change | Notes | |------|--------|-------| | src/vs/platform/agentPlugins/common/pluginParsers.ts | modify | Export parseHooksJson + makeHookCustomization (currently private) | | src/vs/platform/agentHost/node/claude/customizations/scan/claudeHookScan.ts | create | scanClaudeHooks — hooks from user/project/local settings.json | | src/vs/platform/agentHost/node/claude/customizations/scan/claudeNativePluginScan.ts | create | scanClaudeNativePlugins — resolve enabledPlugins → roots → parsePlugin | | src/vs/platform/agentHost/node/claude/customizations/claudeSessionCustomizationDiscovery.ts | modify | Hook directory containers + plugin containers; native-plugin post-materialize filter | | src/vs/platform/agentHost/node/claude/claudeSdkPipeline.ts | modify | Capture system/init.plugins; add plugins to ISdkResolvedCustomizations | | src/vs/platform/agentHost/node/claude/claudeAgentSession.ts | modify | Call new scanners in getSessionCustomizations; pass hooks/plugins into the projection (no Options.plugins change) | | src/vs/platform/agentHost/test/node/customizations/scan/claudeHookScan.test.ts | create | Hook scan unit tests | | src/vs/platform/agentHost/test/node/customizations/scan/claudeNativePluginScan.test.ts
> claudeSdkOptions.ts is not modified — Options.plugins stays > client-only (native plugins are auto-loaded via settingSources).
~/.claude plugins are NOT plumbed into Options.plugins — they are auto-loaded by the SDK runtime via settingSources.** Grilled and verified: extensions/copilot/.../claudeSkills.ts states *"The Claude SDK loads .claude directories automatically — skip them to avoid duplicates"* and filters .claude dirs out of Options.plugins (isClaudeDirectory). The production claudeCodeAgent.ts builds Options.plugins only from claudePluginService.getPluginLocations() (client/host-provided, non-.claude). Passing native plugins in would double-load. Options.plugins therefore stays exactly as Phase 11 left it; Phase 17 is surface-only. (The SDK docs' "must pass Options.plugins" caveat applies to a bare SDK app *without* settingSources, which is not our configuration.)
Options.plugins, an enabledPlugins edit needs no host-side rebind to *load*; the runtime picks it up on its next settingSources read (same path as any settings.json change). The watcher only refreshes the displayed list. (This moots the council's union-vs-separate-field and dirty-mechanism debate — grilled.)
surface-only; A is smaller/lower-risk and proves the projection wiring before B adds the marketplace-cache resolver + init.plugins capture.
DirectoryCustomization containers, not a new top-level protocol type.** The Customization union only admits PluginCustomization / DirectoryCustomization / top-level McpServerCustomization; HookCustomization is child-only (state.ts ~L720/~L873). Wrapping in a DirectoryCustomization (contents: Hook) mirrors how agents/skills/rules are surfaced — no protocol change.
system/init.plugins list, not command-name inference.** The init message carries { name, path }[] (sdk.d.ts ~L3943); the SDK explicitly notes command snapshots can go stale, so matching loaded plugins by path is the reliable signal. Hooks bypass the filter (no SDK hook enumeration exists).
parseHooksJson already handles disableAllHooks + HOOK_TYPE_MAP + nested matcher form; parsePlugin already detects Claude plugins and returns bundled components. Net-new work is only the Claude settings-scope roots and the marketplace-cache resolver.
the existing settingSources non-goal.
candidate only when it contains a parseable .claude-plugin/plugin.json; on multiple version dirs pick newest mtime; on zero/ambiguous skip with a warn log so a broken cache entry never blanks the list.
parseHooksJson / makeHookCustomization are private today — step 1 must export them; verify no layer/visibility lint regressions (valid-layers-check).
Options.plugins — they are auto-loaded via settingSources; plumbing them duplicates loading (claudeSkills.ts isClaudeDirectory filter). The plan keeps claudeSdkOptions.ts untouched precisely to avoid this.
init only to flip _isResumed. Ensure the plugin capture runs on every fresh Query (including resumed sessions and post-rebind), since a rebind builds a new pipeline — add a test asserting capture on resume.
fail-soft resolver (Decisions). Confirm the real ~/.claude/plugins/cache layout on a machine with an installed plugin before locking the resolver.
settingSources (set in claudeSdkOptions.ts ~L122). includeHookEvents only affects whether hook events surface on the stream, not whether hooks run — Part A is surface-only, so it does not depend on it. Confirm settingSources includes the hook-bearing scopes during the E2E check.
node suite for the touched files:./scripts/test.sh --run src/vs/platform/agentHost/test/node/customizations/scan/claudeHookScan.test.ts./scripts/test.sh --run src/vs/platform/agentHost/test/node/customizations/scan/claudeNativePluginScan.test.ts./scripts/test.sh --run src/vs/platform/agentHost/test/node/customizations/claudeSessionCustomizationDiscovery.test.ts./scripts/test.sh --run src/vs/platform/agentPlugins/test/common/pluginParsers.test.tsdisableAllHooks, managed excluded); native-plugin resolver (marketplace cache + skills-dir, fail-soft skip); discovery projection (hook directory container, plugin container) pre-materialize; post-materialize hides an unloaded plugin, keeps hooks; watcher fires on a settings.json hooks/enabledPlugins edit. No `Options.plugins` assertion changes — the existing claudeSdkOptions.test.ts should still pass unmodified (proof we did not touch the loading path).
npm run typecheck-client, npm run gulp hygiene (or watch-task output), npm run valid-layers-check, eslint clean.
Launch + log skills discovered in this workspace (project scope):
launch (.agents/skills/launch/SKILL.md) — Playwright-driven Code OSS automation against the Agents window; see the macOS short-TMPDIR gotcha in repo memory.
code-oss-logs (.github/skills/code-oss-logs/SKILL.md) — find/readagent-host + renderer dev-build logs.
/memories/repo/e2e-claude-checklist.md — exact launch command, the two-Claude picker selection, the Monaco editContext input method, and the customization-modal verification (the "editable real file, not a stub" check).
Scenario (run in the Agents window, Claude → Local Agent Host): 1. Hooks surface + fire. Add a PostToolUse hook to ~/.claude/settings.json. Open a Claude session; via the composer's customization modal ("Skills/Agents" → manage), confirm a Hooks group lists the hook and clicking it opens the real settings.json (renderer log: [text file model] resolve() - enter file://…/.claude/settings.json). Send "list files in this directory" (forces a tool) and confirm the hook runs (its side effect / a PreToolUse/PostToolUse entry in agenthost.log). 2. Native plugin surface (auto-loaded). With a marketplace plugin installed + enabled via the Claude CLI (or a temp @skills-dir plugin under ~/.claude/skills/<name>/.claude-plugin/), open a session; confirm the plugin + its bundled skills appear in the list with real URIs, and the agent can invoke a plugin skill. Verify the plugin is present in the captured SDK system/init.plugins (i.e. the runtime auto-loaded it) — without any new Options.plugins entry from the host. 3. List refresh on toggle. Disable the plugin in settings.json; confirm the customization list refreshes (watcher onDidChange) and the plugin disappears post-materialize (absent from init.plugins). Note: the *loaded* set changes on the runtime's next settings reload / session restart — Phase 17 owns the list refresh, not the reload. 4. Regression guard. Re-run scenarios 1–5 of /memories/repo/e2e-claude-checklist.md
~/.claude/plugins/cache directory layout matches theresolver assumption (single current version dir + possible orphans) before merge.
*(none — all resolved in Decisions)*
./roadmap.md (Phase 17)./CONTEXT.md (M9 provisional/materialize, M11hot-swap/defer/restart-required)
./phase11-plan.md (restart-required plugin contract, rebindForRestart())
./phase16-plan.md (disk-scan resolver, mapDiscoveredCustomizations)/en/hooks), plugins-reference (/en/plugins-reference),agent-sdk plugins/hooks
launch, code-oss-logs; runbook /memories/repo/e2e-claude-checklist.mdFiles actually changed (matches the plan's Files to Modify or Create, Part A rows only):
src/vs/platform/agentPlugins/common/pluginParsers.ts — exported the previously-private parseHooksJson (+ doc comment). No behavior change. (makeHookCustomization was not exported — the scanner reads the customization off the parsed group's .customization, so the extra export was unnecessary; minimal-surface deviation from the plan's step 1.)
src/vs/platform/agentHost/node/claude/customizations/scan/claudeHookScan.ts — new. scanClaudeHooks(workingDirectory, userHome, fileService); reads <cwd>/.claude/settings.json, <cwd>/.claude/settings.local.json, <userHome>/.claude/settings.json; dedupes by file URI; one HookCustomization per declaring file; delegates disableAllHooks + canonicalization to parseHooksJson.
src/vs/platform/agentHost/node/claude/customizations/claudeSessionCustomizationDiscovery.ts — mapDiscoveredCustomizations + buildDiscoveredCustomizations take a new hooks: readonly HookCustomization[]; makeDirectory widened to Hook + HookCustomization; per-scope Hooks DirectoryCustomization (contents: Hook); hooks bypass the SDK filter (like rules).
src/vs/platform/agentHost/node/claude/claudeAgentSession.ts — getSessionCustomizations calls scanClaudeHooks in its parallel scan and passes the result to buildDiscoveredCustomizations. Options.plugins / materialize untouched.
Tests:
…/test/node/customizations/scan/claudeHookScan.test.ts — new. 6 tests: per-file surfacing with real URI, settings.local.json precedence, disableAllHooks short-circuit, no-hooks-block → no entry, the cwd === userHome dedupe regression (council finding), and no-workspace (undefined cwd) → user scope only.
…/test/node/customizations/claudeSessionCustomizationDiscovery.test.ts — updated all 6 existing map/buildDiscoveredCustomizations call sites for the new hooks param + added a per-scope Hooks container projection test and a post-materialize "hooks survive the SDK filter" test (mirrors the rules test — asserts the bypass Decision).
…/test/common/pluginParsers.test.ts — added a parseHooksJson sub-suite (5 tests: non-object/missing-block/disableAllHooks → [], camelCase→PascalCase canonicalization + unknown-event drop, nested-matcher extraction + empty-group drop, flat command form, shared file-level customization). (parseHooksJson is now a public export, so it gets direct contract coverage independent of the scanner.)
Deviations from plan:
parseHooksJson, not makeHookCustomization (minimal surface).scanClaudeHooks dedupes candidate files via ResourceSet (URI-identity set) rather than a hand-rolled Set<string> + toString().
E2E (launch + code-oss-logs): Agents window, Claude → Local Agent Host, against the vscode repo with a workspace hook seeded in the gitignored .claude/settings.json and the real user hook in ~/.claude/settings.json. Confirmed: composer shows "Hooks 2"; the "Agent Customizations for Claude [Agent Host]" modal shows a Hooks, 2 items section grouped Workspace · 1 (.claude/settings.json) / User · 1 (~/.claude/settings.json); clicking the workspace entry opened the real editable file (renderer.log: text file model] resolveFromFile() + doCreateTextModel() on the actual …/.claude/settings.json). All seeded artifacts cleaned up; git status clean.
Council review (council-review skill, 3 models): one consensus finding — duplicate hook entry when workingDirectory === userHome (no dedupe; sibling claudeMcpScan.ts dedupes). Fixed via a seen URI set + regression test (severity split: 2 reviewers blocking, 1 cosmetic). All other axes (missing files, malformed JSON, disableAllHooks, scope attribution via URI.parse, layering of the parseHooksJson export, test correctness) returned no blocking issues.
`avoid-private-methods`: skill not installed in this environment; manual check — Part A introduces no new private methods or classes (the scanner is a pure exported function; discovery changes extend existing free functions). clean.
> Stacked second PR (after the Part A hooks PR). Surface-only — native .claude plugins > enabled via enabledPlugins are already auto-loaded by the SDK via settingSources; this > adds discovery/projection + a post-materialize filter and does not touch `Options.plugins` > or `claudeSdkOptions.ts` (its test must pass unmodified). Synthesized from a 3-model > planning council (GPT-5.5, Claude Opus 4.6, GPT-5.3-Codex) — all three converged on the same > architecture; divergences resolved in Decisions below.
Ready-made local fixture: the user's ~/.claude/settings.json already declares enabledPlugins: { "telegram@claude-plugins-official": true }, installed under ~/.claude/plugins/cache — confirm that real layout before locking the resolver (Manual verification item).
#### Verified SDK facts (read from node_modules/@anthropic-ai/claude-agent-sdk/sdk.d.ts)
sdk.d.ts L4899): { [pluginId]: string[] | boolean | { [k]: unknown } }. Id format is plugin-id@marketplace-id. A plugin is enabled when its value is true, a string[] (version constraint), or an object (extended form); disabled only when false. Precedence is `user < project < local` (later scope wins) — so false in .claude/settings.local.json disables a plugin that .claude/settings.json or ~/.claude/settings.json enabled. This is the opposite of the hook scanner's "first-seen-wins" dedupe (Decision PB-1).
sdk.d.ts L3943): { name: string; path: string }[] — name + path only (no source). This is the post-materialize source of truth for "which native plugins did the live session actually load".
#### Part B Approach
Add one read-only disk scanner (scan/claudeNativePluginScan.ts) that computes the effective enabled-plugin set across the three settings scopes (correct precedence), resolves each enabled plugin id to a manifest-validated on-disk root (marketplace cache or @skills-dir), and parses it with the shared parsePlugin (CLAUDE_FORMAT). Project each as a top-level PluginCustomization container (new makePlugin helper — PluginCustomization is a distinct protocol container type, not a DirectoryCustomization) whose children come straight from IParsedPlugin (skills/agents/instructions/hooks/mcpServers .customization). Capture system/init.plugins in ClaudeSdkPipeline; post-materialize, keep only plugins whose resolved root.fsPath matches a captured init.plugins[].path. Provisional (pre-send) shows the full disk set; hooks/rules keep bypassing the filter. Because @skills-dir plugins live in the same .claude/skills/ tree the Phase 16 skill scanner walks, the standalone skill scan is taught to
#### Part B Steps
3. ✓ Native-plugin scanner `scan/claudeNativePluginScan.ts` *(create)*.
scanClaudeNativePlugins(workingDirectory, userHome, fileService, logService) reads enabledPlugins from the same three settings files as claudeHookScan.ts (<cwd>/.claude/settings.json, <cwd>/.claude/settings.local.json, <userHome>/.claude/settings.json), merging into one effective map with local > project > user precedence (Decision PB-1). Final value !== false ⇒ enabled.
plugin@marketplace, resolve its root via a resolvePluginRoot helper: `@skills-dir` marketplace ⇒ in-place <userHome>/.claude/skills/<plugin>/ or <cwd>/.claude/skills/<plugin>/, accepted only if .claude-plugin/plugin.json reads. Marketplace cache ⇒ search <userHome>/.claude/plugins/cache/ for a directory containing a parseable .claude-plugin/plugin.json; on multiple version dirs pick newest mtime (via fileService.resolve/stat); on zero/ambiguous logService.warn + skip (fail-soft, Decision PB-5).
parsePlugin(root, fileService, workingDirectory, userHome.fsPath) inside a try/catch — a malformed manifest warns + skips, never throws out of the scan (Risk PB-R4).
readonly IResolvedNativePlugin[] = { id: string; root: URI; parsed: IParsedPlugin }.ResourceSet (cwd-can-equal-userHome lesson; mirror Part A). marketplace-cache + a @skills-dir plugin to real-URI children; missing/ambiguous skipped.
4. ✓ Capture `system/init.plugins` in `claudeSdkPipeline.ts` *(modify)*.
private _initPlugins: readonly { name: string; path: string }[] = []. Set it on the init branch (claudeSdkPipeline.ts ~L507) unconditionally — i.e. NOT gated behind the existing !this._isResumed guard, so a resumed/re-init session re-captures the latest list (Decision PB-4 / Risk PB-R3).
readonly plugins: readonly { name: string; path: string }[] to ISdkResolvedCustomizations (L62) and return this._initPlugins from snapshotResolvedCustomizations() (L95). A rebind builds a fresh pipeline, so capture is never stale.
snapshotResolvedCustomizations().plugins is populatedfrom a stubbed init message.
5. ✓ Projection: plugin containers + post-materialize filter in claudeSessionCustomizationDiscovery.ts *(modify)*.
nativePlugins: readonly IResolvedNativePlugin[] param to both mapDiscoveredCustomizations and buildDiscoveredCustomizations.
makePlugin(id, root, parsed) helper → PluginCustomization (type: CustomizationType.Plugin, id: customizationId(root.toString()), uri: root.toString(), name: id, enabled: true, load: { kind: Loaded }, children: [...parsed.skills, ...parsed.agents, ...parsed.instructions, ...parsed.hooks, ...parsed.mcpServers].map(c => c.customization)). Top-level entries, not wrapped in a per-scope DirectoryCustomization (Decision PB-2) — mirrors how MCP servers are top-level.
buildDiscoveredCustomizations: pre-materialize (sdk === undefined) keep all native plugins; post-materialize keep only those whose root.fsPath ∈ new Set(sdk.plugins.map(p => URI.file(p.path).fsPath)) (normalize both sides through URI.file().fsPath, Decision PB-3 / Risk PB-R2). Hooks + rules continue to bypass.
post-materialize a plugin absent from sdk.plugins is hidden, hooks/rules are not.
5b. ✓ De-duplicate `@skills-dir` plugins from the standalone skill scan in scan/claudeAgentSkillScan.ts *(modify)* (Decision PB-8).
<scope>/.claude/skills/, **skip any immediate <name>/ dir that contains a readable .claude-plugin/plugin.json** — that dir is a native plugin, so its skills belong to the plugin container (step 5), not the standalone Skills list. This is a self-contained check (no dependency on the plugin resolver's enabled-set), so a disabled-but-present skills-dir plugin is also kept out of the standalone list.
with a .claude/skills/<name>/.claude-plugin/plugin.json present yields no standalone Skill for <name>.
6. ✓ Wire `scanClaudeNativePlugins` into `getSessionCustomizations` in claudeAgentSession.ts *(modify)*.
Promise.all (~L841) with scanClaudeNativePlugins(this.workingDirectory, userHome, this._fileService, this._logService); pass the result into buildDiscoveredCustomizations. No `Options.plugins`/materialize change. Depends on: steps 3, 5.
7. ✓ Watcher — no production change expected. ClaudeCustomizationWatcher already watches <cwd>/.claude + <userHome>/.claude recursively (~L363), covering settings*.json, ~/.claude/plugins/cache, and @skills-dir. Add a test asserting an enabledPlugins edit fires onDidChange; add an explicit trigger only if a resolved root falls outside those subtrees.
8. ✓ Tests *(create + modify)* — see Part B Verification.
#### Part B Files to Modify or Create
| Path | Change | Notes | |------|--------|-------| | …/customizations/scan/claudeNativePluginScan.ts | create | scanClaudeNativePlugins + resolvePluginRoot (cache + @skills-dir, manifest-validated, fail-soft); IResolvedNativePlugin | | …/claude/claudeSdkPipeline.ts | modify | _initPlugins capture (ungated); plugins on ISdkResolvedCustomizations; return from snapshotResolvedCustomizations | | …/customizations/claudeSessionCustomizationDiscovery.ts | modify | nativePlugins param on map/build; makePlugin helper (top-level, root-dir URI); post-materialize path-match filter | | …/customizations/scan/claudeAgentSkillScan.ts | modify | skip .claude/skills/<name>/ dirs that are plugin roots (.claude-plugin/plugin.json) — Decision PB-8 | | …/claude/claudeAgentSession.ts | modify | call scanClaudeNativePlugins in getSessionCustomizations; pass into projection (no Options.plugins change) | | …/test/node/customizations/scan/claudeNativePluginScan.test.ts | create | resolver tests (cache version-pick, @skills-dir
> claudeSdkOptions.ts + claudeSdkOptions.test.ts are not modified — proof the loading > path is untouched.
#### Part B Decisions
local > project > user precedence (later scope wins), enabled = value !== false. Verified in `sdk.d.ts` L4897 ("user < project < local … set it to false in `.claude/settings.local.json`"). This is the opposite** of the hook scanner's first-seen dedupe, so the native-plugin scanner merges scopes into one effective map rather than first-wins. A string[]/object value counts as enabled (version-constraint / extended form); only false disables.
PluginCustomization entries, not per-scope DirectoryCustomization wrappers.** PluginCustomization is a distinct protocol container (state.ts L580) with its own identity/edit target; wrapping plugins in scope directories (as hooks/agents/skills are) would lose plugin identity. Mirrors top-level MCP servers. (No Workspace/User grouping label for plugins — the plugin root URI carries the location.)
root.fsPath against the captured SDK init.plugins[].path, normalized through URI.file().fsPath on both sides.** The init list is purpose-built {name,path} data; name-matching supportedCommands()/supportedAgents() is rejected (a plugin bundles many components; the SDK warns command snapshots go stale).
flips _isResumed once; the plugin capture must run on every init so resumed/re-init sessions refresh. A rebind creates a fresh pipeline, so cross-instance staleness is impossible.
candidate only when it has a parseable .claude-plugin/plugin.json; newest mtime on multiple version dirs; logService.warn + skip on zero/ambiguous so a broken cache entry never blanks the list. (~/.claude/plugins/cache layout is undocumented in-repo — confirm on the user's machine before locking.)
telegram@claude-plugins-official). parsePlugin/IParsedPlugin does not return the manifest display name, and the id is what the user wrote + what the /plugins UI shows — stable and reliable. (Reading the manifest name is a possible later polish.)
auto-loaded via settingSources; plumbing them would double-load (claudeSkills.ts isClaudeDirectory filter). Surface-only.
@skills-dir plugin wins over the Phase 16 standalone skill scan (no duplicate rows). `@skills-dir` plugins live under `<scope>/.claude/skills/<name>/`, the same tree `scanClaudeDiskCustomizations` walks (`claudeAgentSkillScan.ts` `scopeRoots().skills`). The skill scan skips any immediate `<name>/` dir containing a `.claude-plugin/plugin.json`, so a skills-dir plugin's skills surface only** under its PluginCustomization container. The check is self-contained (manifest-presence, not the resolver's enabled-set), so the standalone list stays clean even for a disabled skills-dir plugin. (Grilled — preferred over URI-dedupe in the projection or accepting the overlap.)
fail-soft cache resolver is fully designed and a real installed plugin (telegram@claude-plugins-official) is available to confirm the layout during E2E, so a split adds overhead without meaningful risk reduction. (Grilled.)
#### Part B Risks
resolver (PB-5). Confirm the real ~/.claude/plugins/cache/<…> structure on the user's machine (has telegram@claude-plugins-official installed) before locking the resolver.
init.plugins[].path as a string; scanner roots are URI.fsPath. Symlinks (~/.claude may be a symlink), trailing separators, or case could over-filter and hide a loaded plugin. Mitigation: normalize both via URI.file().fsPath; add a trailing-slash test. If real-path divergence is observed in E2E, fall back to comparing realpath-resolved paths.
Query init, including resumed/post-rebind. Mitigation: ungate from _isResumed (PB-4) + a resume-capture test.
whole scan. Mitigation: try/catch per plugin, logService.warn + skip.
plugins requires plugins: [] in every existing sdk literal in claudeSessionCustomizationDiscovery.test.ts (+ pipeline/init test utils). Mechanical, but must be exhaustive or typecheck fails.
implementation time whether readSkills (pluginParsers.ts) descends past the immediate .claude/skills/<name>/ level. If it only reads <name>/SKILL.md, the duplicate surfaces only when a skills-dir plugin also has a top-level SKILL.md; if it recurses, bundled <name>/skills/<x>/SKILL.md could also collide. The manifest-presence skip at the <name>/ level covers both, but the test must reflect the actual traversal.
#### Part B Verification
Unit:
…/scan/claudeNativePluginScan.test.ts (in-memory file service via claudeCustomizationTestUtils): effective-set precedence (local false disables a project-enabled plugin; string[]/object value enables); marketplace-cache resolution (newest-mtime version pick, manifest-validated, fail-soft skip on missing/ambiguous); @skills-dir resolution (user + workspace); malformed manifest warns + skips; resolved children carry real URIs; cwd===userHome dedupe.
…/customizations/claudeSessionCustomizationDiscovery.test.ts: plugin container projection pre-materialize (top-level entry, root-dir URI, children from parsed components); post-materialize hides a plugin absent from sdk.plugins while keeping one present; hooks/rules still bypass. Add plugins: [] to existing sdk literals.
…/scan/claudeAgentSkillScan.test.ts: a .claude/skills/<name>/.claude-plugin/plugin.json present ⇒ <name> is not surfaced as a standalone Skill (PB-8).
…/claudeSdkPipeline.test.ts: snapshotResolvedCustomizations().plugins populated from a stubbed system/init; capture refreshes on a second init (resume).
claudeSdkOptions.test.ts passes unmodified.npm run typecheck-client, eslint, npm run valid-layers-check.E2E (launch + code-oss-logs; runbook `/memories/repo/e2e-claude-checklist.md`):
telegram@claude-plugins-official enabled in ~/.claude/settings.json, open a Claude → Local Agent Host session: the plugin + its bundled skills appear in the customization list with real URIs; it is present in the captured init.plugins (auto-loaded) with no host-added Options.plugins entry. Disable it in settings.local.json → list refreshes (watcher) and the plugin disappears post-materialize.
Options.plugins) still load — proving the loading path is untouched.
Confirmed disk layout (de-risks PB-R1/PB-5). Inspected the user's real ~/.claude/plugins/cache on 2026-06-23: marketplace plugins live at cache/<marketplace>/<plugin>/<version>/ (e.g. cache/claude-plugins-official/telegram/0.0.6/.claude-plugin/plugin.json). So the enabledPlugins id plugin@marketplace maps directly to cache/<marketplace>/<plugin>/ and the resolver just selects the (single / newest-mtime) version subdir — far more deterministic than the planned blind cache search. enabledPlugins precedence (user < project < local) and the system/init.plugins {name,path} shape were both verified in sdk.d.ts (L4899 / L3943).
Files actually changed (matches the Part B Files to Modify or Create table):
customizations/scan/claudeNativePluginScan.ts — new. scanClaudeNativePlugins + IResolvedNativePlugin; effective-enabled-set merge (local > project > user, !== false), splitPluginId, @skills-dir resolver (workspace before user), marketplace-cache resolver (id → cache/<marketplace>/<plugin>/, newest-mtime version dir, name tie-break, manifest validated, fail-soft warn+skip), per-plugin parsePlugin in try/catch, root dedupe via ResourceSet.
claudeSdkPipeline.ts — plugins added to ISdkResolvedCustomizations; _initPlugins captured on every system/init (ungated from _isResumed, PB-4); returned from snapshotResolvedCustomizations.
customizations/claudeSessionCustomizationDiscovery.ts — makePlugin helper (top-level PluginCustomization, root-dir URI, name = id, children deduped by id); nativePlugins param on mapDiscoveredCustomizations + buildDiscoveredCustomizations; post-materialize filter root.fsPath ∈ sdk.plugins[].path (normalized via URI.file().fsPath).
customizations/scan/claudeAgentSkillScan.ts — excludeNativePluginSkills drops standalone skills whose .claude/skills/<name>/ dir holds a .claude-plugin/plugin.json (PB-8).
claudeAgentSession.ts — scanClaudeNativePlugins added to the parallel scan; result passed to buildDiscoveredCustomizations. Options.plugins / claudeSdkOptions.ts untouched.
Tests:
…/scan/claudeNativePluginScan.test.ts — new, 9: cache resolve (id → version dir), newest-mtime pick, bundled skills/MCP with real URIs, local-false disable (precedence), string[]/object = enabled, @skills-dir (workspace-preferred), fail-soft skip, no-block.
…/customizations/claudeSessionCustomizationDiscovery.test.ts — +3: top-level plugin projection with bundled children, post-materialize keep-loaded/hide-unloaded by path, pre-materialize shows all. All existing map/build call sites updated for the nativePlugins param + plugins: [] added to the 4 sdk literals.
…/scan/claudeAgentSkillScan.test.ts — +1: a .claude/skills/<name> plugin dir is notsurfaced as a standalone skill (PB-8).
…/claudeAgent.test.ts — +1 end-to-end: seeds an enabled plugin under the mock cache, drives a system/init whose plugins[].path matches the resolved root, and asserts the PluginCustomization survives getSessionCustomizations — proving capture → snapshot → filter.
claudeSdkOptions.test.ts passes unmodified; full claudeAgent.test.ts (132) + claudeSdkPipeline.test.ts green.
Deviations from plan:
cache/<marketplace>/<plugin>/), not a blind scan of cache/ — enabled by confirming the real on-disk layout (above). Version selection adds a dir-name tie-break on equal mtime (the in-memory test provider collides sub-ms writes).
hasManifest in the scanner, and the PB-8 skill-scan dedupe) initially hardcoded .claude-plugin/plugin.json (Claude format) and so silently skipped Open-Plugins-format plugins (.plugin/plugin.json, e.g. github-inbox@vscode-team-kit) — they were absent from the Plugins container even though their skills/agents surfaced standalone (the SDK loads them via settingSources). Fixed by reusing the shared detectPluginFormat (probes .plugin/ → .claude-plugin/ → plugin.json) and checking the detected format's manifestPath. Regression test added; re-verified E2E (Plugins 2: telegram@claude-plugins-official + github-inbox@vscode-team-kit, both *Loaded*).
init.plugins path is unreliable: for a workspace-local-scoped plugin (enabled in <cwd>/.claude/settings.local.json) the runtime reports a bogus path (<workspace-parent>/<marketplace>/<plugin>/, not the cache root), so the resolved-root path match dropped the plugin post-materialize. The runtime payload also carries a `source` field (= the <plugin>@<marketplace> id) that the .d.ts omits; captured as optional (no cast). The filter now matches source === plugin.id first, with normalized path as a fallback.
plugin is surfaced as a container, the SDK *also* reports its agents/commands/MCP in supportedAgents/supportedCommands/mcpServerStatus, so the Phase-16 SDK-only fallbacks (claude-internal: agents, Built-in skills, non-editable MCP) re-surfaced them standalone — duplicate rows in the User/Workspace lists. Fixed by suppressing any SDK fallback whose name matches a *surfaced* plugin's own parsed component name, in both bare (inbox-setup) and namespaced (<plugin>:inbox-setup) forms (SDK naming is inconsistent — agents namespaced, skills usually bare — so prefix-matching alone is insufficient). Only surfaced plugins suppress, so a loaded-but-unsurfaced plugin's components are never dropped. Verified E2E: post-materialize Agents 17→11, Skills 90→75, 0 standalone inbox-/github-inbox: leaks, both plugins under Remote.
claudeAgent.test.ts (its harness already drives the SDK message stream and exposes a seedable fileService) rather than claudeSdkPipeline.test.ts (whose FakeQuery deliberately leaves supportedCommands/message-stream "not modeled"). This covers the same init.plugins → snapshot → filter seam end-to-end.
`avoid-private-methods`: skill not installed; manual check — Part B adds only module-level free functions (scanner helpers, makePlugin, excludeNativePluginSkills) and one private field (_initPlugins); no new private class methods. clean.
Council review (council-review skill, 3 models): no consensus *blocking* bug. Fixes applied: (1) security — splitPluginId now rejects enabledPlugins ids whose segments contain path separators or .., so an untrusted workspace settings.local.json cannot redirect the scan outside the plugin roots (+ traversal regression test); (2) perf (consensus) — excludeNativePluginSkills now probes skills in parallel (Promise.all) instead of serially; (3) cleanup — buildDiscoveredCustomizations matches each native plugin to its SDK entry in a single pass (dropped the redundant second sdk.plugins.find); (4) coverage — added the no-workspace and path-traversal scanner tests. Declined: the "Copilot bare-plugin.json" finding (unreachable — native Claude plugins are only Claude/Open-Plugins format, and parsePlugin would mis-detect a bare manifest under .claude regardless) and the trailing-slash path-fallback nit (mitigated — source is the primary match key).
Status of E2E: verified (launch + code-oss-logs, 2026-06-23). Agents window → Claude (Local Agent Host): composer Customizations bar showed Plugins 1 (alongside Part A's Hooks 1); the "Agent Customizations for Claude [Agent Host]" modal listed a Plugins, 1 items section with `telegram@claude-plugins-official` (status *Loaded*); the renderer log confirmed the resolved root is the real ~/.claude/plugins/cache/claude-plugins-official/telegram/0.0.6/ (the agents/commands/rules ENOENT traces are benign optional-subdir probes); customizationsDebug.log listed the plugins section. Disabling via the workspace .claude/settings.local.json (enabledPlugins: { "telegram@…": false }, local > user precedence) flipped the bar to Plugins / "No plugins configured" via the watcher, and restoring the file brought it back — proving the precedence + watcher + projection path end-to-end. All seeded state restored byte-identically; git status .claude clean.
src/vs/platform/agentHost/test/node/customizations/claudeSessionCustomizationDiscovery.test.tssrc/vs/platform/agentPlugins/test/common/pluginParsers.test.tsOptions.plugins.claude-plugin/plugin.json@skills-dir…/test/node/customizations/scan/claudeAgentSkillScan.test.ts.claude/skills/<name>…/test/node/customizations/claudeSessionCustomizationDiscovery.test.tsplugins: []sdk…/test/node/claudeSdkPipeline.test.tsinit.pluginssnapshotResolvedCustomizations()