freeze

Restricts Edit and Write operations to a user-specified directory for the session.

1|Updated Jul 23, 2026
One-click install
npx skills add https://github.com/sanjanb/my-agent-harness --skill freeze-sanjanb
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: freeze
Source: https://github.com/sanjanb/my-agent-harness/tree/main/skills/freeze
Command: npx skills add https://github.com/sanjanb/my-agent-harness --skill freeze-sanjanb

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve? When debugging or working on a single module, AI agents can accidentally modify unrelated files across the codebase. 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 explicitly removed. - Path Safety: Trailing-slash normalization and symlink resolution prevent false matches like /src matching /src-old. - Use Case: While debugging a failing module in src/auth/, 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/auth so nothing outside it can be modified".

Frequently Asked Questions about freeze

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

FAQPage Schema
How do I restrict AI agent edits to a specific 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 every Edit or Write operation targeting files outside that directory.

How to lock down file changes during a debugging session?

Freeze edits to the module you are investigating so the agent cannot modify unrelated code. The boundary persists for the whole session and can be changed by running freeze again or removed with the unfreeze command.

Does the freeze boundary block Bash commands too?

No, the freeze boundary only applies to Edit and Write tool operations. 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 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 true descendants of the frozen path. This prevents sibling directories with similar names from being incorrectly included.

How do I remove the edit freeze restriction?

Run the unfreeze command or simply end the conversation session. The freeze state is stored in a session-scoped state file, so it does not persist beyond the current session.