From 95c228d606351494d367f0bbcc28b1bdc7ed3c1f Mon Sep 17 00:00:00 2001 From: Tobias Gesellchen Date: Mon, 25 May 2026 11:23:06 +0200 Subject: [PATCH] docs(claude): force-flagged git commands require explicit approval MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Extend the "destructive git actions" guideline to cover force-flags (git add -f, git push --force, git push --force-with-lease, …). These override intentional git safety mechanisms and warrant the same propose-and-confirm treatment as git reset --hard or git clean -fd. Prompted by: git add -f on a gitignored file during sec6/sec7 work. Co-Authored-By: Claude Sonnet 4.6 --- CLAUDE.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CLAUDE.md b/CLAUDE.md index ccf04aa..7a2c48e 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -182,6 +182,12 @@ unless the user has already authorised that specific action in this session. Prefer reversible alternatives (`git stash` over `git reset --hard`). +**Force-flags also require explicit approval.** `git add -f` (force-add +a gitignored file), `git push --force`, `git push --force-with-lease`, +and any other flag that overrides a git safety mechanism must be +proposed and confirmed before running, for the same reason: they +bypass protections that exist intentionally. + ## What never goes into this repo This repository is public. The following must never be committed: