Official marketplace for Claude Hook Advisor plugin - intelligent command history tracking with automatic failure detection
npx claudepluginhub sirmews/claude-hook-advisorIntelligent command history tracking with automatic failure detection. Tracks all bash commands Claude runs (successful and failed) with semantic directory aliasing and command mapping.
Share bugs, ideas, or general feedback.
A Rust CLI tool that integrates with Claude Code using hooks to provide intelligent command suggestions, semantic directory aliasing, command history tracking, and security pattern detection.
You: "What files are in my docs?" Claude: "I'll check your docs directory at /Users/you/Documents/Documentation"
Claude tries: npm install
Tool suggests: bun install
Claude runs: bun install automatically
Claude tries to write: eval(userInput)
Tool warns: Security risk detected
Claude: Finds a safer alternative
/plugin marketplace add sirmews/claude-hook-advisor
/plugin install claude-hook-advisor@sirmews
Includes automatic hook setup and slash commands (/history, /history-failures, /history-search).
cargo install claude-hook-advisor
claude-hook-advisor --install-hooks
git clone https://github.com/sirmews/claude-hook-advisor.git
cd claude-hook-advisor
make install
.claude-hook-advisor.toml in your project root:# Command mappings - map any command to your preferred tool
[commands]
npm = "bun"
yarn = "bun"
curl = "wget --verbose"
# Directory aliases - use natural language in conversations
[semantic_directories]
"project docs" = "~/Documents/my-project/docs"
"test data" = "~/Documents/test-data"
That's it! Start a Claude Code conversation and the hooks work automatically. Security patterns are enabled by default with no configuration needed.
Add to your .claude-hook-advisor.toml:
[command_history]
enabled = true
log_file = "~/.claude-hook-advisor/bash-history.db"
View history:
claude-hook-advisor --history # Recent commands
claude-hook-advisor --history --failures # Only failed commands
claude-hook-advisor --history --pattern git # Filter by pattern
Security patterns are enabled by default. To disable specific patterns:
[security_pattern_overrides]
swift_force_unwrap = false # Common in Swift code
eval_injection = false # If working on a REPL
rust_unsafe_block = false # For systems programming
Run claude-hook-advisor --install-hooks to automatically configure hooks, or manually add to .claude/settings.json:
{
"hooks": {
"PreToolUse": { "Bash": "claude-hook-advisor --hook" },
"UserPromptSubmit": { ".*": "claude-hook-advisor --hook" },
"PostToolUse": { "Bash": "claude-hook-advisor --hook" }
}
}
Three hooks work together to provide comprehensive functionality:
The Flow:
.claude-hook-advisor.toml from the current directorySmart Matching:
npm install → bun install ✅npx npm stays unchanged (npm is not the primary command) ✅npm-check stays unchanged (different command) ✅npm install --save → bun install --save ✅The Flow: