Przejdź do treści
Biblioteka skilli
Programowanie · Automatyzacja

zap

/zap

Znajduje nieaktualne worktree Git i bezpiecznie je usuwa, także te zostawione przez agentów kodujących.

Repozytorium
zap ↗
Licencja
MIT
Ostatnia zmiana repozytorium
13.11.2026

Ocena i bezpieczeństwo

100/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść35 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
1
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
0
Przestarzałość

Brak sygnałów. Repozytorium zmienione 13.11.2026, bez odwołań do wycofanych modeli i API.

Licencja

MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.

Co robi i kiedy

Znajduje nieaktualne worktree Git i bezpiecznie je usuwa, także te zostawione przez agentów kodujących.

Oryginalny opis (EN)

Find stale git worktrees (merged, empty, gone, missing) and remove them safely with the zap CLI. Use when the user asks to clean up, list or free disk space from git worktrees, including ones left behind by coding agents in .claude/worktrees, ~/.codex/worktrees and similar folders.

Jak działa

  1. Look (always safe)
  2. Remove (only after the user says so)
  3. Undo
  4. Exit codes
Sekcje z nagłówków SKILL.md, w oryginale · 68 linii, 506 słów
Podgląd SKILL.md
---
name: zap
description: Find stale git worktrees (merged, empty, gone, missing) and remove them safely with the zap CLI. Use when the user asks to clean up, list or free disk space from git worktrees, including ones left behind by coding agents in .claude/worktrees, ~/.codex/worktrees and similar folders.
---

# zap: stale git worktrees

`zap` finds git worktrees whose work already landed and removes them, with backups and undo.
Read before you act, and never delete without the user's explicit go-ahead.

## Look (always safe)

```bash
zap scan --json                 # worktrees of the current repository
zap scan --all --json           # every repository under the user's scan roots
zap explain --json <path>       # every check and safety gate behind one worktree's status
zap clean --dry-run --json      # what clean would remove, and what it keeps and why
zap clean --all --dry-run --json
zap check --json                # merged or empty worktrees and free disk space (exit 3 past a limit)
zap map --json                  # agent disk use: worktrees per agent, temp sessions, transcripts
```

Add `--fetch` to see pull requests merged on the remote; add `--gh` to ask GitHub too.

Every `--json` command prints one envelope on stdout:
`{schemaVersion, command, status: "ok"|"error", data, warnings, error: {code, message}}`.

Statuses: `merged` (work is in the target branch), `empty` (no commits of its own), `gone`
(remote branch deleted), `missing` (folder gone), `idle` (unmerged and untouched), `active`.

## Remove (only after the user says so)

1. Show the user the dry run: which worktrees, their size, and anything kept with its reason.
2. Only when they agree: `zap clean --yes --json` (add `--all` if that is what they approved).
3. Report `data.results`: each `outcome` is `zapped`, `skipped` or `failed`.

Rules:

- zap only removes in repositories with a `.zap` file. Do not run `zap init` or edit `.zap`
  unless the user asks: that is the user's decision to opt a repository in.
- Exit code 4 with error code `refused` and a message about the disclaimer means the user has
  not accepted zap's one-time disclaimer. Do not work around it; ask the user to run
  `zap clean` once in their own terminal.
- Never pass `--unlock-stale` unless the user asks: it releases locks other tools set.
- Never delete worktrees with `rm -rf` or `git worktree remove --force` instead of zap.
- Idle worktrees are never removed by `zap clean`; only the user can pick them in `zap`.
- `zap schedule on` installs a launchd agent or systemd timer on the user's machine: run it only
  when the user asks. zap reports agent temp sessions and transcripts but never deletes them;
  do not delete them yourself either (transcripts are how sessions are resumed).

## Undo

```bash
zap history --json    # runs, with the backup ref of every deleted branch
zap undo --json       # bring back the latest run: branches and worktrees
zap undo <RUN> --json
```

Files git ignores inside a removed worktree (node_modules, build output, caches) are not
restored.

## Exit codes

| Code | Meaning |
|---|---|
| 0 | ok |
| 1 | error (see `error.code`) |
| 2 | bad usage |
| 3 | `zap check`: a limit was passed (merged or empty worktrees, or free space) |
| 4 | refused: confirmation or disclaimer missing; nothing was changed |
| 130 | interrupted |

Wersje

W bazie nie ma innych skilli o nazwie zap.

Migawka bazy z 13.11.2026 · wersja paczki 66dccea46f48 (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 1 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 100cleanup
    Bezpiecznie analizuje i czyści worktrees git Claude Code przy pomocy Bonsai: usuwa nieaktualne worktrees agentów, katalogi .claude/worktrees i odzyskuje miejsce na dysku.
  • 100cleanup-git
    Usuwa scalone lokalne gałęzie git i nieaktualne worktrees, porządkując lokalny stan repozytorium.
  • 100worktree
    Tworzy, sprawdza i bezpiecznie usuwa worktree git w repozytoriach, pilnując zasady worktree przed zmianą.
  • 85clean-gone
    Usuwa zakończone lokalne gałęzie Gita i nieaktualne worktree, zachowując to, co lokalnie przydatne, po scaleniu lub zamknięciu pull requesta.
  • 100git-worktree-prune
    Bezpiecznie usuwa nieaktualne git worktrees i lokalne gałęzie po dawnych sesjach, kasując tylko te bez unikalnej pracy, tak aby żaden commit nie zginął.
  • 100worktree-sweep
    Wyszukuje nieaktualne worktree w wielu repozytoriach, klasyfikuje je i po zatwierdzeniu usuwa te czyste, mierząc zajęte miejsce.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.