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 deletion

  • sudo - Superuser commands

  • mkfs - Filesystem formatting

  • dd of= - Direct disk writes

  • chmod 777 - World-writable permissions

  • kill -9 - Forceful process termination

  • reboot/shutdown - System restart

  • wget/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)