Skip to content

Commit d8b4edc

Browse files
Jammy2211claude
andauthored
chore: single-source the never-rewrite-history policy as a generated block (#18)
Replace the hand-maintained history-rewrite guidance with the generated repos_sync:history block (byte-identical canonical text from PyAutoMind/policy/never_rewrite_history.md), so the safety policy is single-sourced and drift-checked. The text stays inline; only the manual copy is retired. Part of the ecosystem standardization (spec 4). Claude-Session: https://claude.ai/code/session_01KUGujq6jAgU3CExnLkkELe Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent e738b08 commit d8b4edc

1 file changed

Lines changed: 25 additions & 10 deletions

File tree

AGENTS.md

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -84,13 +84,28 @@ entries until the summary passes; regenerate notebooks + catalogue after. **Gene
8484
only files in `scripts/` (never `notebooks/`), preserve docstrings and explanations, test, then
8585
regenerate. Flag any change that affects `autofit_workspace` or PyAutoFit in your PR.
8686

87-
## Clean state
88-
89-
Never rewrite history on a repo with a remote (no `git init` over a tracked tree, no force-push to
90-
`main`, no rebasing pushed shared branches). To reset a dirty tree the only correct sequence is:
91-
92-
```bash
93-
git fetch origin
94-
git reset --hard origin/main
95-
git clean -fd
96-
```
87+
<!-- repos_sync:history:begin -->
88+
## Never rewrite history
89+
90+
NEVER perform these operations on any repo with a remote:
91+
92+
- `git init` in a directory already tracked by git
93+
- `rm -rf .git && git init`
94+
- Commit with subject "Initial commit", "Fresh start", "Start fresh", "Reset
95+
for AI workflow", or any equivalent message on a branch with a remote
96+
- `git push --force` to `main` (or any branch tracked as `origin/HEAD`)
97+
- `git filter-repo` / `git filter-branch` on shared branches
98+
- `git rebase -i` rewriting commits already pushed to a shared branch
99+
100+
If the working tree needs a clean state, the **only** correct sequence is:
101+
102+
git fetch origin
103+
git reset --hard origin/main
104+
git clean -fd
105+
106+
This applies equally to humans, local Claude Code, cloud Claude agents, Codex,
107+
and any other agent. The "Initial commit — fresh start for AI workflow" pattern
108+
that appeared independently on origin and local for three workspace repos is
109+
exactly what this rule prevents — it costs ~40 commits of redundant local work
110+
every time it happens.
111+
<!-- repos_sync:history:end -->

0 commit comments

Comments
 (0)