froggeric/claude-smart-approval

4 stars · Last commit 2026-04-19

Claude Code hook that auto-approves safe Bash commands. Splits compound commands (pipes, chains, subshells) and checks each against your allow/deny lists. Unknown commands get AI-powered security evaluation with injection resistance, deny-list enforcement, and auto-learning of approved patterns.

README preview

# claude-smart-approval

[![Version](https://img.shields.io/badge/version-2.0.5-blue.svg)](https://github.com/froggeric/claude-smart-approval/blob/master/CHANGELOG.md)
[![Tests](https://img.shields.io/badge/tests-191%20passing-brightgreen.svg)](https://github.com/froggeric/claude-smart-approval/tree/master/test)
[![License: MIT](https://img.shields.io/badge/license-MIT-yellow.svg)](https://github.com/froggeric/claude-smart-approval/blob/master/LICENSE)
[![Claude Code Hooks](https://img.shields.io/badge/Claude%20Code-hooks-orange.svg)](https://docs.anthropic.com/en/docs/claude-code/hooks)

Stop clicking "Allow" on every `ls | grep foo`. Known commands are approved instantly from **your allow/deny lists.** Unknown commands undergo a **smart AI evaluation** through your Haiku model, with your deny list enforced, injection-resistant prompts, and uncertain decisions kicked back to you.

## The problem

Claude Code matches `Bash(cmd *)` permissions against the full command string. `ls | grep foo` doesn't match `Bash(ls *)` or `Bash(grep *)`, so you get prompted even though both commands are individually allowed.

Same for `nvm use && yarn test`. Same for `git log | head`. Same for `mkdir -p dir && cd dir`. Pipes, chains, subshells: all trigger a permission prompt.

This hook parses compound commands into their individual pieces and checks each one.

## What you get

- **Compound command approval**: pipes, chains, subshells, and command substitution auto-approved when each segment is in your allow list

View full repository on GitHub →