Recreating a repository after a pushed leak
A name or a credential has reached GitHub: in a file, a commit message,
a pull request, a branch name. A rewrite in place is not the remedy.
refs/pull/N/head pin every commit a pull request touched, and GitHub
serves unreachable objects by SHA until a collection on no schedule you
control. GitHub's own page says the same of clones, forks and "cached
views", and of the pull requests themselves
(references/pushed-leaks.md). Deleting the
repository and creating it again is the immediate remedy, and the one in
the owner's hands: the pull request refs go with the repository. The
settings go with it too, which is why this is an order and not one
command: nothing else records their old values.
Two things the recreate does not undo, and step 1 names both: a
credential's exposure, and the copies in forks and clones.
Past references/, docs.github.com by its search,
curl -s 'https://docs.github.com/api/search/v1?query=<q>&language=en&client_name=x'
(no client_name: 400), then a hit's body,
curl -s 'https://docs.github.com/api/article/body?pathname=<hit url>'.
A live page that contradicts a line here wins: say so, act on the page,
and route the fix by capture-learning, bar a dated measured line that
names the page it overrules and the call that measured it, which a page
changed since its date sends back to re-measure. An observed claim is cited
or marked pending a doc check, and stands, marked observed, only where no
page covers it.
1. Before anything: whose repo, where you are, what survives
export GH_TOKEN="$(command gh auth token --user <owner>)" # the pin, for this call alone
[ -n "$GH_TOKEN" ] || { echo "no token for <owner>: not pinned"; exit 1; }
gh api user -q .login # must print <owner>
gh repo view <owner>/<name> --json visibility,forkCount,isFork,parent
git rev-parse --show-toplevel # which repo this session is in
- A credential is revoked or rotated first. The recreate removes the
record, not the exposure, and GitHub's page puts the rotation "as a
first step". Its Support can purge cached views and pull request refs
after a rewrite, but only for data it judges sensitive and only where
rotating cannot mitigate the risk; that route was never tried here,
and the recreate needs no one's judgment.
- The login must equal
<owner>, and every later gh call pins
it. gh can be folder-scoped, as on the machine this skill was
written on: the repo's account inside an identity root, the keyring's
active one outside every root, for a native program's gh.exe and for
a gh.exe earlier on PATH, as the user's own instructions may say.
The probe holds only for the call it ran in, since each tool call is a
fresh shell (2026-11-05). So each repo-settings.ps1 run below takes
-Login <owner>, minting that account's token itself and stopping
where gh holds none or acts as another; it also refuses -Apply under
any other login, and -Export too but for an organization's admin.
gh repo delete and gh repo create make no such check and act as
whatever gh resolves to, so steps 4 and 5 pin them in the same call,
by the PowerShell form in audit-repo's
step 1 where a guard
refuses the Bash one. A login other than <owner> here is a stop:
report it.
- An organization's repo is a stop. It is its owners' to recreate,
and the script's owner check refuses its
-Apply, though an admin may
-Export one.
- A public repo's
forkCount above 0 means the leak outlives it.
"Deleting a public repository will not delete any forks of the
repository" — a private repo's forks go with it — and the fork owners
have to be asked: GitHub "cannot provide contact information for these
owners". Say so; the recreate still clears this repo.
isFork true, with a pull request into its parent: that pull
request lives in the parent, where this delete does not reach, and
pins the commits there. Reasoned from GitHub's "any pull requests that
reference them", not tried (2026-10-01).
- Record
visibility. The snapshot leaves it out on purpose, so
once the repo is gone nothing else says whether it was public or
private, and step 5 needs it.
- Add a leaked name to the user's identity denylist if it is not
there,
~/.config/identity-denylist.txt where they keep one; a
credential never goes in it. identity-guard knows only what is
listed, and step 6's push is where it catches whatever the rewrite
missed. With no denylist or no identity-guard, say so: step 6's
push is then scanned by nothing, and step 3's grep is the only proof.
2. Snapshot the settings while they exist
From a clone of the repo:
& ${CLAUDE_SKILL_DIR}/../audit-repo/scripts/repo-settings.ps1 -Check -Login <owner> # exit 0: the snapshot on disk matches the live repo, skip -Export
& ${CLAUDE_SKILL_DIR}/../audit-repo/scripts/repo-settings.ps1 -Export -Login <owner>
The script ships in the audit-repo skill's folder, beside this one
wherever the github-admin group deploys, since a deploy takes a group whole;
from Bash, run the same path through pwsh -NoProfile -File. -Repo
defaults to the clone's origin.
- It writes into the clone it runs from:
.github/repo-settings.json,
untracked. Leave it there and note the full path the script prints:
steps 5 and 6 pass it as -Path, from the fresh clone too.
- Anywhere else it refuses unless
-Repo and -Path are both given:
a snapshot defaults only into a clone of the repo it describes, never
into another repo's tree, a client's above all.
- It refuses a login that neither owns the repo nor administers it for
its organization —
gh acts as '<login>', not the repo owner '<owner>'. Refusing to snapshot a repo it does not own or administer. — a file
paired with another repo, and merge settings that come back null, which
means gh is not reading them as an admin.
-Check prints a [SKIP] line when no social preview is uploaded.
Note it: step 6 ends with that upload.
3. Clean the history locally
The recreate publishes whatever you push, so the history is clean before
step 4 — and the rewrite is not this skill's to perform. What it holds
you to:
- A leak confined to pull request or issue text needs no rewrite.
Those die with the repository.
git filter-repo runs in a fresh clone — it refuses any other,
--force overriding — and runs git remote rm origin when it
finishes, unless --partial. It leaves .git/filter-repo/commit-map,
ref-map, changed-refs and first-changed-commits. The commit-map is
a trap in a repo rewritten before: each commit appears twice, and six
of seven translated SHAs once landed on a stale lineage
(the user's identity-guard.sh hook, header, 2026-09-08) — assert
git merge-base --is-ancestor <new> main. first-changed-commits is
what GitHub Support asks for, should a credential's case go there.
- Prove the term gone before the delete: every diff, merges
included, every message, author and committer, every ref name and tag
message. Binary files are not searched.
git log --all -p -m --format='%H %an %ae %cn %ce %B' | grep -i -c '<term>' # 0 is the pass
git for-each-ref --format='%(refname) %(contents)' | grep -i '<term>' # nothing back is the pass
- And the snapshot: a description, topic or homepage naming the term
comes back in step 5, through
gh repo create --description and
-Apply both. Edit it out of the file, and say so at step 4: -Check
now reports that line as drift, and step 5 applies the edited value.
grep -i -c '<term>' <the snapshot> # 0 is the pass
4. Checkpoint, then delete
Report where things stand: the snapshot's path and -Check's exit, the
visibility recorded, the fork count, where the clean history is and that
filter-repo dropped origin, and that steps 5 and 6 follow. Then
wait. The delete is the one irreversible write here — "Some deleted
repositories can be restored within 90 days of deletion", but restoring
would bring the leak back, so that restore is never this skill's — and
the user asked for the recreate, not for this moment.
export GH_TOKEN="$(command gh auth token --user <owner>)"
[ -n "$GH_TOKEN" ] || { echo "no token for <owner>: not pinned"; exit 1; }
gh repo delete <owner>/<name> --yes # the slug is required: without it --yes is ignored and gh prompts
- The scope.
gh repo delete --help says deletion needs the
delete_repo scope, and gives gh auth refresh -s delete_repo as the
fix. Hand that to the user and stop: it widens the keyring's active
account whichever folder it runs in, so <owner>'s token gains the
scope only once gh auth switch has made <owner> active, as its
help says of an inactive account (gh 2.103.3), and it waits on a
browser device flow.
github-mcp's delete_repository cannot do this from Claude Code.
Its confirmation never reaches the user, and two calls on 2026-09-23
answered Repository deletion was not confirmed. Granting the token
Administration does
not help, and the permission outlives the attempt.
- Whether a new repo under the same name blocks the 90-day restore, and
whether the name is reusable at once, was not checked (2026-10-01);
both recreates so far took the same name back.
5. Create, re-add the remote, apply the snapshot
export GH_TOKEN="$(command gh auth token --user <owner>)"
[ -n "$GH_TOKEN" ] || { echo "no token for <owner>: not pinned"; exit 1; }
gh repo create <owner>/<name> --<public|private> --description '<from the snapshot>' # no --source --push: the hooks are not armed yet
git remote -v # filter-repo removed origin; put it back:
git remote add origin https://github.com/<owner>/<name>.git
& ${CLAUDE_SKILL_DIR}/../audit-repo/scripts/repo-settings.ps1 -Apply -Path <the snapshot step 2 wrote> -Login <owner>
- Run it from the fresh clone once
origin is back, or from the clone
step 2 ran in: both origins name the new repo. -Path is what keeps
it on the snapshot taken before the delete.
- Never
-Export now. The new repo holds GitHub's defaults, and an
export over the snapshot would erase the one record of what it held.
gh repo create takes --description and --homepage and no topics
(gh 2.101.0); -Apply restores the topics and everything else the
snapshot holds — merge toggles, security settings, Actions
permissions — then re-checks.
-Apply has not yet run against a repo with no commits (unverified,
2026-10-01). If a setting fails there, run it again after step 6 and
note which: the next real recreate settles this.
- Rulesets print
[SKIP]: applying them is not implemented, and no
personal repo has had any.
6. Arm the hooks, prune, push, then finish by hand
A fresh clone has no hooks, and a push from one passes every
git-side guard a repo wires, such as identity-guard's git-hook mode,
in silence. On 2026-09-23 the missing piece was
core.hooksPath.
pre-commit install # every type in default_install_hook_types, where the repo uses pre-commit
git config core.hooksPath <dir> # a repo that commits its hooks; then:
git ls-files -s <dir> # 100755 each, or a POSIX clone does not run it
git update-index --chmod=+x <dir>/<hook> # the fix for a 100644, committed with no pathspec before the push
Then the prune, and only then the push:
git fetch --prune origin # drops the stale origin/main the deleted repo left behind
git push -u origin main
identity-guard's push gate scans every commit on the ref that no
remote has, --not --remotes, and the clone's old origin/main still
names the deleted repo's commits, so until the prune all of them are
left out of the scan: measured 2026-10-01, 0 commits before
- [deleted] (none) -> origin/main, every commit after. After a
filter-repo rewrite the old remote is already gone. The first push to
an empty repo is then the one scan of the whole history against the
denylist, and a name step 1 added is caught here.
After the push:
-Check -Path <the snapshot> -Login <owner> once more: exit 0, with
the [SKIP] for the social preview, which no API sets — upload it at
Settings → General → Social preview → Edit → Upload an image: by
hand, or with Claude in Chrome connected, on the user's yes, by
audit-repo's
references/browser-steps.md,
which checks the browser's login first, as the new repo's owner.
-Check never counts it as drift.
- Report: the snapshot's path, untracked in the clone step 2 ran in and
the owner's to commit should the new repo keep its settings as code,
the forks still carrying the leak, and that the deleted repo is not to
be restored.
Constraints
- Never restore the deleted repository. It brings the leak back.
- Never
gh auth refresh or gh auth switch. Both act on the
keyring's active account, which every session on the machine shares;
hand them to the user.
- Never act as an account that does not own the repo, and never on an
organization's repo: stop and report. The script refuses the first
for its own writes;
gh repo delete and gh repo create do not, so
each pins <owner> in its own call.
- Never
gh repo create --source . --push, and never a force-push as
the remedy. The first publishes before the hooks exist; the second is
the rewrite in place this skill replaces.
- A snapshot stays in a clone of the repo it describes, or outside
every repo, never in another repo's tree by your own choice: the
script's default keeps it there, and a
-Path you pick must too.
Asked for another repo of the owner's, never a client's, name this
rule, grep that copy for the term as step 3 does, and keep the
clone's for -Apply.
- Not this skill's: a leak not yet pushed, which a local rewrite
removes before any push,
commit-changes's identity scan being the
prevention; a branch to land or prune (land-branch,
prune-branches); the
rewrite's own options, which git filter-repo's manual has.
1---2name: recreate-repo3model: inherit4effort: xhigh5disable-model-invocation: false6argument-hint: "[owner/name]"7description: "Routes a leak already pushed to GitHub — a client or employer name, an account or tenant name, a credential, in a file, a message or a pull request — to the immediate remedy: deleting and recreating the repository, in the order that keeps its settings alive. It snapshots the settings with audit-repo's repo-settings.ps1 before the delete, has a credential rotated first, deletes with gh (github-mcp's delete_repository cannot confirm), and arms the hooks before the first push so it is scanned. Says why a rewrite plus force-push is not the remedy — pull request refs and cached views keep the commits reachable — what the recreate cannot reach, a public repo's forks, and why the 90-day restore is never used. Stops on a repo the acting account does not own; an organization's repo is its owners' to recreate. To keep a leak out of a commit not yet pushed, use commit-changes; to land a branch, land-branch."8when_to_use: "Use when a client name, account, token or other identity string turns up in commits, messages or pull requests already pushed; when asked to purge, scrub or rewrite pushed history, to filter-repo and force-push, or to delete and recreate a repository — before the delete, since the settings die with the repo. Use it even when asked only to force-push the rewrite or to delete the repo and start again: the snapshot and the hooks are what those requests skip."9metadata:10 source: https://skillmd.com/skills/wardawgmalvicious/recreate-repo11---1213# Recreating a repository after a pushed leak1415A name or a credential has reached GitHub: in a file, a commit message,16a pull request, a branch name. **A rewrite in place is not the remedy.**17`refs/pull/N/head` pin every commit a pull request touched, and GitHub18serves unreachable objects by SHA until a collection on no schedule you19control. GitHub's own page says the same of clones, forks and "cached20views", and of the pull requests themselves21([references/pushed-leaks.md](references/pushed-leaks.md)). Deleting the22repository and creating it again is the immediate remedy, and the one in23the owner's hands: the pull request refs go with the repository. The24settings go with it too, which is why this is an order and not one25command: nothing else records their old values.2627Two things the recreate does not undo, and step 1 names both: a28credential's exposure, and the copies in forks and clones.2930Past `references/`, docs.github.com by its search,31`curl -s 'https://docs.github.com/api/search/v1?query=<q>&language=en&client_name=x'`32(no `client_name`: 400), then a hit's body,33`curl -s 'https://docs.github.com/api/article/body?pathname=<hit url>'`.34A live page that contradicts a line here wins: say so, act on the page,35and route the fix by `capture-learning`, bar a dated measured line that36names the page it overrules and the call that measured it, which a page37changed since its date sends back to re-measure. An observed claim is cited38or marked pending a doc check, and stands, marked observed, only where no39page covers it.4041## 1. Before anything: whose repo, where you are, what survives4243```bash44export GH_TOKEN="$(command gh auth token --user <owner>)" # the pin, for this call alone45[ -n "$GH_TOKEN" ] || { echo "no token for <owner>: not pinned"; exit 1; }46gh api user -q .login # must print <owner>47gh repo view <owner>/<name> --json visibility,forkCount,isFork,parent48git rev-parse --show-toplevel # which repo this session is in49```5051- **A credential is revoked or rotated first.** The recreate removes the52 record, not the exposure, and GitHub's page puts the rotation "as a53 first step". Its Support can purge cached views and pull request refs54 after a rewrite, but only for data it judges sensitive and only where55 rotating cannot mitigate the risk; that route was never tried here,56 and the recreate needs no one's judgment.57- **The login must equal `<owner>`, and every later `gh` call pins58 it.** `gh` can be folder-scoped, as on the machine this skill was59 written on: the repo's account inside an identity root, the keyring's60 active one outside every root, for a native program's `gh.exe` and for61 a `gh.exe` earlier on `PATH`, as the user's own instructions may say.62 The probe holds only for the call it ran in, since each tool call is a63 fresh shell (2026-11-05). So each `repo-settings.ps1` run below takes64 `-Login <owner>`, minting that account's token itself and stopping65 where gh holds none or acts as another; it also refuses `-Apply` under66 any other login, and `-Export` too but for an organization's admin.67 `gh repo delete` and `gh repo create` make no such check and act as68 whatever `gh` resolves to, so steps 4 and 5 pin them in the same call,69 by the PowerShell form in `audit-repo`'s70 [step 1](../audit-repo/SKILL.md#1-pick-the-account) where a guard71 refuses the Bash one. A login other than `<owner>` here is a stop:72 report it.73- **An organization's repo is a stop.** It is its owners' to recreate,74 and the script's owner check refuses its `-Apply`, though an admin may75 `-Export` one.76- **A public repo's `forkCount` above 0 means the leak outlives it.**77 "Deleting a public repository will not delete any forks of the78 repository" — a private repo's forks go with it — and the fork owners79 have to be asked: GitHub "cannot provide contact information for these80 owners". Say so; the recreate still clears this repo.81- **`isFork` true, with a pull request into its `parent`**: that pull82 request lives in the parent, where this delete does not reach, and83 pins the commits there. Reasoned from GitHub's "any pull requests that84 reference them", not tried (2026-10-01).85- **Record `visibility`.** The snapshot leaves it out on purpose, so86 once the repo is gone nothing else says whether it was public or87 private, and step 5 needs it.88- **Add a leaked name to the user's identity denylist** if it is not89 there, `~/.config/identity-denylist.txt` where they keep one; a90 credential never goes in it. `identity-guard` knows only what is91 listed, and step 6's push is where it catches whatever the rewrite92 missed. **With no denylist or no `identity-guard`, say so**: step 6's93 push is then scanned by nothing, and step 3's grep is the only proof.9495## 2. Snapshot the settings while they exist9697From a clone of the repo:9899```powershell100& ${CLAUDE_SKILL_DIR}/../audit-repo/scripts/repo-settings.ps1 -Check -Login <owner> # exit 0: the snapshot on disk matches the live repo, skip -Export101& ${CLAUDE_SKILL_DIR}/../audit-repo/scripts/repo-settings.ps1 -Export -Login <owner>102```103104The script ships in the `audit-repo` skill's folder, beside this one105wherever the github-admin group deploys, since a deploy takes a group whole;106from Bash, run the same path through `pwsh -NoProfile -File`. `-Repo`107defaults to the clone's origin.108109- **It writes into the clone it runs from**: `.github/repo-settings.json`,110 untracked. Leave it there and note the full path the script prints:111 steps 5 and 6 pass it as `-Path`, from the fresh clone too.112- **Anywhere else it refuses** unless `-Repo` and `-Path` are both given:113 a snapshot defaults only into a clone of the repo it describes, never114 into another repo's tree, a client's above all.115- It refuses a login that neither owns the repo nor administers it for116 its organization — `gh acts as '<login>', not the repo owner '<owner>'.117 Refusing to snapshot a repo it does not own or administer.` — a file118 paired with another repo, and merge settings that come back null, which119 means `gh` is not reading them as an admin.120- `-Check` prints a `[SKIP]` line when no social preview is uploaded.121 Note it: step 6 ends with that upload.122123## 3. Clean the history locally124125The recreate publishes whatever you push, so the history is clean before126step 4 — and the rewrite is not this skill's to perform. What it holds127you to:128129- **A leak confined to pull request or issue text needs no rewrite.**130 Those die with the repository.131- **`git filter-repo` runs in a fresh clone** — it refuses any other,132 `--force` overriding — **and runs `git remote rm origin` when it133 finishes**, unless `--partial`. It leaves `.git/filter-repo/commit-map`,134 `ref-map`, `changed-refs` and `first-changed-commits`. The commit-map is135 a trap in a repo rewritten before: each commit appears twice, and six136 of seven translated SHAs once landed on a stale lineage137 (the user's `identity-guard.sh` hook, header, 2026-09-08) — assert138 `git merge-base --is-ancestor <new> main`. `first-changed-commits` is139 what GitHub Support asks for, should a credential's case go there.140- **Prove the term gone before the delete**: every diff, merges141 included, every message, author and committer, every ref name and tag142 message. Binary files are not searched.143144```bash145git log --all -p -m --format='%H %an %ae %cn %ce %B' | grep -i -c '<term>' # 0 is the pass146git for-each-ref --format='%(refname) %(contents)' | grep -i '<term>' # nothing back is the pass147```148149- **And the snapshot**: a description, topic or homepage naming the term150 comes back in step 5, through `gh repo create --description` and151 `-Apply` both. Edit it out of the file, and say so at step 4: `-Check`152 now reports that line as drift, and step 5 applies the edited value.153154```bash155grep -i -c '<term>' <the snapshot> # 0 is the pass156```157158## 4. Checkpoint, then delete159160Report where things stand: the snapshot's path and `-Check`'s exit, the161visibility recorded, the fork count, where the clean history is and that162`filter-repo` dropped `origin`, and that steps 5 and 6 follow. **Then163wait.** The delete is the one irreversible write here — "Some deleted164repositories can be restored within 90 days of deletion", but restoring165would bring the leak back, so that restore is never this skill's — and166the user asked for the recreate, not for this moment.167168```bash169export GH_TOKEN="$(command gh auth token --user <owner>)"170[ -n "$GH_TOKEN" ] || { echo "no token for <owner>: not pinned"; exit 1; }171gh repo delete <owner>/<name> --yes # the slug is required: without it --yes is ignored and gh prompts172```173174- **The scope.** `gh repo delete --help` says deletion needs the175 `delete_repo` scope, and gives `gh auth refresh -s delete_repo` as the176 fix. Hand that to the user and stop: it widens the keyring's *active*177 account whichever folder it runs in, so `<owner>`'s token gains the178 scope only once `gh auth switch` has made `<owner>` active, as its179 help says of an inactive account (gh 2.103.3), and it waits on a180 browser device flow.181- **`github-mcp`'s `delete_repository` cannot do this from Claude Code.**182 Its confirmation never reaches the user, and two calls on 2026-09-23183 answered `Repository deletion was not confirmed`. Granting the token184 Administration does185 not help, and the permission outlives the attempt.186- Whether a new repo under the same name blocks the 90-day restore, and187 whether the name is reusable at once, was not checked (2026-10-01);188 both recreates so far took the same name back.189190## 5. Create, re-add the remote, apply the snapshot191192```bash193export GH_TOKEN="$(command gh auth token --user <owner>)"194[ -n "$GH_TOKEN" ] || { echo "no token for <owner>: not pinned"; exit 1; }195gh repo create <owner>/<name> --<public|private> --description '<from the snapshot>' # no --source --push: the hooks are not armed yet196git remote -v # filter-repo removed origin; put it back:197git remote add origin https://github.com/<owner>/<name>.git198```199200```powershell201& ${CLAUDE_SKILL_DIR}/../audit-repo/scripts/repo-settings.ps1 -Apply -Path <the snapshot step 2 wrote> -Login <owner>202```203204- Run it from the fresh clone once `origin` is back, or from the clone205 step 2 ran in: both origins name the new repo. `-Path` is what keeps206 it on the snapshot taken before the delete.207- **Never `-Export` now.** The new repo holds GitHub's defaults, and an208 export over the snapshot would erase the one record of what it held.209- `gh repo create` takes `--description` and `--homepage` and no topics210 (gh 2.101.0); `-Apply` restores the topics and everything else the211 snapshot holds — merge toggles, security settings, Actions212 permissions — then re-checks.213- **`-Apply` has not yet run against a repo with no commits** (unverified,214 2026-10-01). If a setting fails there, run it again after step 6 and215 note which: the next real recreate settles this.216- Rulesets print `[SKIP]`: applying them is not implemented, and no217 personal repo has had any.218219## 6. Arm the hooks, prune, push, then finish by hand220221**A fresh clone has no hooks**, and a push from one passes every222git-side guard a repo wires, such as `identity-guard`'s git-hook mode,223in silence. On 2026-09-23 the missing piece was224`core.hooksPath`.225226```bash227pre-commit install # every type in default_install_hook_types, where the repo uses pre-commit228git config core.hooksPath <dir> # a repo that commits its hooks; then:229git ls-files -s <dir> # 100755 each, or a POSIX clone does not run it230git update-index --chmod=+x <dir>/<hook> # the fix for a 100644, committed with no pathspec before the push231```232233Then the prune, and only then the push:234235```bash236git fetch --prune origin # drops the stale origin/main the deleted repo left behind237git push -u origin main238```239240`identity-guard`'s push gate scans every commit on the ref that no241remote has, `--not --remotes`, and the clone's old `origin/main` still242names the deleted repo's commits, so until the prune all of them are243left out of the scan: measured 2026-10-01, `0` commits before244`- [deleted] (none) -> origin/main`, every commit after. After a245`filter-repo` rewrite the old remote is already gone. The first push to246an empty repo is then the one scan of the whole history against the247denylist, and a name step 1 added is caught here.248249After the push:250251- `-Check -Path <the snapshot> -Login <owner>` once more: exit 0, with252 the `[SKIP]` for the social preview, which no API sets — upload it at253 **Settings → General → Social preview → Edit → Upload an image**: by254 hand, or with Claude in Chrome connected, on the user's yes, by255 `audit-repo`'s256 [references/browser-steps.md](../audit-repo/references/browser-steps.md),257 which checks the browser's login first, as the new repo's owner.258 `-Check` never counts it as drift.259- Report: the snapshot's path, untracked in the clone step 2 ran in and260 the owner's to commit should the new repo keep its settings as code,261 the forks still carrying the leak, and that the deleted repo is not to262 be restored.263264## Constraints265266- **Never restore the deleted repository.** It brings the leak back.267- **Never `gh auth refresh` or `gh auth switch`.** Both act on the268 keyring's active account, which every session on the machine shares;269 hand them to the user.270- **Never act as an account that does not own the repo, and never on an271 organization's repo**: stop and report. The script refuses the first272 for its own writes; `gh repo delete` and `gh repo create` do not, so273 each pins `<owner>` in its own call.274- **Never `gh repo create --source . --push`, and never a force-push as275 the remedy.** The first publishes before the hooks exist; the second is276 the rewrite in place this skill replaces.277- **A snapshot stays in a clone of the repo it describes**, or outside278 every repo, never in another repo's tree by your own choice: the279 script's default keeps it there, and a `-Path` you pick must too.280 Asked for another repo of the owner's, never a client's, name this281 rule, grep that copy for the term as step 3 does, and keep the282 clone's for `-Apply`.283- **Not this skill's:** a leak not yet pushed, which a local rewrite284 removes before any push, `commit-changes`'s identity scan being the285 prevention; a branch to land or prune (`land-branch`,286 `prune-branches`); the287 rewrite's own options, which `git filter-repo`'s manual has.