freeze

Restricts Edit and Write operations to a user-specified directory via PreToolUse hooks.

Updated Apr 5, 2026
One-click install
npx skills add https://github.com/VertaKhan/cs_gstack --skill freeze-vertakhan
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: freeze
Source: https://github.com/VertaKhan/cs_gstack/tree/main/.claude/skills/gstack/freeze
Command: npx skills add https://github.com/VertaKhan/cs_gstack --skill freeze-vertakhan

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? When debugging or working in a large codebase, AI-assisted edits can accidentally modify unrelated files outside the intended scope. This Skill enforces a hard boundary so that Edit and Write operations targeting files outside a chosen directory are blocked, not just warned about. ## Core Features & Use Cases - Edit Boundary Enforcement: A PreToolUse hook intercepts every Edit and Write call and denies any operation whose file path falls outside the frozen directory. - Session-Persistent State: The freeze boundary is stored in a state file (~/.gstack/freeze-dir.txt) and persists for the entire session until removed with /unfreeze. - Path Safety Handling: Trailing-slash normalization prevents sibling directories like /src-old from matching a /src boundary, and relative paths are resolved to absolute before checking. - Use Case: While debugging a failing module in src/payments, freeze edits to that directory so the AI cannot accidentally "fix" unrelated code elsewhere in the repository. ## Quick Start Ask the AI to freeze edits to the directory you are working in, for example by saying "freeze edits to src/payments", and confirm the path when prompted.

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 path when prompted. The skill saves the absolute path to a state file, and a PreToolUse hook then blocks any Edit or Write operation targeting files outside that directory.

How to scope Claude Code edits to a single module?▼

Use the freeze skill to lock edits to the module's directory. The hook checks each Edit/Write file_path against the stored boundary and returns a deny decision for anything outside it, keeping changes confined to that module.

Does the freeze boundary block Bash commands too?▼

No, the freeze hook only intercepts Edit and Write tool calls. Read, Bash, Glob, and Grep are unaffected, so commands like sed run through Bash can still modify files outside the boundary. It prevents accidental edits, not a security boundary.

How do I remove or change the freeze boundary?▼

Run /freeze again to set a new directory, or run /unfreeze to remove the restriction entirely. Ending the session also clears the boundary since it is stored per-session in the state file.

Why does the freeze directory need a trailing slash?▼

The trailing slash ensures prefix matching only blocks true siblings of the boundary. Without it, a freeze on /src would incorrectly match paths like /src-old, allowing edits in unintended directories.