Claude Code hook
claude-hook-advisor
Hook that suggests preferred alternatives when Claude reaches for certain commands.
Install
/plugin marketplace add sirmews/claude-hook-advisorgit clone https://github.com/sirmews/claude-hook-advisor.gitFrom the README
Claude Hook Advisor 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. Features - π― Command Intelligence - Automatically map commands to your preferred alternatives (npm β bun, curl β wget) - π Directory Aliasing - Use natural language like "docs" or "project_docs" instead of typing full paths - π Command History - Track all commands Claude runs in a SQLite database with session tracking - π Security Patterns - 27 built-in patterns detect dangerous code across 10+ languages - β‘ Fast & Lightweight - Rust-based with ~1-5ms hook response time Quick Example 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 Installation Option 1: Plugin Marketplace (Recommended) Includes automatic hook setup and slash commands (/history, /history-failures, /history-search). Option 2: From crates.io Option 3: From Source Quick Start 1. Install via plugin marketplace (recommended) or cargo 2. Create .claude-hook-advisor.toml in your project root: That's it! Start a Claude Code conversation and the hooks work automatically. Security patterns are enabled by default with no configuration needed. π Optional: Enable Command History Tracking Add to your .claude-hook-advisor.toml: View history: π Optional: Disable Noisy Security Patterns Security patterns are enabled by default. To disable specific patterns: Configuration Run claude-hook-advisor --install-hooks toβ¦
How hooks work
- Hooks are shell commands Claude Code runs at fixed points: before or after a tool call, when you submit a prompt, when Claude stops, on notifications and at session start.
- They are set in the hooks section of ~/.claude/settings.json (or .claude/settings.json for a project), or come bundled in a plugin.
- A hook can block a tool call, add context, or run a formatter or test. Read the scripts before you install them: they run on your machine with your permissions.
Details
- Repository
- sirmews/claude-hook-advisor
- Type
- Hooks
- Language
- Rust
- Last updated
- 30 November 2025
- Topics
- claudeclaude-codeclaude-hooks
FAQ
What is claude-hook-advisor?
Hook that suggests preferred alternatives when Claude reaches for certain commands. It is a hook for Claude Code, from sirmews/claude-hook-advisor on GitHub.
How do I install claude-hook-advisor?
Run /plugin marketplace add sirmews/claude-hook-advisor inside Claude Code, then follow the setup in the README.
Is claude-hook-advisor popular?
sirmews/claude-hook-advisor has 23 GitHub stars and 3 forks. It was last updated on 30 November 2025.
More hooks
MadameClaude
25williamkapke/MadameClaude
Madame Claude is a monitoring system for Claude Code hooks that captures and streams tool usage events to a web interface.
Claude Brain
38mikeadolan/claude-brain
Persistent memory for Claude Code. Local SQLite + MCP + hooks.
CC Thingz
39alexei-led/cc-thingz
Portable skills, agents, hooks, and Pi extensions for Claude Code, Codex CLI, Copilot, Cursor, Grok, and Pi.
Claude Code Security Hooks
39slavaspitsyn/claude-code-security-hooks
7 layers of defense against prompt injection in Claude Code. Security hooks, read guards, canary files, and self-protection.
Founder OS
24cloudrepo-io/founder-os
Run your company with an AI team. No complex toolingβjust markdown files and Claude.
Claude Code Mastery
40alperhankendi/claude-code-mastery
Claude Code guides, hooks, MCP and workflow reference
Browse the most popular Claude Code mods, all hooks, or the skills and MCP server directories.