diff --git a/v3/@claude-flow/cli/src/commands/hive-mind.ts b/v3/@claude-flow/cli/src/commands/hive-mind.ts index 40cf625241..cc8bdedaa1 100644 --- a/v3/@claude-flow/cli/src/commands/hive-mind.ts +++ b/v3/@claude-flow/cli/src/commands/hive-mind.ts @@ -274,7 +274,12 @@ async function spawnClaudeCodeInstance( } } if (mcpConfigPath) { - claudeArgs.push('--mcp-config', mcpConfigPath); + // #1780 — Claude Code's `--mcp-config` is variadic; passing it as two + // argv tokens (`--mcp-config`, ``) lets a later positional (the + // hive-mind prompt) be slurped as a second config file, producing + // `ENAMETOOLONG: name too long, open` once the prompt exceeds PATH_MAX. + // Use `=`-syntax so the flag stays attached to its single value. + claudeArgs.push(`--mcp-config=${mcpConfigPath}`); output.printInfo(`Spawned worker MCP config: ${mcpConfigPath}`); } else { output.printWarning('No .mcp.json or ~/.claude.json found — spawned worker will not have mcp__ruflo__* tools (#1748 Issue 2). Pass --mcp-config or run "ruflo init" to generate one.');