docs: update CLAUDE.md with RuVector hooks config, add hooks to npm README

Updates all hook commands to use npx ruvector instead of ruvector
for portability (no global install required).

Updated files:
- .claude/settings.json - all hooks now use npx ruvector
- CLAUDE.md - documentation updated to npx ruvector

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
rUv 2025-12-30 17:10:45 +00:00
parent 11f271f931
commit dd0887cd35
2 changed files with 40 additions and 65 deletions

View file

@ -38,7 +38,8 @@
"Bash(.claude/hooks:*)",
"Bash(.claude/intelligence:*)",
"Bash(ruvector:*)",
"Bash(ruvector-cli:*)"
"Bash(ruvector-cli:*)",
"Bash(npx ruvector:*)"
],
"deny": [
"Bash(rm -rf /)"
@ -49,19 +50,13 @@
{
"matcher": "Edit|Write|MultiEdit",
"hooks": [
{
"type": "command",
"command": "ruvector hooks pre-edit \"$TOOL_INPUT_file_path\""
}
"npx ruvector hooks pre-edit \"$TOOL_INPUT_file_path\""
]
},
{
"matcher": "Bash",
"hooks": [
{
"type": "command",
"command": "ruvector hooks pre-command \"$TOOL_INPUT_command\""
}
"npx ruvector hooks pre-command \"$TOOL_INPUT_command\""
]
}
],
@ -69,41 +64,21 @@
{
"matcher": "Edit|Write|MultiEdit",
"hooks": [
{
"type": "command",
"command": "ruvector hooks post-edit \"$TOOL_INPUT_file_path\""
}
"npx ruvector hooks post-edit \"$TOOL_INPUT_file_path\""
]
},
{
"matcher": "Bash",
"hooks": [
{
"type": "command",
"command": "ruvector hooks post-command \"$TOOL_INPUT_command\""
}
"npx ruvector hooks post-command \"$TOOL_INPUT_command\""
]
}
],
"SessionStart": [
{
"hooks": [
{
"type": "command",
"command": "ruvector hooks session-start"
}
]
}
"npx ruvector hooks session-start"
],
"Stop": [
{
"hooks": [
{
"type": "command",
"command": "ruvector hooks session-end"
}
]
}
"npx ruvector hooks session-end"
],
"PreCompact": [
{
@ -112,7 +87,7 @@
{
"type": "command",
"timeout": 3000,
"command": "/usr/local/bin/ruvector-cli hooks pre-compact --auto"
"command": "npx ruvector hooks pre-compact --auto"
}
]
},
@ -122,7 +97,7 @@
{
"type": "command",
"timeout": 3000,
"command": "/usr/local/bin/ruvector-cli hooks pre-compact"
"command": "npx ruvector hooks pre-compact"
}
]
}
@ -133,7 +108,7 @@
{
"type": "command",
"timeout": 2000,
"command": "/usr/local/bin/ruvector-cli hooks suggest-context"
"command": "npx ruvector hooks suggest-context"
}
]
}
@ -145,7 +120,7 @@
{
"type": "command",
"timeout": 1000,
"command": "/usr/local/bin/ruvector-cli hooks track-notification"
"command": "npx ruvector hooks track-notification"
}
]
}

View file

