freeze

Restrict Edit and Write operations to a specified directory for the session.

Updated Aug 9, 2026
One-click install
npx skills add https://github.com/raghavbadhwar/rstack --skill freeze-raghavbadhwar
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: freeze
Source: https://github.com/raghavbadhwar/rstack/tree/main/freeze
Command: npx skills add https://github.com/raghavbadhwar/rstack --skill freeze-raghavbadhwar

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve? When debugging or working in a large codebase, AI agents can accidentally modify unrelated files, causing unintended side effects. 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 - Edit Boundary Enforcement: A PreToolUse hook intercepts every Edit and Write call and denies any operation targeting files outside the frozen directory. - Session-Persistent State: The freeze boundary is stored in a state file and persists for the entire session until removed with /unfreeze. - Path Safety: Trailing-slash normalization prevents sibling directories like /src-old from matching a /src boundary, and symlink resolution ensures accurate path checks. - Use Case: While debugging a failing module in src/payments, freeze edits to that directory so the agent cannot accidentally "fix" unrelated code elsewhere in the repository. ## Quick Start Ask the agent to freeze edits to the directory you are working in, for example by saying "freeze edits to src/payments".

Frequently Asked Questions about freeze

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

FAQPage Schema
How do I restrict file edits to one directory in a coding agent session?

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 for the rest of the session.

How do I remove the edit freeze boundary?

Run the /unfreeze command or simply end the conversation session. The freeze boundary is stored in a session state file, so it does not persist beyond the session unless explicitly set again.

Does the freeze skill block Bash commands from modifying files?

No. The freeze hook only intercepts Edit and Write tool calls. Bash commands such as sed can still modify files outside the boundary, so freeze is a guardrail against accidental edits, not a security boundary.

Why does freezing /src also need to avoid matching /src-old?

The skill appends a trailing slash to the freeze directory before comparison, so the prefix check only matches paths genuinely inside the directory. This prevents sibling directories with similar names like /src-old from being incorrectly included.

What happens if the freeze state file is missing or empty?

The hook script allows all Edit and Write operations when no freeze file exists or the stored path is empty. It also fails open if the file path cannot be parsed from the tool input, avoiding accidental blocking on parse errors.