careful
The `/octo:careful` slash command activates a safety mode that intercepts destructive commands in the current session and requires confirmation before execution. Use this when working in production environments, unfamiliar codebases, or any situation where accidental data loss poses significant risk. It detects and flags patterns like `rm -rf`, SQL DROP commands, force git operations, and kubectl delete actions, while allowing safe deletions to node_modules and similar build directories without interruption.
mkdir -p ~/.claude/commands && curl -fsSL https://raw.githubusercontent.com/nyldn/claude-octopus/HEAD/.claude/commands/careful.md -o ~/.claude/commands/careful.mdcareful.md
# Careful Mode - Destructive Command Warnings
## Instructions
When the user invokes `/octo:careful`, activate careful mode for the current session.
### Activation
Write the activation state file:
```bash
_OCTO_SESSION_ID="${CLAUDE_CODE_SESSION_ID:-${CLAUDE_SESSION_ID:-$$}}"
echo "active" > "/tmp/octopus-careful-${_OCTO_SESSION_ID}.txt"
```
### What It Does
Careful mode adds a PreToolUse safety net on Bash commands. Before any destructive command executes, you will be prompted to confirm. This catches accidental damage without blocking normal work.
**Detected patterns:**
- `rm -rf` (except safe targets: node_modules, dist, .next, __pycache__, build, coverage, .turbo)
- `DROP TABLE`, `DROP DATABASE`, `TRUNCATE`
- `git push --force`, `git push -f`
- `git reset --hard`
- `git checkout .`, `git restore .`
- `kubectl delete`
- `docker rm -f`, `docker system prune`
### Deactivation
Remove the state file to deactivate:
```bash
_OCTO_SESSION_ID="${CLAUDE_CODE_SESSION_ID:-${CLAUDE_SESSION_ID:-$$}}"
rm -f "/tmp/octopus-careful-${_OCTO_SESSION_ID}.txt"
```
### Usage
```
/octo:careful
```
After activation, confirm to the user:
```
⚠️ Careful mode activated. Destructive commands will now require confirmation before executing.
```
## When to Use
- Working in production environments
- Unfamiliar codebases where accidental deletion is risky
- Pair programming sessions where extra safety is desired
- Any time you want a safety net against destructive commands
## See Also
- `/octo:freeze` — Restrict edits to a specific directory
- `/octo:guard` — Activate both careful + freeze together
- `/octo:unfreeze` — Remove freeze restrictionBackend architect for scalable API design, microservices, and distributed systems
Cloud architect for AWS/Azure/GCP infrastructure, IaC, FinOps, and multi-cloud strategies
Code review expert for quality analysis, security vulnerabilities, and production reliability
Database architect for data modeling, technology selection, schema design, and migration planning
Debugging specialist for errors, test failures, and unexpected behavior
Technical documentation architect for comprehensive system docs and architecture guides
Frontend developer for React, Next.js, responsive layouts, and accessible UI components
Performance engineer for optimization, observability, and scalable system performance