Repository navigation
feat(agent/agentcontext): discover plugin packs in the Claude Code plugin cache layout - #223
Conversation
|
@codex review
|
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c646447d74
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…nv override, and disabled plugins Accept string or array declarations for skills and agents in plugin manifests, serve single agent .md file entries, recognize the CLAUDE_CODE_PLUGIN_CACHE_DIR cache, and skip cached plugins the user settings disable.
|
@codex review
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a9aeee8cd9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
… folders in packs
|
@codex review
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d87c381e51
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…manifestless cache plugins
|
@codex review
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9aa417b817
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…claude-cache # Conflicts: # agent/agentcontext/fork_plugins.go # agent/agentcontext/fork_plugins_test.go
|
@codex review
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: de2d3223a2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…FIG_DIR settings with a cache override
|
@codex review
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4b7a97dee7
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…ts, marketplace entries, root skills, plugin root and nested agents
|
@codex review
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4a97506eed
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
… declared agents of Claude packs
|
@codex review
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 00b816e4d1
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
… settings, entry sources and local marketplaces
|
@codex review
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a412921a34
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Lead merge check on head |
~/.claude/plugins/cacheis a built-in plugin pack scan root, but Claude Code installs plugins there ascache/<marketplace>/<plugin>/<version>/, three levels below the root. Pack discovery only looked at the root and its direct children, so it found nothing in that directory.Pack discovery now walks the Claude Code cache layout and emits one pack per cached plugin: the newest version directory that holds a manifest and has no
.orphaned_atmarker. Claude Code keeps superseded or uninstalled versions for 14 days with that marker, so emitting every version would serve stale copies next to the current one. The watch set now covers the marketplace, plugin, and live version directories, so a new install, a new version, or an orphan marker triggers a resync.Discovery also follows more of Claude Code's plugin rules:
skillsandagentsin.claude-plugin/plugin.jsonmay be a string or an array of strings, and anagentsentry may name a single.mdfile. Any other non-null shape rejects the plugin, as Claude Code does. As in Claude Code, a declared path that escapes the plugin or does not exist is dropped and the rest of the plugin loads, and a declaredagentsentry that is not a.mdfile loads nothing. Cursor and root manifests keep falling back to the default directories and accept agent folders.known_marketplaces.jsoninstall location, or fromplugins/marketplaces/<marketplace>/.claude-plugin/marketplace.json. An entry counts only with anameand a validsource. Withoutplugin.jsonthe entry is the manifest. Withplugin.json, the entry'sskillsandagentsare added, unless the entry setsstrict: false, in which case any component field inplugin.jsonrejects the plugin. Catalog writes trigger a resync, but themarketplaces/directory itself is not watched.known_marketplaces.jsonloads its relative-path plugins in place from the marketplace folder, as Claude Code does, wheninstalled_plugins.jsonhas a user, unscoped or managed record for them and the folder stays inside the marketplace root. An in-place plugin replaces a cached copy with the same id, and its catalog and folder are watched.SKILL.mdat its root and noskills/directory orskillsfield loads that file as its one skill, named from its front-matter.${CLAUDE_PLUGIN_ROOT}in a Claude plugin's skill or agent Markdown body is replaced with the plugin root. Front-matter is left unchanged.agents/directory of a Claude plugin is walked into subfolders (at most 4 levels and 64 folders, no symlinks) and each folder is watched. A nested agent keeps its own name, without Claude Code'splugin:folder:prefix, so clashes fall to first-wins.plugins/installed_plugins.jsonnext to the cache picks the version when it names one. User, unscoped and managed records count; a plugin recorded only with project or local scope is skipped, because the agent does not know which project a session runs in. Without a usable record, discovery falls back to the newest live version.CLAUDE_CODE_PLUGIN_CACHE_DIRis set,<that dir>/cachereplaces~/.claude/plugins/cacheas the built-in scan root.CLAUDE_CONFIG_DIRis set, the cache moves to<that dir>/plugins/cacheand the user settings to<that dir>/settings.json. IfCLAUDE_CODE_PLUGIN_CACHE_DIRis also set, the cache follows it and the settings stay in the config directory.<plugin>@<marketplace>id isfalseunderenabledPluginsin the user settings file is skipped. A plugin with no setting followsdefaultEnabledfrom its marketplace entry or manifest, but starts enabled when an enabled plugin depends on it. An enabled plugin whose dependency is turned off does not load, as Claude Code reports it as a dependency error. Project, local and managed settings are not read, because the agent does not know which project a session runs in. A write to that settings file, or to its target when it is a symlink, triggers a resync.Two packs that expose the same skill or agent name still resolve first-wins, as they do for every pack source.
Not handled yet:
hooksandmcpServersin a marketplace entry,skills: nullis treated as absent, a dependency that is not installed does not fail its dependent (its install may be at a scope the agent cannot see), and dependency version ranges are not checked.Validation: on a412921,
gofmt -l agent/agentcontextis clean, andgo build ./agent/...,go vet ./agent/agentcontext/...andgo test -count=3 ./agent/agentcontext/...pass.Related to #12.