/freeze — Lock edits to a scope
Tell the agent which directory it can touch.
Activate
Pass the directory you want the agent to work in:
/freeze src/features/checkout/
From this point, the agent can only write to files inside src/features/checkout/ and its subdirectories. Any write attempt outside that scope gets blocked with a clear message explaining the restriction.
What it does
- Writes blocked outside path— file creation, modification, and deletion are all restricted to the frozen scope. The agent cannot create a new file in src/lib/ or edit package.json without unfreezing first.
- Reads always allowed— the agent can still read any file in the project. It needs to read imports, configs, and types to do its job. Freeze restricts writes, not reads.
- Shell commands restricted— commands that modify the filesystem are checked against the freeze scope. Running mkdir outside the scope is blocked. Running cat or grep outside the scope is allowed.
Multiple scopes
You can freeze multiple directories:
/freeze src/features/checkout/ /freeze src/components/cart/
Now writes are allowed in either directory. Each /freeze call adds to the allowed list rather than replacing it.
When to use
- Working on a feature branch that should only touch one module. Freeze to that module to prevent the agent from "fixing" things elsewhere.
- Doing a refactor of a specific subsystem. You want the agent focused on those files and nothing else.
- Running --thorough security review on a sensitive area. Freeze the scope so any auto-fixes stay contained.
- Pair programming with an agent in a monorepo. Freeze to your package to avoid cross-package contamination.
Unfreeze
/unfreeze
Removes all scope restrictions. The agent can write anywhere in the project again. You can also unfreeze a specific path while keeping others frozen:
/unfreeze src/features/checkout/
Freeze does not persist
Like /guard, freeze state lives in the session. Starting a new session starts without restrictions. If you always want a specific freeze scope, add it to your workflow by calling /freeze at the start of each session.
Interaction with /guard
Freeze and guard work together. Guard checks the command against block rules, and freeze checks the target path. A command can be allowed by guard but blocked by freeze (writing to a safe command targeting a frozen-out path) or blocked by guard but within the freeze scope (a dangerous command targeting the allowed path). Both checks must pass for the command to execute.