#1793·happy

`--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).

bash
claude --plugin-dir ./my-plugin        # skills + agents available
happy claude --plugin-dir ./my-plugin  # available locally, gone in remote mode

Root 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.

  1. src/index.ts:689-699--plugin-dir xxx falls into unknownArgsoptions.claudeArgs
  2. src/claude/claudeLocal.ts:244args.push(...opts.claudeArgs) spawns the real CLI ✅
  3. src/claude/claudeRemote.ts:58-81claudeArgs is only scanned for --resume; everything else is discarded ❌
  4. src/claude/claudeRemote.ts:122-142 + src/claude/sdk/query.ts:31-46sdkOptions is 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

  1. Add plugins?: { type: 'local'; path: string }[] to QueryOptions in src/claude/sdk/types.ts and map it through in src/claude/sdk/query.ts.
  2. In claudeRemote.ts, extract --plugin-dir values from claudeArgs (alongside the existing --resume extraction) and pass them as plugins.

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