Skip to content

Commit 059eb22

Browse files
Jammy2211claude
authored andcommitted
Slim the never-rewrite-history AGENTS.md block to 6 lines
The generated repos_sync:history block is cut from 23 lines to a terse prohibition + clean-tree recovery command, to stop paying ~250 tokens of agent context per repo per session. Single source stays PyAutoMind/policy/never_rewrite_history.md; the misattributed 2026-04-27 incident anecdote is removed (those fresh-start commits were intentional). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent d066eae commit 059eb22

1 file changed

Lines changed: 4 additions & 21 deletions

File tree

AGENTS.md

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -121,25 +121,8 @@ from `AbstractNDArray`; `.array` returns the raw `numpy.ndarray` / `jax.Array`.
121121
<!-- repos_sync:history:begin -->
122122
## Never rewrite history
123123

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.
124+
Never rewrite pushed history on any repo with a remote — no `git init` over a
125+
tracked repo, no force-push to `main`, no fresh-start "Initial commit", no
126+
`filter-repo` / `filter-branch` / `rebase -i` on pushed branches. To get a
127+
clean tree: `git fetch origin && git reset --hard origin/main && git clean -fd`.
145128
<!-- repos_sync:history:end -->

0 commit comments

Comments
 (0)