@ -217,21 +217,21 @@ Flow-Nexus extends MCP capabilities with 70+ cloud-based orchestration tools:
**1⃣ BEFORE Work:**
```bash
ruvector hooks session-start
ruvector hooks pre-edit "[file]"
ruvector hooks pre-command "[command]"
npx ruvector hooks session-start
npx ruvector hooks pre-edit "[file]"
npx ruvector hooks pre-command "[command]"
```
**2⃣ DURING Work:**
```bash
ruvector hooks post-edit "[file]" --success
ruvector hooks remember "[context]" -t swarm
ruvector hooks post-command "[command]" --success
npx ruvector hooks post-edit "[file]" --success
npx ruvector hooks remember "[context]" -t swarm
npx ruvector hooks post-command "[command]" --success
```
**3⃣ AFTER Work:**
```bash
ruvector hooks session-end
npx ruvector hooks session-end
```
## 🎯 Concurrent Execution Examples
@ -301,18 +301,18 @@ This project uses **RuVector's self-learning intelligence hooks** configured in
{
"hooks": {
"PreToolUse": [
{ "matcher": "Edit|Write|MultiEdit", "hooks": ["ruvector hooks pre-edit \"$TOOL_INPUT_file_path\""] },
{ "matcher": "Bash", "hooks": ["ruvector hooks pre-command \"$TOOL_INPUT_command\""] }
{ "matcher": "Edit|Write|MultiEdit", "hooks": ["npx ruvector hooks pre-edit \"$TOOL_INPUT_file_path\""] },
{ "matcher": "Bash", "hooks": ["npx ruvector hooks pre-command \"$TOOL_INPUT_command\""] }
],
"PostToolUse": [
{ "matcher": "Edit|Write|MultiEdit", "hooks": ["ruvector hooks post-edit \"$TOOL_INPUT_file_path\""] },
{ "matcher": "Bash", "hooks": ["ruvector hooks post-command \"$TOOL_INPUT_command\""] }
{ "matcher": "Edit|Write|MultiEdit", "hooks": ["npx ruvector hooks post-edit \"$TOOL_INPUT_file_path\""] },
{ "matcher": "Bash", "hooks": ["npx ruvector hooks post-command \"$TOOL_INPUT_command\""] }
],
"SessionStart": ["ruvector hooks session-start"],
"Stop": ["ruvector hooks session-end"],
"UserPromptSubmit": [{ "hooks": [{ "command": "ruvector-cli hooks suggest-context" }] }],
"PreCompact": [{ "matcher": "auto|manual", "hooks": [{ "command": "ruvector-cli hooks pre-compact" }] }],
"Notification": [{ "matcher": ".*", "hooks": [{ "command": "ruvector-cli hooks track-notification" }] }]
"SessionStart": ["npx ruvector hooks session-start"],
"Stop": ["npx ruvector hooks session-end"],
"UserPromptSubmit": [{ "hooks": [{ "command": "npx ruvector hooks suggest-context" }] }],
"PreCompact": [{ "matcher": "auto|manual", "hooks": [{ "command": "npx ruvector hooks pre-compact" }] }],
"Notification": [{ "matcher": ".*", "hooks": [{ "command": "npx ruvector hooks track-notification" }] }]
}
}
```
@ -342,26 +342,26 @@ RUVECTOR_MEMORY_BACKEND=rvlite # Memory storage backend
```bash
# Session Management
ruvector hooks session-start # Start session tracking
ruvector hooks session-end # End session, save learning
npx ruvector hooks session-start # Start session tracking
npx ruvector hooks session-end # End session, save learning
# Pre/Post Edit (triggered automatically)
ruvector hooks pre-edit <file> # Get agent suggestions
ruvector hooks post-edit <file> --success # Record outcome
npx ruvector hooks pre-edit <file> # Get agent suggestions
npx ruvector hooks post-edit <file> --success # Record outcome
# Pre/Post Command (triggered automatically)
ruvector hooks pre-command "cargo test" # Analyze command risk
ruvector hooks post-command "cargo test" --success # Record outcome
npx ruvector hooks pre-command "cargo test" # Analyze command risk
npx ruvector hooks post-command "cargo test" --success # Record outcome
# Intelligence
ruvector hooks init # Initialize hooks in project
ruvector hooks stats # Show learning statistics
ruvector hooks route <task> # Get agent routing suggestion
ruvector hooks suggest-context # Get context suggestions
npx ruvector hooks init # Initialize hooks in project
npx ruvector hooks stats # Show learning statistics
npx ruvector hooks route <task> # Get agent routing suggestion
npx ruvector hooks suggest-context # Get context suggestions
# Memory
ruvector hooks remember <content> -t <type> # Store in vector memory
ruvector hooks recall <query> # Semantic search memory
npx ruvector hooks remember <content> -t <type> # Store in vector memory
npx ruvector hooks recall <query> # Semantic search memory
```
### What You'll See