Files
ruflo/v3/@claude-flow
Marius CarlssonandClaude Opus 5.5 966d8a0645 fix(mcp): start the MCP server in the session project, fix win32 home guard
The ruflo-core MCP launcher spawned `@claude-flow/cli mcp start` with its
own process.cwd() and never consulted the session's project directory, so
MCP tools could read/write .claude-flow state (hive-mind, swarm, memory)
in a different folder than CLI commands, producing split-brain state.

- mcp-launch.cjs: resolve the project dir (CLAUDE_PROJECT_DIR, then
  CLAUDE_FLOW_CWD, then launcher cwd; home/root/missing dirs skipped),
  spawn the server with that cwd and CLAUDE_FLOW_CWD set, probe local
  CLI installs from it, and warn on stderr when there is no project.
- cli-core getProjectCwd(): treat filesystem roots (incl. C:\) and the
  home dir (os.homedir(), $HOME, $USERPROFILE; case/trailing-sep
  insensitive on win32) as "no project". The old `=== process.env.HOME`
  guard was a no-op on Windows where HOME is usually unset.

Tests: node:test end-to-end launcher cases + vitest spec for the guard.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 15:29:54 +02:00
..
…