Solutions for common issues with the RuVector hooks system.
- Quick Diagnostics
- Installation Issues
- Hook Execution Issues
- Intelligence Layer Issues
- Performance Issues
- Platform-Specific Issues
- Migration Issues
- Debug Mode
# Check overall health
npx ruvector hooks stats --verbose
# Validate configuration
npx ruvector hooks validate-config
# Test hook execution
npx ruvector hooks pre-edit --file test.ts
npx ruvector hooks post-edit --file test.ts --success true| Symptom | Likely Cause | Solution |
|---|---|---|
| Hooks not running | Missing settings.json | Run hooks install |
| "Command not found" | CLI not in PATH | Use npx ruvector |
| No agent assignment | Intelligence disabled | Set RUVECTOR_INTELLIGENCE_ENABLED=true |
| Slow hook execution | Large memory | Clean old trajectories |
| Windows errors | Shell mismatch | Check shell wrapper |
Symptoms:
Error: Failed to create .ruvector directory
Permission denied
Solutions:
- Check directory permissions:
ls -la .
# Ensure you have write access- Create directory manually:
mkdir -p .ruvector/intelligence
npx ruvector hooks init- Use sudo (last resort):
sudo npx ruvector hooks init
sudo chown -R $USER:$USER .ruvectorSymptoms:
.claude/settings.jsonunchanged- Old hooks still running
Solutions:
- Use
--forceflag:
npx ruvector hooks install --force- Check backup and restore:
# View backup
cat .claude/settings.json.backup
# If needed, restore and try again
cp .claude/settings.json.backup .claude/settings.json
npx ruvector hooks install --force- Manually edit settings:
# Open and verify hook section
code .claude/settings.jsonSymptoms:
npm ERR! could not determine executable to run
Solutions:
- Install globally:
npm install -g @ruvector/cli
ruvector hooks init- Check npm configuration:
npm config get prefix
# Ensure this is in your PATH- Use npx with package:
npx @ruvector/cli hooks initSymptoms:
- No output when editing files
- Session start message missing
- Intelligence not active
Diagnosis:
# Check settings.json has hooks
cat .claude/settings.json | jq '.hooks'
# Should show PreToolUse, PostToolUse, etc.Solutions:
- Reinstall hooks:
npx ruvector hooks install --force- Check matcher patterns:
{
"hooks": {
"PreToolUse": [{
"matcher": "Bash", // Case-sensitive!
"hooks": [...]
}]
}
}- Verify Claude Code is loading settings:
# Restart Claude Code to reload settingsSymptoms:
Warning: Hook timeout after 3000ms
Solutions:
- Increase timeout in settings:
{
"hooks": {
"PreToolUse": [{
"matcher": "Bash",
"hooks": [{
"timeout": 5000, // Increase to 5 seconds
"command": "..."
}]
}]
}
}- Check for slow operations:
# Time hook execution
time npx ruvector hooks pre-edit --file test.ts- Reduce hook complexity:
- Disable neural training in pre-hooks
- Use async for heavy operations
- Cache repeated lookups
Symptoms:
- Edit operations not completing
- "continue: false" in output
Diagnosis:
# Test hook directly
npx ruvector hooks pre-edit --file problematic-file.ts
# Check response
# { "continue": false, "reason": "..." }Solutions:
- Check protected files:
# If file is protected, you'll see:
# { "continue": false, "reason": "Protected file" }
# Add to exceptions in config.toml
[hooks]
protected_exceptions = [".env.local"]- Disable blocking:
{
"hooks": {
"PreToolUse": [{
"matcher": "Write",
"hooks": [{
"command": "...",
"continueOnError": true // Never block on error
}]
}]
}
}Symptoms:
assignedAgentalways null- No intelligence guidance
Diagnosis:
# Check intelligence status
npx ruvector hooks stats
# Expected output:
# Patterns: N
# Memories: N
# Status: ReadySolutions:
- Enable intelligence:
export RUVECTOR_INTELLIGENCE_ENABLED=true- Check data files exist:
ls -la .ruvector/intelligence/
# Should show patterns.json, memory.json, etc.- Initialize fresh data:
npx ruvector hooks init --forceSymptoms:
- Wrong agent assigned to file types
- Low confidence scores
Diagnosis:
# Check patterns
npx ruvector hooks stats --verbose
# Look for:
# Top Patterns:
# 1. edit_rs_in_xxx → rust-developer (Q=0.82)Solutions:
- Reset learning data:
rm .ruvector/intelligence/patterns.json
rm .ruvector/intelligence/trajectories.json
# Will rebuild from scratch- Import team patterns:
npx ruvector hooks import --input team-patterns.json- Wait for learning:
- Patterns improve with use
- 50+ edits needed for good suggestions
Symptoms:
- Memory search timeout
- "Error: Failed to load memory"
Diagnosis:
# Check memory size
ls -la .ruvector/intelligence/memory.json
# If >10MB, consider cleanupSolutions:
- Clean old memories:
# Backup first
cp .ruvector/intelligence/memory.json memory-backup.json
# Keep only recent
node -e "
const fs = require('fs');
const data = JSON.parse(fs.readFileSync('.ruvector/intelligence/memory.json'));
const recent = data.slice(-1000); // Keep last 1000
fs.writeFileSync('.ruvector/intelligence/memory.json', JSON.stringify(recent));
"- Rebuild HNSW index:
rm .ruvector/intelligence/memory.rvdb
# Will rebuild on next useSymptoms:
- Slow file operations
- Noticeable delay on every edit
Diagnosis:
# Time individual hooks
time npx ruvector hooks pre-edit --file test.ts
time npx ruvector hooks post-edit --file test.ts --success true
# Target: <50ms eachSolutions:
- Disable neural training:
# In config.toml
[intelligence]
neural_training = false- Reduce memory operations:
[hooks]
store_memory = false # Disable memory storage- Use async post-hooks:
{
"hooks": {
"PostToolUse": [{
"matcher": "Write",
"hooks": [{
"command": "...",
"async": true // Don't wait for completion
}]
}]
}
}Symptoms:
.ruvector/intelligence/>100MB- Slow startup
Solutions:
- Set retention limits:
# In config.toml
[intelligence]
max_trajectories = 1000
max_memories = 10000- Clean old data:
# Export current patterns
npx ruvector hooks export --output patterns-backup.json --include patterns
# Reset
rm -rf .ruvector/intelligence/*
# Re-import patterns
npx ruvector hooks import --input patterns-backup.jsonSymptoms:
'/bin/bash' is not recognized as an internal or external command
Solution:
Check that hooks use Windows-compatible shell:
{
"hooks": {
"PreToolUse": [{
"matcher": "Bash",
"hooks": [{
"command": "cmd /c 'npx ruvector hooks pre-command'"
}]
}]
}
}Or reinstall hooks (auto-detects platform):
npx ruvector hooks install --forceSymptoms:
- File paths not recognized
- "File not found" errors
Solution:
Ensure paths use forward slashes or escaped backslashes:
# Good
npx ruvector hooks pre-edit --file "src/app.ts"
# Bad on Windows
npx ruvector hooks pre-edit --file "src\app.ts"Symptoms:
'jq' is not recognized as an internal or external command
Solutions:
- Install jq:
# Using chocolatey
choco install jq
# Using scoop
scoop install jq- Or use jq-free hooks:
npx ruvector hooks install --template minimalSymptoms:
Error: EACCES: permission denied
Solutions:
- Fix npm permissions:
sudo chown -R $(whoami) ~/.npm- Use nvm:
# Install nvm and use it for npm
nvm install node
nvm use nodeSymptoms:
SyntaxError: Unexpected token '.'
Solution:
Update Node.js:
# Using nvm
nvm install 18
nvm use 18
# Or using package manager
curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
sudo apt-get install -y nodejsSymptoms:
- Fewer patterns after migration
- Missing memories
Diagnosis:
# Compare counts
echo "Before: $(jq '.length' old-patterns.json)"
echo "After: $(npx ruvector hooks stats --json | jq '.patterns')"Solutions:
- Use validation:
npx ruvector hooks migrate --from old-data --validate- Merge instead of replace:
npx ruvector hooks migrate --from old-data --merge- Restore from backup:
cp .ruvector/intelligence/backup-*/* .ruvector/intelligence/Symptoms:
Error: Unknown embedding format in memory.db
Solution:
SQLite migration requires format detection. For MVP, use JSON export:
# Export from source as JSON first
npx claude-flow memory export --output memory.json
# Then import
npx ruvector hooks import --input memory.json# Set environment variable
export CLAUDE_FLOW_DEBUG=true
export RUVECTOR_DEBUG=true
# Run with debug
npx ruvector hooks pre-edit --file test.ts --debugDEBUG: Loading config from .ruvector/config.toml
DEBUG: Intelligence enabled: true
DEBUG: Q-table loaded: 89 patterns
DEBUG: Memory loaded: 543 vectors
DEBUG: Encoding state for test.ts
DEBUG: State key: edit_ts_in_project
DEBUG: Q-values: { "typescript-developer": 0.82, "coder": 0.45 }
DEBUG: Selected agent: typescript-developer (confidence: 0.82)
# Today's logs
cat .ruvector/logs/hooks-$(date +%Y-%m-%d).log
# Tail logs
tail -f .ruvector/logs/hooks-*.log# Test pre-edit
echo '{"tool_input":{"file_path":"test.ts"}}' | npx ruvector hooks pre-edit --stdin
# Test post-edit
echo '{"tool_input":{"file_path":"test.ts"},"tool_result":{"success":true}}' | npx ruvector hooks post-edit --stdin# Create diagnostic report
{
echo "=== RuVector Version ==="
npx ruvector --version
echo -e "\n=== Node Version ==="
node --version
echo -e "\n=== Platform ==="
uname -a
echo -e "\n=== Hooks Stats ==="
npx ruvector hooks stats --json
echo -e "\n=== Config ==="
cat .ruvector/config.toml
echo -e "\n=== Settings ==="
cat .claude/settings.json | jq '.hooks'
} > ruvector-diagnostic.txt
echo "Diagnostic saved to ruvector-diagnostic.txt"- Create diagnostic report (above)
- Open issue: https://github.com/ruvnet/ruvector/issues
- Include:
- Diagnostic report
- Steps to reproduce
- Expected vs actual behavior
- User Guide - Getting started
- CLI Reference - Command documentation
- Architecture - Technical details
- Migration Guide - Upgrade from other systems