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

gstack-careful

Skill2 starsChanged 23 days agoApache-2.0View on GitHub

Safety guardrails for destructive commands. (gstack)

  • Deletes or force-pushes
  • Commits and pushes

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

Adopted by

Most recently taken up by

The file

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

Warns before rm -rf, DROP TABLE, force-push, git reset --hard, kubectl delete, and similar destructive operations. User can override each warning. Use when touching prod, debugging live systems, or working in a shared environment. Use when asked to "be careful", "safety mode", "prod mode", or "careful mode".

/careful — Destructive Command Guardrails

Safety mode is now active. Every bash command will be checked for destructive patterns before running. If a destructive command is detected, you'll be warned and can choose to proceed or cancel.

What's protected

PatternExampleRisk
rm -rf / rm -r / rm --recursiverm -rf /var/dataRecursive delete
DROP TABLE / DROP DATABASEDROP TABLE users;Data loss
TRUNCATETRUNCATE orders;Data loss
git push --force / -fgit push -f origin mainHistory rewrite
git reset --hardgit reset --hard HEAD~3Uncommitted work loss
git checkout . / git restore .git checkout .Uncommitted work loss
kubectl deletekubectl delete podProduction impact
docker rm -f / docker system prunedocker system prune -aContainer/image loss

Safe exceptions

These patterns are allowed without warning:

  • rm -rf node_modules / .next / dist / __pycache__ / .cache / build / .turbo / coverage

How it works

The hook reads the command from the tool input JSON, checks it against the patterns above, and returns permissionDecision: "ask" with a warning message if a match is found. You can always override the warning and proceed.

To deactivate, end the conversation or start a new one. Hooks are session-scoped.

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.