mk:freeze
Restricts the Edit and Write tools to one directory for the current session so edits stay inside the module you are working on.
| Source | .claude/skills/freeze/SKILL.md |
| Owner | lifecycle |
| Runtime | claude-code |
| Risk | medium |
What it does
mk:freeze stores one directory as the session's edit boundary. A PreToolUse hook, check-freeze.cjs, runs on every Edit and Write and denies any file_path outside that directory. It is an intent guardrail, not a security boundary.
When to use it
Use it when debugging or refactoring one module, working in a monorepo where a change could spill into other packages, or when you say "freeze", "only edit this folder" or "lock down edits". Usage: /mk:freeze [PATH]. Without a path the skill asks for one.
| Need | Use instead |
|---|---|
| Warn before destructive shell commands | mk:careful |
The two combine: freeze stops stray edits and careful warns on destructive Bash commands.
What it restricts
| Tool | Restricted |
|---|---|
| Edit, Write | Yes, denied outside the boundary |
Bash (sed, awk, cp, mv) | No |
| Read, Glob, Grep | No |
Steps
- You run
/mk:freezewith a path, or give one when asked. scripts/set-freeze.cjsresolves the path to an absolute directory with a trailing slash. The slash stops/srcfrom matching/src-old. It refuses a missing path, a file and the filesystem root, and leaves the saved boundary unchanged when it refuses.- The boundary is saved to
${CLAUDE_PLUGIN_DATA:-.meowkit/state}/freeze-dir.txtand read back. - On each Edit or Write the hook compares
file_pathwith the boundary and returns allow or deny, with a message naming the boundary.
Ending a freeze
The boundary lives in a state file and lasts until it is cleared, including across sessions: a later session that loads the skill enforces the old boundary again. Running /mk:freeze with another path replaces it. To clear it, run node .claude/skills/freeze/scripts/set-freeze.cjs --clear.
Gotchas
- The hook checks the stated path, not a resolved symlink target. Avoid symlinks inside the frozen directory that point outside it.
- Files outside the boundary, including shared test fixtures, cannot be edited. Move the boundary with
/mk:freeze.
The skill's mechanics are in references/freeze-mechanics.md.