freeze
The freeze command restricts file edit and write operations to a specified directory, blocking any modifications outside that boundary while leaving read and search operations unrestricted. Use it during focused debugging, code reviews, or refactoring to prevent accidental changes to unrelated files while maintaining full investigative access.
mkdir -p ~/.claude/commands && curl -fsSL https://raw.githubusercontent.com/nyldn/claude-octopus/HEAD/.claude/commands/freeze.md -o ~/.claude/commands/freeze.mdfreeze.md
# Freeze Mode - Edit Boundary Enforcement
## Instructions
When the user invokes `/octo:freeze <directory>`, activate freeze mode to restrict Edit and Write operations to the specified directory.
### Activation
1. Resolve the directory argument to an absolute path
2. Ensure trailing `/` for safe prefix matching
3. Write the boundary to the state file:
```bash
# Resolve to absolute path
freeze_dir="$(cd "$1" 2>/dev/null && pwd)" || freeze_dir="$1"
# Write state
_OCTO_SESSION_ID="${CLAUDE_CODE_SESSION_ID:-${CLAUDE_SESSION_ID:-$$}}"
echo "${freeze_dir}" > "/tmp/octopus-freeze-${_OCTO_SESSION_ID}.txt"
```
### What It Does
Freeze mode adds a PreToolUse safety net on Edit and Write tools. Any file operation targeting a path **outside** the frozen directory is blocked with a deny decision. This prevents accidental edits to unrelated code.
**Blocked:** Edit, Write to files outside the boundary
**Unaffected:** Read, Bash, Glob, Grep (investigation stays unrestricted)
### Usage
```
/octo:freeze src/auth
/octo:freeze ./packages/core
/octo:freeze /absolute/path/to/module
```
After activation, confirm to the user:
```
🔒 Freeze mode activated. Edits restricted to: <resolved-path>
Read/search operations remain unrestricted.
Use /octo:unfreeze to remove this restriction.
```
### Argument Required
If invoked without a directory argument, ask the user which directory to freeze:
```
Which directory should I restrict edits to? Example: /octo:freeze src/auth
```
## When to Use
- Debugging a specific module (auto-activated by skill-debug)
- Code review where you want to ensure no unrelated changes
- Focused refactoring within a single package
- Any time you want to guarantee edit boundaries
## See Also
- `/octo:careful` — Warn before destructive commands
- `/octo:guard` — Activate both careful + freeze together
- `/octo:unfreeze` — Remove freeze restrictionBackend architect for scalable API design, microservices, and distributed systems
Cloud architect for AWS/Azure/GCP infrastructure, IaC, FinOps, and multi-cloud strategies
Code review expert for quality analysis, security vulnerabilities, and production reliability
Database architect for data modeling, technology selection, schema design, and migration planning
Debugging specialist for errors, test failures, and unexpected behavior
Technical documentation architect for comprehensive system docs and architecture guides
Frontend developer for React, Next.js, responsive layouts, and accessible UI components
Performance engineer for optimization, observability, and scalable system performance