<!--
  scaffold: blast-radius-and-safety.md
  bucket: engineering-discipline (Bucket 5)
  what belongs here: blast-radius awareness + git safety.
    - Local reversible = free; shared / hard-to-reverse / visible = confirm.
    - Never destructive git ops without ask.
    - Prefer new commits over amending.
    - Never skip hooks or bypass signing.
    - Investigate unexpected state before overwriting.
    - Review what's committed — never commit secrets.
-->

# Blast radius and safety

## Blast-radius awareness

Every action has a blast radius. Match confirmation to blast radius.

- **Local reversible.** Editing a scratch file, running a query, reading. Free — no confirmation.
- **Shared or persistent.** Writing to the operator's canonical files, committing, pushing, publishing. Confirmation warranted for anything the operator hasn't already scoped.
- **Hard to reverse.** Force-push, delete-branch, drop-table, delete-cloud-resource. Confirmation required — and even then, the operator must be the one to fire the destructive action, not you.
- **Visible to others.** Publishing to LinkedIn, filing an issue on someone else's repo, sending an email. Confirmation required — external audiences don't unwind.

Match action scope to what was requested. If the operator asked for a change to file X, don't also change file Y "while I'm here" without checking.

## Git safety protocol

**Prefer new commits over amending.** Amend is a git operation on the PREVIOUS commit; a pre-commit hook failure means the current commit didn't happen, so amend would rewrite the wrong commit. New commit is safer.

**Never destructive ops without an explicit operator ask.** The banned list:
- `git reset --hard`
- `git push --force` (and `--force-with-lease` — treat the same)
- `git checkout .`
- `git restore .`
- `git clean -f`
- `git branch -D`

If a destructive op looks needed, propose it and wait for confirmation.

**Never skip hooks or bypass signing.** `--no-verify`, `--no-gpg-sign`, `-c commit.gpgsign=false` — banned unless the operator has explicitly asked for the skip. If a hook fails, fix the underlying issue.

**Investigate unexpected state before overwriting.** Unfamiliar files, branches, or config may represent the operator's in-progress work. `git status` before any command that could discard uncommitted changes.

**Review what you're committing.** Never commit files that likely contain secrets — `.env`, credentials.json, private keys, `.aws/credentials`, `.ssh/*`. Suspicious filenames get contents-checked before push. Prefer `git add <specific-file>` over `git add -A` or `git add .` — the wildcard forms accidentally stage secrets and large binaries.

## Related

- CLAUDE.md.template Bucket 5 rules 3, 5, 6, 8, 9.
- `investigate-root-causes.md` — investigate before overwriting.
- `worktree-isolation.md` — how worktrees shift the safety calculus.
