Hooks initialization uses incorrect npm package name (@claude-flow/cli instead of claude-flow)
- Dominant language
- TypeScript
- Stars
- 72.7k
- Forks
- 8.6k
- Avg merge
- 2d 23h
- Merged PRs (30d)
- 83
Description
## Bug Description
When claude-flow initializes hooks in `.claude/settings.json`, it generates commands using `npx @claude-flow/cli@latest` which is not a valid npm package name. The actual published package is `claude-flow`.
## Expected Behavior
The generated hooks should use:
```bash
npx claude-flow hooks pre-edit ...
```
Or for Windows compatibility, the direct node path:
```bash
node ./node_modules/claude-flow/v3/@claude-flow/cli/bin/cli.js hooks pre-edit ...
```
## Actual Behavior
The generated hooks use:
```bash
npx @claude-flow/cli@latest hooks pre-edit ...
```
This silently fails because `@claude-flow/cli` is an internal directory structure within the `claude-flow` package, not a published npm package.
## Environment
- OS: Windows 11
- Node: v20.x
- claude-flow version: 3.0.0-alpha.179
## Steps to Reproduce
1. Install claude-flow: `npm install claude-flow`
2. Initialize hooks (or use a project with hooks already configured)
3. Observe that `.claude/settings.json` contains `npx @claude-flow/cli@latest` commands
4. These commands produce no output and fail silently
## Evidence
```bash
# This fails silently (no output):
npx @claude-flow/cli@latest hooks --help
# This works correctly:
node ./node_modules/claude-flow/v3/@claude-flow/cli/bin/cli.js hooks --help
```
## Workaround
Replace all instances of `npx @claude-flow/cli@latest` with the direct node path in `.claude/settings.json`:
```json
"command": "node ./node_modules/claude-flow/v3/@claude-flow/cli/bin/cli.js hooks pre-edit --file \"$TOOL_INPUT_file_path\" --format json"
```
## Suggested Fix
Update the hooks initialization code to use the correct package name (`claude-flow`) or the direct node path for better cross-platform compatibility.
Contributor guide
Research direction
Start by locating the hook initialization code that generates .claude/settings.json and search for the `npx @claude-flow/cli@latest` command. Update the generated commands to use the published claude-flow package or the documented direct node path, then verify that the resulting hooks run successfully with `hooks --help` and `hooks pre-edit`.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- nodejs, typescript
- Domain
- cli, tooling
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100