getStatus() reports running=true with the current process PID when
transport is stdio (even before the server starts). This caused
start() to throw "already running" with the process's own PID.
Now skips the "already running" check when the detected PID matches
the current process, matching the same logic in commands/mcp.ts.
Co-Authored-By: claude-flow <ruv@ruv.net>
Two issues fixed:
1. PID reuse detection: process.kill(pid, 0) returns true for ANY
process owned by the user, not just the MCP server. When the OS
recycles a PID, this falsely blocks startup with "already running".
Now verifies the process is actually node/claude-flow/npx before
reporting it as running.
2. Legacy PID cleanup: older versions wrote mcp-server.pid to
.claude-flow/ instead of /tmp/. Now cleans up that legacy path
during removePidFile() to prevent ghost locks.
Co-Authored-By: claude-flow <ruv@ruv.net>
Use multi-strategy approach to find .claude/ directory:
1. Check process.cwd() first (most common when invoked by user)
2. Walk up from CLI package location
3. Walk up from CWD as fallback
Fixes discovery returning 0 agents/skills when running from
a subdirectory within the project.
Co-Authored-By: claude-flow <ruv@ruv.net>
Adds 5 new MCP tools to help the system navigate Ruflo's 259 tools,
26 commands, 60+ agents, and 37 skills:
- guidance_capabilities: List all capability areas with tools/agents/skills
- guidance_recommend: Task-based routing to relevant capabilities
- guidance_discover: Live filesystem discovery of agents and skills
- guidance_workflow: Workflow templates for common task types
- guidance_quickref: Quick reference cards for daily operations
Also updates init executor to stop counting .yaml agent files
(all migrated to .md in previous commit).
Co-Authored-By: claude-flow <ruv@ruv.net>
Workers now read status, currentTask, and tasksCompleted from the agent
store instead of always returning idle/null/0. This was a v3 regression
of the fix from #762.
Closes#1382
1. SQL injection: Convert all 9 string-interpolated queries in
memory-initializer.ts to parameterized queries (db.prepare/bind)
Closes#1030
2. Preinstall hook: Remove no-op preinstall script and package.json entry
that triggered supply chain concern
3. SECURITY.md: Add vulnerability disclosure policy with supported
versions, reporting process, and safe harbor statement
4. SafeExecutor: Remove npx from default command allowlist to prevent
arbitrary package execution via safe executor
5. Cleanup command: Add `cleanup` command for removing project artifacts
(.claude/, .swarm/, data/, etc.) with --dry-run default and --force
to execute. Addresses uninstall documentation gap
Published as v3.5.40. All fixes verified in Docker.
Closes#1375
* fix: intelligence layer loads flat array from auto-memory store
The auto-memory-hook.mjs writes a flat JSON array to auto-memory-store.json,
but intelligence.cjs loadEntries() only checked for store.entries (object
wrapper format). This caused the vector store to load only 1 fallback
pattern from MEMORY.md instead of the full 1,300+ entries.
Now supports both formats: flat array and { entries: [...] } wrapper.
Also fixes deprecated Dirent.path usage (use parentPath first).
Co-Authored-By: claude-flow <ruv@ruv.net>
* fix: apply same loadEntries fix to helpers-generator.ts
The published CLI package generates intelligence.cjs during `init` via
helpers-generator.ts — it had the same flat-array bug. Users running
`npx claude-flow init` would get the broken version.
Co-Authored-By: claude-flow <ruv@ruv.net>
* fix: statusline uses real data instead of hardcoded/estimated values
- Hooks: count actual hook entries instead of hardcoding total=17
- Vectors: count real entries from auto-memory-store.json, not file-size/2
- Tests: scan v3/ directory (depth 6), was missing ~2000 test files
- Swarm: only show active if state updated within 5 min (stale check)
- Security: flag as STALE if audit older than 7 days
- ADRs: count actual files (76), don't use stale compliance JSON (7)
- Intelligence: scale to 2000 entries = 100% instead of 100 entries
Co-Authored-By: claude-flow <ruv@ruv.net>
* fix: apply statusline accuracy fixes to generator (end-user path)
The statusline-generator.ts always overwrites the bundled statusline.cjs
during init, so all 6 accuracy fixes must be in both files:
- Hooks: count actual entries, not hardcode 17
- Vectors: read real entry count from store JSON
- Tests: scan depth 6, include v3/ directory
- Swarm: 5-min staleness check on metrics
- Security: PENDING when no audit run, STALE after 7 days
- ADRs: count files directly, skip stale compliance JSON
Co-Authored-By: claude-flow <ruv@ruv.net>
* fix: prevent MCP server self-kill on startup (#1380)
Three compounding bugs caused `mcp start` to crash with "Killed":
1. Self-kill: getStatus() reported current process as "running" for stdio
transport, then start command sent SIGKILL to its own PID
2. Config crash: Zod schema rejected partial configs with non-object values
3. Hook exit: process.exitCode=0 was overridden by async errors
Fixes:
- Add isSelfDetected guard to skip kill when PID matches process.pid
- Add .passthrough() to SystemConfigSchema, merge partial configs with defaults
- Use process.exit(0) in .finally() for reliable hook exits
- Remove invalid hook events (TeammateIdle, TaskCompleted, PostCompact)
- Wrap hook commands in sh -c for cross-platform CLAUDE_PROJECT_DIR expansion
Published as v3.5.39. Tested in Docker — clean startup, no warnings.
Closes#1380
Co-Authored-By: claude-flow <ruv@ruv.net>
- Fix loadEntries() to handle flat array format from auto-memory-store.json
- Fix statusline: real hook count, real vector count, real test count, stale swarm/security checks
- Apply fixes to both local helpers and generator (end-user init path)
- Published as v3.5.31
Co-Authored-By: claude-flow <ruv@ruv.net>
- Update MCP tool count from 175/170/213 to 259 across README and CLAUDE.md
- Update commit count from 5,800 to 5,900+
- Add beginner-friendly callout after install section (addresses #1196)
- Fix claude-flow umbrella v3alpha dist-tag to 3.5.22
- Parser: scoped alias resolution (two-pass) fixes global -t flag collision
- Neural: --pattern-type flag now recognized, predict threshold lowered for hash-fallback
- Hooks: pre-task --task-id optional, added notify subcommand
- Agent metrics: real data from .swarm/ state instead of hardcoded demo
- Security audit: dynamic timestamps from file state instead of 2024 demo data
- Settings generator: Windows-compatible %CLAUDE_PROJECT_DIR% env var
- ADR-063: documents all findings from deep capability audit
Co-Authored-By: claude-flow <ruv@ruv.net>
writeHelpers() copies the pre-installed 577-line statusline.cjs from the
npm package, then writeStatusline() skipped writing because the file
already existed. This meant the full 758-line generated version (with
AgentDB vectors/size, tests, ADRs, hooks, integration stats) was never
used in fresh installs.
Fix: writeStatusline() now always writes the generated version,
overwriting any legacy copy from writeHelpers().
Fixes statusline showing static zeros for vectors/size in new installs.
Co-Authored-By: claude-flow <ruv@ruv.net>
Replace relative paths and $(git rev-parse --show-toplevel) with
$CLAUDE_PROJECT_DIR in all hook commands. Fixes hooks breaking when
Claude Code changes working directory to a subdirectory.
- .claude/settings.json: 15 hook paths updated
- v3/@claude-flow/cli/.claude/settings.json: 9 hook paths updated
- settings-generator.ts: hookHandlerCmd, autoMemoryCmd, statusline fixed
- All three packages bumped to 3.5.15 and published
Co-Authored-By: claude-flow <ruv@ruv.net>
- Dockerfile: sed-comment empty MODELS= and TASK_MODEL= so .env.local overrides work via dotenv-cli -c
- urlSafety: add host.docker.internal to allowed HTTP hostnames for Docker MCP bridge
Co-Authored-By: claude-flow <ruv@ruv.net>