agentleFS
mintunitishmintunitish/tandem/skills/gstack/gstack-freeze/SKILL.md

gstack-freeze

Skill2 starsChanged 23 days agoApache-2.0View on GitHub

Restrict file edits to a specific directory for the session. (gstack)

2 other projects use a version of this, 2 of them edited.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 4 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Write outside the allowed path.

    line 15
  2. Distinctive:

    Use when asked to "freeze", "restrict edits", "only edit this folder", or "lock down edits".

    line 17
  3. Distinctive:

    Ask the user which directory to restrict edits to.

    line 28
  4. Distinctive:

    Ensure trailing slash and save to the freeze state file:

    line 41

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Tandem vendoring note. Vendored from gstack (MIT, (c) Garry Tan, https://github.com/garrytan/gstack @ a3259400). The upstream Claude-Code-specific boilerplate (telemetry, session tracking, update checks, plan-mode hooks, learnings/brain sync) was removed; the workflow itself is unchanged. Paths below are relative to this skill's directory; sibling skills live at ../<id>/ (ids are prefixed gstack-). $GSTACK_ROOT is an optional upstream gstack install (default ~/.claude/skills/gstack) needed only for optional helpers such as the browse binary; skip any step that needs it when it is absent. "Ask the user" means a plain chat question when no structured question tool exists.

When to invoke this skill

Blocks Edit and Write outside the allowed path. Use when debugging to prevent accidentally "fixing" unrelated code, or when you want to scope changes to one module. Use when asked to "freeze", "restrict edits", "only edit this folder", or "lock down edits".

/freeze — Restrict Edits to a Directory

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

Setup

Ask the user which directory to restrict edits to. Use ask-the-user:

  • 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:

  1. Resolve it to an absolute path:
FREEZE_DIR=$(cd "<user-provided-path>" 2>/dev/null && pwd)
echo "$FREEZE_DIR"
  1. Ensure trailing slash and save to the freeze state file:
FREEZE_DIR="${FREEZE_DIR%/}/"
eval "$($GSTACK_ROOT/bin/gstack-paths)"
STATE_DIR="$GSTACK_STATE_ROOT"
mkdir -p "$STATE_DIR"
echo "$FREEZE_DIR" > "$STATE_DIR/freeze-dir.txt"
echo "Freeze boundary set: $FREEZE_DIR"

Tell the user: "Edits are now restricted to <path>/. Any Edit or Write outside this directory will be blocked. To change the boundary, run /freeze again. To remove it, run /unfreeze or end the session."

How it works

The hook reads file_path from the Edit/Write tool input JSON, then checks whether the path starts with the freeze directory. If not, it returns permissionDecision: "deny" to block the operation.

The freeze boundary persists for the session via the state file. The hook script reads it on every Edit/Write invocation.

Notes

  • The trailing / on the freeze directory prevents /src from matching /src-old
  • Freeze applies to Edit and Write tools only — Read, Bash, Glob, Grep are unaffected
  • This prevents accidental edits, not a security boundary — Bash commands like sed can still modify files outside the boundary
  • To deactivate, run /unfreeze or end the conversation

Enforcement outside Claude Code (Tandem note)

Upstream enforces this skill with a Claude Code PreToolUse hook. Other agents have no such hook, so you must self-enforce: before every shell command or file edit, run the matching check script from this skill's bin/ directory (bin/check-careful.sh / bin/check-freeze.sh; they read the tool-input JSON on stdin) or apply the same rules by hand, and stop to ask the user whenever a rule trips. Tandem's own sandbox and permission cards remain the hard boundary.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.