`--plugin-dir` not forwarded to Claude Code in remote mode (plugin skills/agents disappear)
Author: alpha0422Created Sep 16, 2026Updated Sep 16, 2026
Problem
happy claude --plugin-dir /path/to/plugin loads the plugin's skills and agents in the terminal, but they silently vanish once the session switches to remote mode (driven from the mobile/web app, --happy-starting-mode remote, or daemon-spawned).
claude --plugin-dir ./my-plugin # skills + agents available
happy claude --plugin-dir ./my-plugin # available locally, gone in remote modeRoot cause
Same class of bug as #798 (--add-dir) and #934 (--mcp-config): claudeArgs are forwarded verbatim in local mode but dropped in remote mode.
src/index.ts:689-699—--plugin-dir xxxfalls intounknownArgs→options.claudeArgs✅src/claude/claudeLocal.ts:244—args.push(...opts.claudeArgs)spawns the real CLI ✅src/claude/claudeRemote.ts:58-81—claudeArgsis only scanned for--resume; everything else is discarded ❌src/claude/claudeRemote.ts:122-142+src/claude/sdk/query.ts:31-46—sdkOptionsis a fixed whitelist (cwd,resume,mcpServers,permissionMode,model,fallbackModel, system prompts,allowedTools,disallowedTools,effort,canCallTool,abort,settingsPath) with no plugin field and no escape hatch for extra argv.
The SDK already supports this
@anthropic-ai/claude-agent-sdk (happy pins ^0.3.259) exposes:
plugins?: SdkPluginConfig[]—[{ type: 'local', path: '/abs/path' }]pluginDelivery?: 'argv' | 'initialize'—'argv'(default) emits one--plugin-dir <path>per plugin;'initialize'avoids command-line length limits.
Happy never sets either.
Proposed fix
- Add
plugins?: { type: 'local'; path: string }[]toQueryOptionsinsrc/claude/sdk/types.tsand map it through insrc/claude/sdk/query.ts. - In
claudeRemote.ts, extract--plugin-dirvalues fromclaudeArgs(alongside the existing--resumeextraction) and pass them asplugins.
A general mechanism for forwarding pass-through flags into remote mode would fix this, #798, and #934 together.
Environment
- happy-cli: 1.2.3 (repo
main, ac64b9b4) @anthropic-ai/claude-agent-sdk: ^0.3.259- OS: Linux
Source: slopus/happy