-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Bug: init --full and init hooks are disconnected — hooks never fire without manual wiring #1484
Description
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 existExpected Behavior
ruflo init --full (or even just ruflo init) should:
- Create the helper scripts in
.claude/helpers/ - AND update
.claude/settings.jsonwith 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)