careful
यह क्या करती है
यह स्किल सुरक्षा जाँच जोड़ती है, जो जोखिम भरे कमांड चलने से पहले चेतावनी देती है, जैसे recursive delete, database drop और git की ज़बरदस्ती push। यह उन सभी के लिए है जो चाहते हैं कि उनका एजेंट उनके कंप्यूटर पर काम करते समय एक सुरक्षा जाल हो।
कब इस्तेमाल करें
- ✓जब आप चाहें कि आपका एजेंट फ़ाइलें या फ़ोल्डर मिटाने से पहले आपको चेतावनी दे।
- ✓जब आप database टेबल drop होने या git push ज़बरदस्ती होने से सुरक्षा चाहें।
- ✓जब आप लाइव सिस्टम पर काम करें और कमांड के आसपास अतिरिक्त सावधानी चाहें।
Skill का लिंक
https://github.com/garrytan/gstack/blob/main/careful/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“सुरक्षा मोड चालू कीजिए, और किसी भी ऐसे कमांड से पहले चेतावनी दीजिए जो डेटा मिटा सकता हो या git इतिहास फिर से लिख सकता हो।”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
चालू होने पर हर shell कमांड चलने से पहले जोखिम भरे पैटर्न के लिए जाँचा जाता है। जोखिम भरा कमांड मिलने पर एजेंट आपको चेतावनी देता है और आप तय करते हैं कि जारी रखना है या रद्द करना।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।
/careful — Destructive Command Guardrails
Safety mode is now active. Every Bash and PowerShell 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.
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":"careful","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
What's protected
| Pattern | Example | Risk |
|---|---|---|
rm -rf / rm -r / rm --recursive |
rm -rf /var/data |
Recursive delete |
DROP TABLE / DROP DATABASE |
DROP TABLE users; |
Data loss |
TRUNCATE |
TRUNCATE orders; |
Data loss |
git push --force / -f |
git push -f origin main |
History rewrite |
git reset --hard |
git reset --hard HEAD~3 |
Uncommitted work loss |
git checkout . / git restore . |
git checkout . |
Uncommitted work loss |
kubectl delete |
kubectl delete pod |
Production impact |
docker rm -f / docker system prune |
docker system prune -a |
Container/image loss |
PowerShell and cmd (Windows)
The hook also checks the PowerShell tool (Claude Code's main Windows shell)
and any pwsh/powershell/cmd launched from Bash. Matching ignores case,
covers aliases in command position, accepts parameter prefixes (-r, -fo)
and strips cmd ^ escapes. All rows above apply there too.
| Pattern | Example |
|---|---|
Remove-Item/rm/ri/del/erase/rd/rmdir + -Recurse or -Force |
gci | ri -r -fo |
cmd rd /s, rmdir /s, del /s, erase /s |
cmd /c rd /s /q C:\proj |
Format-Volume, Clear-Disk, Clear-Content, [IO.Directory]::Delete, [IO.File]::Delete |
Clear-Disk -Number 1 |
-EncodedCommand, iex, Start-Process of a shell, & $cmd (can't be inspected) |
irm $url | iex |
Best-effort on PowerShell. String matching can't see a command built at
runtime. For a hard stop, add Claude Code permission deny rules, which parse
PowerShell and its aliases: "deny": ["PowerShell(Remove-Item *)"] in
.claude/settings.json. The hook runs through bash, so Windows needs Git Bash.
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 tool_name and the command from the tool input JSON, checks it against the
patterns above, and returns a hookSpecificOutput payload with
permissionDecision: "ask" and a warning reason if a match is found (the
decision must be nested under hookSpecificOutput — Claude Code ignores a
top-level permissionDecision). You can always override a MEDIUM warning and
proceed.
HIGH tier (hard deny)
Two catastrophic shapes are denied, not asked: rm -r/-R of exactly
/, ~, or $HOME, and force-push to the repo's default branch. SIMPLE
commands only (no ;, &&, ||, |, newline) — compound shapes fall
through to the MEDIUM ask; --force-with-lease is never HIGH. A best-effort
advisory hard-stop, not a policy boundary: the escape hatch is ending the
opt-in, session-scoped /careful session.
Project patterns (additive only)
Add warn rules — one POSIX ERE per line, # comments OK — in
~/.gstack/careful-patterns.txt (global) or
~/.gstack/projects/<slug>/careful-patterns.txt (per-project). Consulted
after the built-in families, so config can only ADD rules, never suppress a
baseline warning. Invalid regex lines are skipped.
To deactivate, end the conversation or start a new one. Hooks are session-scoped.
अक्सर पूछे जाने वाले सवाल
यह कौन से कमांड जाँचती है?
उदाहरण हैं recursive delete, DROP TABLE, TRUNCATE, ज़बरदस्ती push, hard reset और kubectl delete।
क्या यह कमांड पूरी तरह रोक देती है?
यह चेतावनी देती है, और आप आगे बढ़ने या रद्द करने का चुनाव करते हैं।
क्या यह PowerShell को भी कवर करती है?
हाँ। विवरण कहता है कि हर Bash और PowerShell कमांड की जाँच होती है।
जानकारी
लोकप्रियता
- GitHub स्टार
- 139k
- रैंकिंग में स्थान
- #690
- लाइसेंस
- MIT
- अपडेट की गई
- 2/11/2026
कमेंट
- …
इस repository की और skills
autoplan
139kआपके एजेंट को एक ही रन में प्रोडक्ट, डिज़ाइन, इंजीनियरिंग और डेवलपर अनुभव के नज़रिए से योजना की समीक्षा करने में मदद करती है।
benchmark
139kआपके एजेंट को किसी बदलाव से पहले और बाद में पेज की गति नापकर वेब प्रदर्शन में गिरावट पकड़ने में मदद करती है।
browse
139kआपके एजेंट को असली वेब ब्राउज़र खोलने, पेज के प्रवाह में क्लिक करने, स्क्रीनशॉट लेने और कंसोल त्रुटियाँ जाँचने देती है।
hackernews-frontpage
139kआपके एजेंट को Hacker News का मौजूदा फ़्रंट पेज इकट्ठा करने में मदद करती है, हर कहानी की रैंक, शीर्षक, लिंक, अंक और टिप्पणियों की संख्या के साथ।
मिलती-जुलती skills
openclaw-update
394kयह आपके एजेंट को चल रहे OpenClaw Gateway को अपडेट करने में मदद करती है, इंस्टॉल के तरीके के अनुसार सही विधि चुनकर और सेशन बनाए रखकर।
diagnose-gateway
394kयह आपके एजेंट को सेटिंग्स, चैनल और पोर्ट जांचकर पता लगाने देती है कि OpenClaw Gateway क्यों फ़ेल हो रहा है, बिना कुछ बदले।
crabbox-apps
394kयह आपके एजेंट को किसी अस्थायी क्लाउड मशीन पर ऐप खोलने और चलाने देती है, फिर उसका व्यू आपके चैट के साइड पैनल में दिखाती है।