Skip to content

Commit ba11305

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 9b6e6f5 commit ba11305

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
@@ -38,25 +38,8 @@ workspaces, tutorials, assistants).
3838
<!-- repos_sync:history:begin -->
3939
## Never rewrite history
4040

41-
NEVER perform these operations on any repo with a remote:
42-
43-
- `git init` in a directory already tracked by git
44-
- `rm -rf .git && git init`
45-
- Commit with subject "Initial commit", "Fresh start", "Start fresh", "Reset
46-
for AI workflow", or any equivalent message on a branch with a remote
47-
- `git push --force` to `main` (or any branch tracked as `origin/HEAD`)
48-
- `git filter-repo` / `git filter-branch` on shared branches
49-
- `git rebase -i` rewriting commits already pushed to a shared branch
50-
51-
If the working tree needs a clean state, the **only** correct sequence is:
52-
53-
git fetch origin
54-
git reset --hard origin/main
55-
git clean -fd
56-
57-
This applies equally to humans, local Claude Code, cloud Claude agents, Codex,
58-
and any other agent. The "Initial commit — fresh start for AI workflow" pattern
59-
that appeared independently on origin and local for three workspace repos is
60-
exactly what this rule prevents — it costs ~40 commits of redundant local work
61-
every time it happens.
41+
Never rewrite pushed history on any repo with a remote — no `git init` over a
42+
tracked repo, no force-push to `main`, no fresh-start "Initial commit", no
43+
`filter-repo` / `filter-branch` / `rebase -i` on pushed branches. To get a
44+
clean tree: `git fetch origin && git reset --hard origin/main && git clean -fd`.
6245
<!-- repos_sync:history:end -->

0 commit comments

Comments
 (0)