NAME
Acme::Claude::Shell::Hooks - Safety hooks for Acme::Claude::Shell
SYNOPSIS
use Acme::Claude::Shell::Hooks qw(safety_hooks);
my $hooks = safety_hooks($session);
DESCRIPTION
Provides PreToolUse and PostToolUse hooks for command safety:
Detects dangerous command patterns (rm -rf, sudo, dd, etc.)
Shows colorful approval menu before execution
Allows editing commands before running
Supports dry-run mode to preview without executing
Logs command history after execution
DANGEROUS PATTERNS
The following command patterns trigger extra warnings:
rm -rf- Recursive/forced deletionsudo- Superuser commandsmkfs- Filesystem formattingdd of=- Direct disk writeschmod 777- World-writable permissionskill -9- Forceful process terminationreboot/shutdown- System restartwget/curl | sh- Piping remote scripts to shell
AUTHOR
LNATION, <email at lnation.org>
LICENSE AND COPYRIGHT
This software is Copyright (c) 2026 by LNATION.
This is free software, licensed under:
The Artistic License 2.0 (GPL Compatible)