Aller au contenu
Skillpedia
Déploiement et cloud (DevOps)139k · #704

freeze

Ce qu’il fait

Cette skill verrouille les modifications de fichiers dans un seul répertoire que vous choisissez. Elle s'adresse aux personnes qui veulent qu'un agent ne travaille que dans une partie précise d'un projet.

Quand l’utiliser

  • ✓Quand vous voulez que votre agent ne modifie des fichiers que dans un seul dossier pendant une session.
  • ✓Quand vous craignez qu'un agent modifie des parties du projet sans rapport.
  • ✓Quand vous voulez une limite stricte sur les endroits où les modifications sont possibles.

Lien du skill

https://github.com/garrytan/gstack/blob/main/freeze/SKILL.md

Copiez-le et collez-le dans votre IA (Claude, ChatGPT ou Cursor) en lui demandant de suivre les instructions.

Comment l’utiliser

Le plus simple : copiez le message et collez-le dans votre IA. Elle lit le skill et suit les instructions.

Message prêt à coller

Utilise ce skill pour m’aider : https://github.com/garrytan/gstack/blob/main/freeze/SKILL.md Lis le fichier SKILL.md de ce lien et suis ses instructions pour ma tâche.
Envie que votre IA trouve seule des skills comme celui-ci ?Installez le MCP gratuit de Skillpedia : une ligne, et elle cherche parmi 15 000+ skills avant chaque tâche.Installer en 1 minute →

Exemple de demande à votre IA

“Je veux que vous verrouilliez les modifications de fichiers au dossier src/billing pour cette session, pour que rien en dehors ne soit changé.”

5 nouveaux skills par semaine. 1 minute de lecture.

Comment ça marche

Vous indiquez un dossier, et la skill l'enregistre comme seul endroit où les modifications sont autorisées. Toute modification en dehors de ce dossier est bloquée, et non simplement signalée.

Contenu technique (SKILL.md original)

Texte original de l’auteur, en anglais, directement depuis GitHub.

<!-- AUTO-GENERATED from SKILL.md.tmpl — do not edit directly --> <!-- Regenerate: bun run gen:skill-docs -->

/freeze — Restrict Edits to a Directory

Lock file edits to a specific directory. Any Edit, Write or NotebookEdit operation targeting a file outside the allowed path will be blocked (not just warned).

GSTACK_STATE_ROOT=$(~/.claude/skills/gstack/bin/gstack-paths --get GSTACK_STATE_ROOT); : "${GSTACK_STATE_ROOT:?gstack-paths failed; reinstall with ./setup or /gstack-upgrade}"
mkdir -p "$GSTACK_STATE_ROOT"/analytics
echo '{"skill":"freeze","ts":"'$(date -u +%Y-%m-%dT%H:%M:%SZ)'","repo":"'$(basename "$(git rev-parse --show-toplevel 2>/dev/null)" 2>/dev/null || echo "unknown")'"}'  >> "$GSTACK_STATE_ROOT"/analytics/skill-usage.jsonl 2>/dev/null || true

Setup

Ask the user which directory to restrict edits to. Use AskUserQuestion:

  • Question: "Which directory should I restrict edits to? Files outside this path will be blocked from editing."
  • Text input (not multiple choice) — the user types a path.

Once the user provides a directory path:

Set the user-selected boundary with the shared state writer. It resolves the physical absolute path and serializes replacement with investigation cleanup:

bash "$HOME/.claude/skills/gstack/freeze/bin/freeze-state.sh" set "<user-provided-path>"

Only report success if the helper succeeds. On FREEZE_BUSY or unexpected state, preserve it and ask the user to inspect recovery after any active writer finishes; never write or delete the state file directly.

Tell the user: "Edits are now restricted to <path>/. Any Edit, Write or NotebookEdit outside this directory will be blocked. To change the boundary, run /freeze again. To remove it, run /unfreeze."

How it works

The hook reads file_path from the Edit/Write tool input JSON, or notebook_path from a NotebookEdit (Jupyter notebook) call (shared real-JSON extractor with /careful — one copy, sourced by both hooks), then checks whether the path starts with the freeze directory. If not, it returns a hookSpecificOutput payload with permissionDecision: "deny" to block the operation (nested under hookSpecificOutput — Claude Code ignores a top-level permissionDecision).

Polarity is fail-closed: a tool payload the hook cannot parse is DENIED, not allowed — a boundary that fails open is not a boundary. A payload that parses but has neither path field (a non-file tool) is allowed. A deny names the tool, the path field, the boundary and /unfreeze. The path is resolved before the check: ~, .. and relative paths, and symlinks at every depth, even through folders that do not exist yet. A path the hook cannot place (a symlink loop, a line break, a Windows drive-relative path, over 4096 characters) is denied.

The freeze boundary persists until explicitly removed via the state file. The hook script reads it on every Edit/Write/NotebookEdit invocation. Boundaries containing spaces are supported.

Notes

  • The trailing / on the freeze directory prevents /src from matching /src-old
  • Freeze applies to Edit, Write and NotebookEdit only — Read, Bash, PowerShell, Glob, Grep are unaffected
  • This prevents accidental edits, not a security boundary — Bash or PowerShell commands like sed or Set-Content can still modify files outside the boundary
  • To deactivate, run /unfreeze; ending or killing a conversation does not remove persisted state
Questions fréquentes

Que se passe-t-il pour les modifications hors du dossier ?

Elles sont bloquées, et pas seulement signalées.

Comment choisir le dossier ?

La skill vous demande le chemin d'un répertoire, que vous saisissez.

Empêche-t-elle la lecture des fichiers ?

Non. La description couvre les modifications, y compris les opérations Edit, Write et NotebookEdit.

Détails

Description originale de l’auteur

Restrict file edits to a specific directory for the session. (gstack)

repo: garrytan/gstack

Popularité

Étoiles GitHub
139k
Position au classement
#704
Licence
MIT
Mis à jour
02/11/2026

Ce skill vous est-il utile ?

0

Connectez-vous pour voter.

Commentaires

  • …

Autres skills de ce dépôt

Skills similaires