Loads installed marketplace plugins. Source: extensions/internal/plugins.ts.
- Reads the plugin cache at
~/.claude/plugins/cache, active perenabledPluginsin user settings only (the user file and the--settingsflag; a--setting-sourceslist withoutuserdrops the user file's entries): a checked-out repo cannot flip which code-bearing plugins run, so project settings never toggle them. The version that loads is the one~/.claude/plugins/installed_plugins.jsonrecords (a user-scope install first); with no usable record, the newest version directory not marked.orphaned_at. Cache directories can be named by commit sha, so the name alone does not say which is newest. - Contributes commands as
/plugin:name, agents, hooks, MCP servers (tools aliasedmcp__plugin_<plugin>_<server>__<tool>), and output styles. - Enablement follows Claude's precedence: a managed-settings
enabledPluginsentry force-enables or blocks, then the user'senabledPluginssetting, then the manifest'sdefaultEnabled(defaulttrue: an installed plugin with no entry runs). - Substitutes
${CLAUDE_PLUGIN_ROOT},${CLAUDE_PLUGIN_DATA}, and${user_config.KEY}(frompluginConfigs[id].optionsin user settings or the--settingsflag). A shell-form hook command and an MCPheadersHelperreject${user_config.KEY}, as Claude does: a hook carrying one is dropped, and a server whose helper carries one is skipped. A plugin command body substitutes it like the rest of its content,!spans included. - Skill directories contribute too, though pi's loader names them without the plugin prefix.
- Skills: the plugin's
skills/directory is always scanned, and any directory the manifest'sskillsnames is loaded alongside it rather than replacing it. Claude's single-skill layout (SKILL.mdat the plugin root) is not supported: pi's loader owns the directory layout and looks for<dir>/<name>/SKILL.md.