Skip to content

agent: pass configured Claude Code plugin dirs to the CLI - #414

Open
GrigoryPervakov wants to merge 1 commit into
mainfrom
grigory/agent-claude-plugin-dirs
Open

agent: pass configured Claude Code plugin dirs to the CLI#414
GrigoryPervakov wants to merge 1 commit into
mainfrom
grigory/agent-claude-plugin-dirs

Conversation

@GrigoryPervakov

Copy link
Copy Markdown
Member

What

New agent.claude_plugin_dirs config key: extra local plugin directories forwarded to the Claude CLI as --plugin-dir, appended after plugins auto-discovered from ~/.claude.

Why

Auto-discovery only forwards cached plugins that ship .mcp.json, and Nerve spawns the CLI with setting_sources=[] so it never reads ~/.claude/settings.json itself. Marketplace LSP plugins declare lspServers in the marketplace manifest and cache no manifest at all — they currently have no route into Nerve sessions. A local plugin dir with .claude-plugin/plugin.json declaring lspServers closes that gap.

Verified end-to-end with the bundled CLI (2.1.235) in Nerve's exact spawn mode (--setting-sources= --plugin-dir <dir>): a gopls lspServers stanza loads (Loaded 1 LSP server(s) from plugin), and compiler diagnostics (IncompatibleAssign, UnusedVar) attach to subsequent tool results.

Details

  • load_claude_code_plugins(extra_dirs=...): entries are expanduser().resolve()d (the CLI subprocess runs in the session workspace, not the daemon cwd), and dirs without .claude-plugin/plugin.json are skipped with a warning.
  • Both engine call sites (initialize + reload_mcp_config) pass config.agent.claude_plugin_dirs; like every agent.* key, YAML edits land via the full config reload.
  • Docs row in docs/config.md, 12 tests in tests/test_claude_plugins.py (also covering the previously untested auto-discovery path and the scalar→list coercion contract).

Note: tests/test_bootstrap.py::TestCredentialWaterfall (3 tests) fails on my machine with real credentials installed — pre-existing on main, unrelated; expecting clean CI to confirm.

🤖 Generated with Claude Code

New agent.claude_plugin_dirs config key: extra local plugin directories
forwarded to the CLI as --plugin-dir alongside plugins auto-discovered
from ~/.claude. Auto-discovery only forwards cached plugins that ship
.mcp.json, and the CLI runs with setting_sources=[], so LSP-type
plugins (lspServers manifests, e.g. gopls diagnostics) previously had
no route into Nerve sessions.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.

1 participant