Claude Code hook

claude-hook-advisor

Hook that suggests preferred alternatives when Claude reaches for certain commands.

23 stars 3 forksHooks Plugin marketplace Source

Install

Inside Claude Code
/plugin marketplace add sirmews/claude-hook-advisor
From source
git clone https://github.com/sirmews/claude-hook-advisor.git

From 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…
Read the full README on GitHub

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.
Claude Code docs

Details

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

Browse the most popular Claude Code mods, all hooks, or the skills and MCP server directories.