agent-teams
Coordinate multiple Claude Code sessions as a team — lead + teammates with shared task lists, mailbox messaging, and file-lock…
Prevent destructive operations using Claude Code hooks. Three modes — cautious (warn on dangerous commands), lockdown (restrict edits to one directory), and clear (remove restrictions). Uses PreToolUse matchers for Bash, Edit, and Write.
Claude Code
$ npx -y skills add rohitg00/pro-workflow --skill safe-mode --agent claude-code
Codex
$ npx skills add rohitg00/pro-workflow --skill safe-mode -a codex -y
Cursor
$ npx skills add rohitg00/pro-workflow --skill safe-mode -a cursor -y
Gemini CLI
$ npx skills add rohitg00/pro-workflow --skill safe-mode -a gemini-cli -y
GitHub Copilot
$ npx skills add rohitg00/pro-workflow --skill safe-mode -a github-copilot -y
OpenCode
$ npx skills add rohitg00/pro-workflow --skill safe-mode -a opencode -y
Windsurf
$ npx skills add rohitg00/pro-workflow --skill safe-mode -a windsurf -y
name: safe-mode
description: Prevent destructive operations using Claude Code hooks. Three modes — cautious (warn on dangerous commands), lockdown (restrict edits to one directory), and clear (remove restrictions). Uses PreToolUse matchers for Bash, Edit, and Write.
user-invocable: true
hooks:
PreToolUse:
- matcher: "Bash|Edit|Write"
hooks:
- type: command
command: "node \"${CLAUDE_PLUGIN_ROOT}/scripts/safe-mode-guard.js\""Three levels of protection against destructive operations during AI coding sessions.
> **Note:** These hooks are skill-scoped — they only activate when you invoke `/safe-mode`. The global `permission-request.js` hook in hooks.json provides always-on alerting for dangerous commands. Safe-mode adds opt-in blocking and directory restrictions on top of that.
/safe-mode cautious
Intercepts Bash commands before execution. Warns on dangerous patterns but does not block — the user decides.
**Flagged patterns:**
| Pattern | Risk | |---------|------| | `rm -rf` / `rm -r` | Recursive deletion | | `DROP TABLE` / `DROP DATABASE` | SQL data loss | | `TRUNCATE` | SQL data destruction | | `git push --force` / `git push -f` | Remote history rewrite | | `git reset --hard` | Local history loss | | `git clean -f` | Untracked file deletion | | `git checkout .` / `git restore .` | Discard all changes | | `chmod 777` | World-writable permissions | | `curl` or `wget` piped to a shell | Piped remote execution | | `> /dev/sda` / `dd if=` | Disk-level operations | | `:(){ :\|:& };:` | Fork bombs | | `sudo rm` | Elevated deletion |
**What happens:** the hook returns a permission `ask`, so Claude Code shows you a prompt that names the pattern, for example `Safe mode: rm with -r or -f`. You approve or reject the command. This prompt appears even in auto mode.
/safe-mode lockdown <path>
Restricts Edit and Write operations to a single directory tree. Prevents accidental changes to unrelated code.
**How it works:**
1. Set the allowed path (absolute or relative to repo root) 2. Every Edit/Write call checks if the target file is inside the allowed path 3. Operations outside the path are blocked with an explanation
LOCKDOWN ACTIVE: Edits restricted to src/api/ Blocked: Edit to src/utils/helpers.ts Reason: File is outside the lockdown path (src/api/) To edit files outside the lockdown, run: /safe-mode clear
**Use cases:**
**Scope:** Keyed to the project root. It stays set until `/safe-mode clear`, and only enforces in sessions where `/safe-mode` was invoked.
/safe-mode clear
Removes all restrictions for the current session. Both cautious warnings and lockdown restrictions are disabled.
SAFE MODE: All restrictions cleared for this session.
Invoking this skill registers one `PreToolUse` hook for `Bash|Edit|Write` that runs `scripts/safe-mode-guard.js`. Skill hooks stay registered for the rest of the session. The guard does nothing until a mode is set.
When the user runs `/safe-mode <mode>`, run the guard's setter from the project root:
node "${CLAUDE_PLUGIN_ROOT}/scripts/safe-mode-guard.js" set cautious
node "${CLAUDE_PLUGIN_ROOT}/scripts/safe-mode-guard.js" set lockdown src/api/
node "${CLAUDE_PLUGIN_ROOT}/scripts/safe-mode-guard.js" set clearThen report the line the setter prints.
The guard checks `tool_input.command` against a fixed list of destructive patterns: recursive or forced `rm`, `DROP` and `TRUNCATE`, force-push, hard reset, `git clean -f`, discarding all changes, `chmod 777`, piping `curl` or `wget` to a shell, disk-level writes, fork bombs, and `sudo rm`. A match returns `permissionDecision: "ask"` with the pattern as the reason. No match passes through.
The guard resolves `tool_input.file_path` against the project root, follows symlinks, and checks that it sits inside the lockdown path. Inside passes through. Outside exits 2, which blocks the edit and tells Claude why.
The mode lives in `$TMPDIR/pro-workflow/safe-mode-<hash>.json`, keyed by the project root, so two projects never share it:
{ "cautious": true, "lockdownPath": "/Users/dev/project/src/api", "root": "/Users/dev/project" }`set clear` deletes the file. The file outlives the session, so clear it when you are done; a new session only enforces it again after `/safe-mode` is invoked, because the hook is skill-scoped.
Cautious and lockdown can run simultaneously:
/safe-mode cautious /safe-mode lockdown src/api/
Now you get:
Clear removes both.
| Situation | Mode | |-----------|------| | Working on production-adjacent code | Cautious | | Focused refactoring of one module | Lockdown | | Unfamiliar codebase, feeling cautious | Cautious | | Pair programming, limiting AI scope | Lockdown | | Done with restrictions | Clear |
Claude Code learns from your corrections: self-correcting memory that compounds over 50+ sessions. Context engineering, parallel worktrees, agent teams, and 17 battle-tested skills.
Coordinate multiple Claude Code sessions as a team — lead + teammates with shared task lists, mailbox messaging, and file-lock…
Auto-configure quality gates, hooks, and settings for a new project. Detects project type and sets up appropriate tooling. Use…
Decompose large-scale changes into independent units and spawn parallel agents in isolated worktrees. Use for migrations,…
Capture a user-reported defect as a durable GitHub issue written in the project's own domain language. Explores the codebase in…
Smart context compaction with state preservation. Saves critical files, task progress, and working state before compaction,…
Master the four operations of context engineering — Write, Select, Compress, Isolate. Manage token budgets, compaction…
Shape output for a reader with ADHD: lead with the next action, number multi-step work, restate state across turns, suppress…
Set up the owner profile so a personal agent knows who it works for (first-run setup, \"get to know me\"), or distill colleague,…