Skip to content

Commit 18275dd

Browse files
Jammy2211claude
andauthored
chore: single-source the never-rewrite-history policy as a generated block (#384)
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 1470c86 commit 18275dd

1 file changed

Lines changed: 25 additions & 11 deletions

File tree

AGENTS.md

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -118,14 +118,28 @@ from `AbstractNDArray`; `.array` returns the raw `numpy.ndarray` / `jax.Array`.
118118
- [`docs/agents/jax_and_decorators.md`](docs/agents/jax_and_decorators.md)
119119
decorator system, `xp` backend pattern, and the `jax.jit` boundary.
120120

121-
## Clean state
122-
123-
Never rewrite history on a repo with a remote (no `git init` over a tracked
124-
tree, no force-push to `main`, no rebasing pushed shared branches). To reset a
125-
dirty tree the only correct sequence is:
126-
127-
```bash
128-
git fetch origin
129-
git reset --hard origin/main
130-
git clean -fd
131-
```
121+
<!-- repos_sync:history:begin -->
122+
## Never rewrite history
123+
124+
NEVER perform these operations on any repo with a remote:
125+
126+
- `git init` in a directory already tracked by git
127+
- `rm -rf .git && git init`
128+
- Commit with subject "Initial commit", "Fresh start", "Start fresh", "Reset
129+
for AI workflow", or any equivalent message on a branch with a remote
130+
- `git push --force` to `main` (or any branch tracked as `origin/HEAD`)
131+
- `git filter-repo` / `git filter-branch` on shared branches
132+
- `git rebase -i` rewriting commits already pushed to a shared branch
133+
134+
If the working tree needs a clean state, the **only** correct sequence is:
135+
136+
git fetch origin
137+
git reset --hard origin/main
138+
git clean -fd
139+
140+
This applies equally to humans, local Claude Code, cloud Claude agents, Codex,
141+
and any other agent. The "Initial commit — fresh start for AI workflow" pattern
142+
that appeared independently on origin and local for three workspace repos is
143+
exactly what this rule prevents — it costs ~40 commits of redundant local work
144+
every time it happens.
145+
<!-- repos_sync:history:end -->

0 commit comments

Comments
 (0)