| name | freeze |
| description | Directory freeze guardrail that restricts file edits to a specific directory for the current session |
Session-scoped directory restriction that blocks file edits outside a specified directory. Activate when debugging to prevent accidentally "fixing" unrelated code.
Triggers on: "freeze mode", "lock directory", "restrict edits", "only edit in"
Announce: "Freeze mode ACTIVATED. File edits restricted to: [directory]. Changes outside this directory will be blocked."
When `file_path` is outside freeze directory
When `file_path` is outside freeze directory
When `notebook_path` is outside freeze directory
When command contains `>` or `>>` to path outside freeze directory
Reading any file (Read, Grep, Glob) — unrestricted
Editing files inside the freeze directory — unrestricted
Running commands that don't write outside the directory
Creating new files inside the freeze directory
Auto-detect worktree path if in worktree. Ask user: "Which directory to restrict to? (default: cwd)". Store freeze directory for session.
STOP — do not execute. WARN — "BLOCKED by freeze mode: Cannot edit [path]. Only edits in [freeze_dir] allowed." ASK — "Override for this specific file? (yes/no)".
Debugging (add logs without fixing unrelated code), feature isolation (only touch feature dir), review mode (read anything, don't change outside PR scope), worktree safety.
Config files (package.json, tsconfig) may live outside feature directory — override when needed
Tests may live in separate `tests/` directory — consider freezing at higher level
Doesn't block build tools from writing outside — only blocks Claude's direct edits