Skip to content

docs: add chained Bash hook example#58644

Open
yudin-s wants to merge 1 commit into
anthropics:mainfrom
yudin-s:docs/bash-hook-compound-commands
Open

docs: add chained Bash hook example#58644
yudin-s wants to merge 1 commit into
anthropics:mainfrom
yudin-s:docs/bash-hook-compound-commands

Conversation

@yudin-s
Copy link
Copy Markdown

@yudin-s yudin-s commented May 13, 2026

Summary

  • Add a conservative PreToolUse hook example that blocks chained Bash commands outside quoted strings
  • Document why Bash permission hooks should avoid unsafe auto-approval for compound shell commands
  • Point plugin developers to a fail-closed mitigation while native compound-command permission parsing is unresolved

Addresses #16561.

Test plan

  • python3 -m py_compile examples/hooks/block_chained_bash_commands_example.py
  • smoke-tested simple, quoted, and chained Bash hook inputs
  • git diff --check

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant