/clean
Remove the git worktrees review checked PR code out into. Each one is a full checkout on disk; nothing else is touched.
$ npx -y skills add TOMOSIA-VIETNAM/open-pr --agent claude-codeHow it fires
How this command gets triggered: by you, by Claude, or both.
- Fires itselfClaude auto-loads it when your prompt matches the work.
- You can call itInvoke it directly when you want it.
- Slash command
/clean
Context preview
What this command does when you run it.
Remove the git worktrees review checked PR code out into. Each one is a full checkout on disk; nothing else is touched.
Command definition
clean.mdargument-hint: "[repo name...]"
description: Remove the git worktrees review checked PR code out into. Each one is a full checkout on disk; nothing else is touched.
> **CRITICAL:** `Read` `"${CLAUDE_PLUGIN_ROOT}"/core/guardrails.md` FIRST — shared rules, not repeated > here. On top of those: > - Deletes ONLY directories under `notebooks/review/*/worktrees/`. FORBIDDEN, in the same tree and > unrecoverable: `memory.md`, `memories/`, `templates/`, `ALWAYS_RULE.md`, `settings.json`, > `notebooks/review/.git`, and any path outside `notebooks/review/*/worktrees/`. > - FORBIDDEN: deleting anything before the user answers Step 3. > - Reads no PR and needs no vendor CLI. > > This CRITICAL block is the SOLE enforcement layer — no `allowed-tools` backs it (deliberate).
Step 1 — Find the worktrees
Same layout `/open-pr:upgrade` searches: `notebooks/review/` sits wherever `/open-pr:review` ran, from pwd or one level down. FORBIDDEN: `cd`.
find . -maxdepth 6 -type d -path '*/notebooks/review/*/worktrees/*' -not -path '*/worktrees/*/*' 2>/dev/null
None → say there is nothing to clean, STOP.
Step 2 — Narrow, then size
`ARGUMENTS` non-empty ⇒ keep only worktrees whose `<repo>` segment it names, case-insensitive; 0 matched ⇒ STOP, listing the `<repo>`s found. Over what remains — never over what was just dropped, since each is a full checkout and `du` walks all of it:
du -sh <each worktree>
Step 3 — Show what would go, then ask
ONE CHOICE per `core/guardrails.md`, EXACTLY 2 options. Its body lists every worktree by path with its size and the total, so consent covers a list the user has read:
- `Remove all N (Recommended)` — detail: the reclaimed total; review re-creates a worktree next run, so
nothing is lost but disk — unless `/open-pr:fix` committed there and never pushed
- `Keep them` — detail: nothing deleted
Subset wanted (free text, or a re-run naming those repos) ⇒ honour it, those only. `Keep them` ⇒ STOP.
Step 4 — Remove
Per worktree, in this order — a plain `rm -rf` leaves the reviewed repo registering a worktree that no longer exists:
git -C "<worktree>" rev-parse --git-common-dir # ABSOLUTE <repo>/.git; <repo> = that minus /.git
git -C "<repo>" worktree remove --force "<worktree>"
`--force` because the checkout is detached and holds untracked review scratch files.
That first command failing (the repo was moved or deleted) ⇒ the registration is already orphaned: `rm -rf "<worktree>"` instead.
Finish with `git -C "<repo>" worktree prune` per distinct repo, which drops any stale registration left by an earlier manual delete.
Step 5 — Report
Per repo: how many worktrees went and how much disk came back. Then, once: `notebooks/review/` still holds this repo's memory and settings — only the checkouts were removed.
ARGUMENTS: $ARGUMENTS
Read more
argument-hint: "[repo name...]" description: Remove the git worktrees review checked PR code out into. Each one is a full checkout on disk; nothing else is touched.
> **CRITICAL:** `Read` `"${CLAUDE_PLUGIN_ROOT}"/core/guardrails.md` FIRST — shared rules, not repeated > here. On top of those: > - Deletes ONLY directories under `notebooks/review/*/worktrees/`. FORBIDDEN, in the same tree and > unrecoverable: `memory.md`, `memories/`, `templates/`, `ALWAYS_RULE.md`, `settings.json`, > `notebooks/review/.git`, and any path outside `notebooks/review/*/worktrees/`. > - FORBIDDEN: deleting anything before the user answers Step 3. > - Reads no PR and needs no vendor CLI. > > This CRITICAL block is the SOLE enforcement layer — no `allowed-tools` backs it (deliberate).
Step 1 — Find the worktrees
Same layout `/open-pr:upgrade` searches: `notebooks/review/` sits wherever `/open-pr:review` ran, from pwd or one level down. FORBIDDEN: `cd`.
find . -maxdepth 6 -type d -path '*/notebooks/review/*/worktrees/*' -not -path '*/worktrees/*/*' 2>/dev/null
None → say there is nothing to clean, STOP.
Step 2 — Narrow, then size
`ARGUMENTS` non-empty ⇒ keep only worktrees whose `<repo>` segment it names, case-insensitive; 0 matched ⇒ STOP, listing the `<repo>`s found. Over what remains — never over what was just dropped, since each is a full checkout and `du` walks all of it:
du -sh <each worktree>
Step 3 — Show what would go, then ask
ONE CHOICE per `core/guardrails.md`, EXACTLY 2 options. Its body lists every worktree by path with its size and the total, so consent covers a list the user has read:
- `Remove all N (Recommended)` — detail: the reclaimed total; review re-creates a worktree next run, so
nothing is lost but disk — unless `/open-pr:fix` committed there and never pushed
- `Keep them` — detail: nothing deleted
Subset wanted (free text, or a re-run naming those repos) ⇒ honour it, those only. `Keep them` ⇒ STOP.
Step 4 — Remove
Per worktree, in this order — a plain `rm -rf` leaves the reviewed repo registering a worktree that no longer exists:
git -C "<worktree>" rev-parse --git-common-dir # ABSOLUTE <repo>/.git; <repo> = that minus /.git git -C "<repo>" worktree remove --force "<worktree>"
`--force` because the checkout is detached and holds untracked review scratch files.
That first command failing (the repo was moved or deleted) ⇒ the registration is already orphaned: `rm -rf "<worktree>"` instead.
Finish with `git -C "<repo>" worktree prune` per distinct repo, which drops any stale registration left by an earlier manual delete.
Step 5 — Report
Per repo: how many worktrees went and how much disk came back. Then, once: `notebooks/review/` still holds this repo's memory and settings — only the checkouts were removed.
ARGUMENTS: $ARGUMENTS
One AI reviewer for GitHub PRs and GitLab MRs. Learns each repo's conventions. Claude Code · Cursor · Codex · Gemini CLI · Antigravity.
Other commands on open-pr.
- /release-now
Create a git tag + GitHub Release for open-pr — an official release if standing on main, an RC if standing on a branch with an open PR (a dev tool specific to this repo, not shipped in the plugin).
Open command - /fix
Act on the findings a review left on a PR — takes or declines each by severity, edits code at pwd to match the project, 1 commit, replies once pushed.
Open command - /review
Review PRs against the conventions learned from each repo — 1 post per PR, findings tagged by severity, code left untouched.
Open command - /upgrade
Bring every per-repo config found below pwd up to the schema this build expects. Takes no PR.
Open command

