---
name: block-makefile-bash
enabled: true
event: bash
action: block
pattern: (>>?\s*Makefile|sed\s+.*-i.*Makefile|sed\s+-i.*Makefile|perl\s+-[pi].*Makefile|tee\s+.*Makefile|(mv|cp)\s+\S+\s+Makefile\b|>\s*Makefile)
---

🚫 **BLOCKED: Bash Command Modifying Makefile**

You are attempting to modify the Makefile via a bash command.

**Blocked operations include:**
- Redirection: `echo ... > Makefile`, `cat ... >> Makefile`
- In-place edits: `sed -i ... Makefile`, `perl -pi ... Makefile`
- File writes: `tee ... Makefile`
- File moves/copies: `mv ... Makefile`, `cp ... Makefile`

**Allowed operations:**
- Reading: `cat Makefile`, `head Makefile`, `tail Makefile`
- Searching: `grep ... Makefile`
- Running targets: `make <target>`

**If you need to modify the Makefile:**
1. Ask the user for explicit permission
2. Explain what change is needed and why
3. Wait for approval before proceeding
