freeze

Restricts Edit and Write operations to a specified directory using PreToolUse hooks.

107|7|Updated Mar 29, 2026
One-click install
npx skills add https://github.com/no-session/pstack --skill freeze-no-session
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: freeze
Source: https://github.com/no-session/pstack/tree/main/freeze
Command: npx skills add https://github.com/no-session/pstack --skill freeze-no-session

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? When debugging or working on one module, AI-assisted edits can accidentally modify unrelated files across the repository. This Skill enforces a hard boundary so Edit and Write operations outside a chosen directory are blocked, not just warned about. ## Core Features & Use Cases - Directory-scoped edit enforcement: A PreToolUse hook intercepts every Edit and Write call and denies any operation targeting files outside the frozen path. - Session-persistent boundary: The freeze directory is stored in a state file and re-read on every tool invocation, so the restriction lasts the whole session. - Path normalization and symlink resolution: The hook script resolves relative paths, symlinks, and .. sequences before comparing against the boundary, preventing trivial bypasses. - Use Case: While debugging a failing module in src/payments/, freeze edits to that directory so the AI cannot "fix" unrelated code elsewhere in the repo. ## Quick Start Ask the AI to freeze edits to the directory you are working in, for example by saying: restrict all edits to the src/payments folder for this session.

Frequently Asked Questions about freeze

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I restrict AI file edits to one directory?

Run the freeze command and provide the target directory when prompted. The skill saves the resolved absolute path to a state file, and a PreToolUse hook then blocks every Edit or Write call whose file path falls outside that directory.

How do I remove or change the edit restriction?

Run the freeze command again to set a new boundary directory, or run the companion unfreeze command to remove the restriction entirely. Ending the session also clears the active freeze state.

Does freezing edits block Bash commands too?

No. The freeze boundary applies only to the Edit and Write tools. Read, Bash, Glob, and Grep are unaffected, so shell commands like sed can still modify files outside the boundary. It prevents accidental edits, not a security boundary.

Why does the freeze directory need a trailing slash?

The trailing slash ensures prefix matching is exact, so a freeze on /src does not accidentally match a sibling directory like /src-old. The setup step normalizes the path before saving it to the state file.

What happens if the hook cannot parse the file path?

The hook script fails open: if it cannot extract a file_path from the tool input JSON, it allows the operation rather than blocking it. It tries grep/sed extraction first, then falls back to a Python JSON parser.