preclear
/preclear
Zapisuje do pliku zestawu roboczego wszystko, co warto zachować przed /clear, by po wyczyszczeniu sesji wczytać własny kontekst zamiast streszczenia.
- Autor
- sethimadhav10 ↗
- Repozytorium
- preclear ↗
- Licencja
- MIT
- Ostatnia zmiana repozytorium
- 03.11.2026
Ocena i bezpieczeństwo
- Pliki w paczce
- 2
- Skrypty
- 1
- Komentarze HTML
- 0
- Adresy URL w SKILL.md
- 0
Brak sygnałów. Repozytorium zmienione 03.11.2026, bez odwołań do wycofanych modeli i API.
MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.
- 1 skrypt w paczce. Przejrzyj je przed instalacją, bo Claude może je uruchomić.
Skrypty: resume_link.py
Co robi i kiedy
Zapisuje do pliku zestawu roboczego wszystko, co warto zachować przed /clear, by po wyczyszczeniu sesji wczytać własny kontekst zamiast streszczenia.
Wyzwalacze z opisu
Oryginalny opis (EN)
Get a long session ready for /clear by writing everything worth keeping into this session's workset file, so the cleared window reloads Claude's own curated context instead of a lossy /compact summary. Nothing to copy or paste. Use when the user invokes /preclear, says they're about to clear, says "get ready to clear", "context is getting long", or when the workset hook's 80% context nudge fires and the work is at a natural pause.
Jak działa
- Steps
- After the clear
- Never
Podgląd SKILL.md
---
name: preclear
description: Get a long session ready for /clear by writing everything worth keeping into this session's workset file, so the cleared window reloads Claude's own curated context instead of a lossy /compact summary. Nothing to copy or paste. Use when the user invokes /preclear, says they're about to clear, says "get ready to clear", "context is getting long", or when the workset hook's 80% context nudge fires and the work is at a natural pause.
---
# Preclear
`/compact` hands your context to a summariser that doesn't know which detail matters next.
`/preclear` has **you** decide. You write the handover into this session's **workset file**
(`~/.claude/workset/<session_id>.md`; the hook printed the path at session start). The user types
`/clear`, the hook reloads the file into the fresh window, and points at the old transcript in case
a dropped detail is needed later. Nothing to paste.
This is the closest Claude Code gets to a *Context Language Model* (Shao et al., arXiv:2609.37725):
the model alone decides what survives. That makes the file the **only** thing that survives, so it
has to be complete.
## Steps
1. **Make the work durable first.** The workset points to files; it doesn't replace them.
- state / plan documents are current, including today's reversals
- every number that cost real time is written down **with what it measures**
- artefacts that matter are out of temp / scratch directories
- anything that outlives this project is in memory or CLAUDE.md
2. **Rewrite the workset in place**, in this order, under ~4 KB:
- **What this is**: two lines — the system, the stakes, the posture (running? live? read-only?)
- **Read these first**: up to 3 absolute paths, ranked, with what each is for
- **Numbers that must not be re-derived**: each with its object, tagged ✔ verified · ◐ reported · ? assumed
- **Direction-of-fix traps**, in CAPITALS ("SERVING is right, TRAINING is stale — never the reverse")
- **What will bite**: blackout windows, hosts that must stay read-only, commands never to run
- **Decisions**: the user's own words, dated. Anything they haven't decided is OPEN — say so.
- **Retractions**: how many times this session was wrong, and the shape those errors shared
- **Running agents / open threads**: what each is waiting on
- **Next action**: one instruction, not a menu
3. **Read it the way it will be read.** Re-read the file cold. Could a competent stranger with only
this file and the disk take the next action correctly? If something lives only in your head,
it is gone after /clear.
4. **Background agents and jobs may not survive /clear.** Wait for them, or write in the workset
which ones need relaunching and how to check whether they are still running.
5. **Make the resume link.** Run `python3 <this skill's base directory>/resume_link.py <session_id>`.
`<session_id>` is the workset file's name (after an earlier /clear, it's the file the hook said
it reloaded from). It prints:
- a **fresh-window link** (macOS `file://…resume.command`, Linux `bash …resume.sh`): opens a new
Claude Code window in the session's folder with this workset loaded. This is the default —
curated context, not the whole old transcript.
- `cd <folder> && claude --resume <id>`: reopens the whole old chat instead.
If the script errors, say so. Never hand over a link it didn't print.
6. **Tell the user in two lines:** "Workset is current (N KB) — type /clear, or close this window and
use the link." Then paste the printed lines verbatim. You cannot type /clear yourself.
## After the clear
The hook injects the workset plus the old transcript's path. Trust the workset. If a needed detail is
missing, **grep** the old transcript for it — never read it whole; transcripts run to megabytes.
## Never
- Never append to the workset. Rewrite it.
- Never put credentials, API keys, tokens or customer data in it.
- Never say "ready to clear" before step 3 passes.
Pliki w paczce (2)
- SKILL.md 4 KB
- resume_link.py 4 KB
Wersje
W bazie nie ma innych skilli o nazwie preclear.
Migawka bazy z 13.11.2026 · wersja paczki 418ad28f5c51 (skrót SHA-256 całej paczki)
Pobrania w ostatnich 30 dniach: 0 · ranking
Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.
Podobne skille
- 100workset
Zapisuje kuratorowany kontekst sesji w małym pliku, który przeładowuje się po /compact lub /clear, zamiast zgadywania harnessu. - 90sessionlog:compact
Kompresuje bieżącą sesję do streszczenia, które można kontynuować po wyczyszczeniu kontekstu. - 100clear-prep
Przygotowuje projekt do czyszczenia kontekstu (/clear) lub kompaktowania bez utraty stanu: zapisuje pracę sesji w trwałych dokumentach i generuje jeden prompt wznowienia dla nowej sesji. - 90repack
Zapisuje przekazanie na kolejną sesję, a potem prowadzi użytkownika przez /clear i /continue w czystym oknie kontekstu. - 100session-start
Wczytuje warstwowy kontekst na początku sesji, po wyczyszczeniu lub wznowieniu pracy, i przygotowuje krótki brief. - 100session-budget
Ocenia, czy warto skompaktować albo wyczyścić bieżącą sesję i czy przekazanie przetrwa wyczyszczenie kontekstu.