Skip to main content
ClaudeWave
Slash Command3.6k repo starsupdated yesterday

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.

Install in Claude Code
Copy
mkdir -p ~/.claude/commands && curl -fsSL https://raw.githubusercontent.com/nyldn/claude-octopus/HEAD/.claude/commands/careful.md -o ~/.claude/commands/careful.md
Then start a new Claude Code session; the slash command loads automatically.

careful.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 restriction