Skip to content

Bug: init --full and init hooks are disconnected — hooks never fire without manual wiring #1484

@s-di-cola

Description

@s-di-cola

Summary

ruflo init --full and ruflo init hooks are two disconnected code paths. Neither one completes the full setup on its own, and running just one (as the README suggests) results in hooks that never fire.

The Problem

Command Creates helpers in .claude/helpers/ Updates .claude/settings.json with hooks
ruflo init --full Yes (40+ scripts) No
ruflo init hooks No Yes (but points to missing scripts)

Result: After ruflo init --full (or just ruflo init), the helper scripts exist but nothing calls them — settings.json is not updated with the hook entries. The README claim that "after running init, just use Claude Code normally — the hooks system automatically routes tasks" is not true.

Running ruflo init hooks separately creates the settings.json entries, but those entries reference helper scripts (hook-handler.cjs, auto-memory-hook.mjs, statusline.cjs) that don't exist because init hooks doesn't create them.

You have to run both commands to get a working setup, and that's not documented anywhere.

Steps to Reproduce

mkdir /tmp/test-ruflo && cd /tmp/test-ruflo

# Method 1: Full init — helpers exist, hooks don't fire
ruflo init --full
cat .claude/settings.json  # No hooks section referencing helpers
ls .claude/helpers/         # 40+ scripts exist but are never called

# Method 2: Hooks init — hooks configured, helpers missing
rm -rf /tmp/test-ruflo && mkdir /tmp/test-ruflo && cd /tmp/test-ruflo
ruflo init hooks --full
cat .claude/settings.json  # Hooks point to .claude/helpers/hook-handler.cjs
ls .claude/helpers/         # Empty directory — scripts don't exist

Expected Behavior

ruflo init --full (or even just ruflo init) should:

  1. Create the helper scripts in .claude/helpers/
  2. AND update .claude/settings.json with the hook entries that call them

One command should produce a working setup.

Additional Issue: No Global Configuration

The helpers are already bundled in the global npm package at:

$(npm root -g)/ruflo/node_modules/@claude-flow/cli/.claude/helpers/

But there's no documented way to configure hooks globally (~/.claude/settings.json) pointing to the globally installed helpers. Users who want ruflo active across all projects without running init per-project have to manually wire this up.

Workaround

We manually added hooks to ~/.claude/settings.json pointing to the globally installed helpers:

{
  "hooks": {
    "UserPromptSubmit": [{
      "hooks": [{
        "type": "command",
        "command": "sh -c 'exec node \"$(npm root -g)/ruflo/node_modules/@claude-flow/cli/.claude/helpers/hook-handler.cjs\" route'",
        "timeout": 10000
      }]
    }]
  }
}

This works globally across all projects without needing ruflo init per-project.

Environment

  • ruflo v3.5.48 (globally installed via npm)
  • macOS Darwin 25.4.0
  • Node v24.8.0 (nvm)
  • Claude Code (VS Code extension)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions