By sirmews
Track and debug bash commands run by Claude with automatic failure detection, history analysis, pattern searches, session reviews, and fix suggestions. Use hooks to enforce best practices, guard tool calls, and validate setup for reliable automation workflows.
npx claudepluginhub sirmews/claude-hook-advisor --plugin claude-hook-advisorShow only failed bash commands from history
Search command history by pattern (usage: /history-search <pattern>)
Show command history for a specific session (usage: /history-session <session-id>)
Show recent bash command history (last 20 commands)
Validate claude-hook-advisor installation and configuration
Displays risk level and recovery info before every Bash command execution
Self-evolving Claude Code system that learns from corrections, manages context, and improves every session
Operational guidelines: terse responses, sequential execution, no destructive ops without confirmation
Automatic history search - checks past sessions before web research, planning, and debugging
Safety hooks to block or require user approval for dangerous commands (rm, git operations, .env access, file size limits)
Block destructive git and filesystem commands before execution
Executes bash commands
Hook triggers when Bash tool is used
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:
Own this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge.
Sign in to claimOwn this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge.
Sign in to claim