# Freeze

> Lock file edits to a specific directory. Prevents accidental edits outside the designated scope. Use during focused refactoring, debugging, or when working on a specific module. Triggers: freeze, lock scope, restrict edits, scope lock.

- Skill: `xingfanxia/freeze` (Agent Skill)
- Install (CLI): `npx skillmds@latest add xingfanxia/freeze`
- Raw SKILL.md: https://api.skillmd.com/api/skills/xingfanxia/freeze/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: xingfanxia (https://skillmd.com/u/xingfanxia)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/xingfanxia/freeze

---


# Freeze Mode — Directory-Scoped Edit Restriction

Adapted from gstack's /freeze. Prevents scope creep by locking edits to a single directory.

## Activation

When this skill is loaded:

1. Ask the user: **"Which directory should I restrict edits to?"**
   - Accept a relative or absolute path
   - Resolve to absolute path
   - Confirm: **"Freeze active. Edits restricted to `<absolute-path>/`. Read/search tools unaffected."**

2. Store the freeze directory mentally for this session.

## Enforcement Rules

Before using **Edit**, **Write**, or **MultiEdit** on any file:

1. Resolve the target file's absolute path
2. Check if it starts with the frozen directory path (with trailing `/`)
3. If **outside** the frozen directory: **REFUSE** the edit

### Response When Blocked

```
BLOCKED: Edit to [file_path] is outside the freeze boundary.

Freeze directory: [frozen_dir]
Requested file:   [file_path]

To edit this file, run /unfreeze first, or ask me to update the freeze directory.
```

### What's NOT Affected

These tools work normally regardless of freeze:
- **Read**, **Glob**, **Grep** — reading/searching is always allowed
- **Bash** — shell commands are not restricted (use `/careful` for that)
- **Agent/Task** — subagent operations are unrestricted

## Special Cases

- **Creating new files** (Write): blocked if outside freeze directory
- **CLAUDE.md or settings.json**: blocked if outside freeze directory (no exceptions)
- **Test files**: if the test directory is outside freeze scope, warn but allow if the test directly covers frozen code

## Deactivation

- Run `/unfreeze` to remove the restriction
- End the session (freeze is session-scoped)
- Ask to change the freeze directory (replaces the current one)

