Skip to content

docs: add Never-rewrite-history guard to CLAUDE.md / AGENTS.md#478

Merged
Jammy2211 merged 1 commit intomainfrom
feature/history-rewrite-guard
Apr 27, 2026
Merged

docs: add Never-rewrite-history guard to CLAUDE.md / AGENTS.md#478
Jammy2211 merged 1 commit intomainfrom
feature/history-rewrite-guard

Conversation

@Jammy2211
Copy link
Copy Markdown
Collaborator

Summary

Append a ## Never rewrite history section to this repo's CLAUDE.md and/or AGENTS.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.md returns the section.
  • Existing content of these files is unchanged above the new section.

🤖 Generated with Claude Code

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>
@Jammy2211 Jammy2211 merged commit e25aaeb into main Apr 27, 2026
5 checks passed
@Jammy2211 Jammy2211 deleted the feature/history-rewrite-guard branch April 27, 2026 21:35
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