Restricts file edits to one directory for the session, blocking any Edit, Write, or NotebookEdit outside it.

CCM score
62 of 100
skills.sh installs
401
GitHub stars
142.6K
last updated
Nov 25, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers setting, changing, and removing a directory boundary that applies to Edit, Write, and NotebookEdit calls only
  • Includes a PreToolUse hook (check-freeze.sh) that denies out-of-bounds edits and reads the boundary from shared state
  • Enforces fail-closed checks that resolve ~, .., relative paths, and symlinks before comparing against the boundary
  • Designed for keeping accidental edits inside a chosen folder during a session, though Bash or PowerShell can still modify files outside it

Install

$ npx -y skills add garrytan/gstack --skill freeze -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

/freeze — Restrict Edits to a Directory

Lock file edits to a specific directory. Any Edit, Write or NotebookEdit operation targeting a file outside the allowed path will be blocked (not just warned).

GSTACK_STATE_ROOT=$(~/.claude/skills/gstack/bin/gstack-paths --get GSTACK_STATE_ROOT); : "${GSTACK_STATE_ROOT:?gstack-paths failed; reinstall with ./setup or /gstack-upgrade}"
mkdir -p "$GSTACK_STATE_ROOT"/analytics
echo '{"skill":"freeze","ts":"'$(date -u +%Y-%m-%dT%H:%M:%SZ)'","repo":"'$(basename "$(git rev-parse --show-toplevel 2>/dev/null)" 2>/dev/null || echo "unknown")'"}'  >> "$GSTACK_STATE_ROOT"/analytics/skill-usage.jsonl 2>/dev/null || true

Setup

Ask the user which directory to restrict edits to. Use AskUserQuestion:

  • Question: "Which directory should I restrict edits to? Files outside this path will be blocked from editing."
  • Text input (not multiple choice) — the user types a path.

Once the user provides a directory path:

Details

Repository
github.com/garrytan/gstack
Category
CLI & Terminal
License
MIT
First seen
Nov 25, 2026

More from garrytan/gstack

All 63

Similar to Freeze

More CLI & Terminal