docs: add Never-rewrite-history guard to CLAUDE.md / AGENTS.md#478
Merged
docs: add Never-rewrite-history guard to CLAUDE.md / AGENTS.md#478
Conversation
Append a `## Never rewrite history` section listing the destructive history operations that NEVER apply on a remote-tracked repo, with the canonical clean-working-tree sequence (`git fetch && reset --hard origin/main && clean -fd`) as the only correct alternative. Why: forensic sweep on 2026-04-27 found three workspace repos with no merge base at all with origin — independent `git init`/"fresh start" rewrites on different machines had produced identical content under entirely different SHAs, costing ~41 commits of redundant local work. This rule prevents that class of error structurally for both human and AI agents. Implements PyAutoLabs/PyAutoPrompt#7. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Append a
## Never rewrite historysection to this repo'sCLAUDE.mdand/orAGENTS.md(whichever exist) listing destructive history operations that should never run on a remote-tracked branch, with the canonical clean-working-tree sequence as the only correct alternative.One of 17 PRs implementing PyAutoLabs/PyAutoPrompt#7 (history-rewrite-guard umbrella).
Test Plan
grep "## Never rewrite history" CLAUDE.md AGENTS.mdreturns the section.🤖 Generated with Claude Code