freeze¶
Stages:
paper-draftingFreeze -- Session-Scoped Edit Guard¶
Blocks Write and Edit operations on files outside the specified directories. Use when reviewing code (freeze everything except notes), when writing (freeze scripts), or when editing data pipelines (freeze paper/).
Usage¶
Text Only
/freeze paper/ # Only allow edits in paper/
/freeze scripts/ data/ # Only allow edits in scripts/ and data/
/freeze off # Deactivate all freeze guards
How It Works¶
- Parse the directory arguments from the user's input
- Write the guard configuration to
.claude/state/session-guards.json - The
session-guardPreToolUse hook reads this file and blocks Edit/Write operations on files outside the allowed directories - Report what's frozen and what's editable
Activation¶
When the user invokes /freeze [dirs]:
- Read the current
.claude/state/session-guards.json(create if it doesn't exist) - Set the
freezeguard: - Confirm: "Freeze active. Edits allowed only in: [dirs]. Run
/freeze offto deactivate."
Deactivation¶
When the user invokes /freeze off:
- Read
.claude/state/session-guards.json - Set
freeze.activetofalse - Confirm: "Freeze deactivated. All paths editable."
Gotchas¶
- Freeze is session-scoped -- it resets when the conversation ends
- The guard file persists on disk but the hook checks a session flag
.claude/is always editable (can't freeze yourself out of config changes)- Paths are relative to the project root