Skip to content
Automation
Command

/guard

[advanced] Activate both careful mode and freeze mode together

From plugin
octo
4.1k53 skills49 agents53 commands18 hooks
Install
> /plugin marketplace add nyldn/claude-octopus

How it fires

How this command gets triggered: by you, by Claude, or both.

  • Fires itselfClaude auto-loads it when your prompt matches the work.
  • You can call itInvoke it directly when you want it.
  • Slash command/guard

Context preview

What this command does when you run it.

[advanced] Activate both careful mode and freeze mode together

Command definition

guard.md
command: guard
disable-model-invocation: true
description: "[advanced] Activate both careful mode and freeze mode together"

Guard Mode - Full Safety Activation

Instructions

When the user invokes `/octo:guard <directory>`, activate both careful mode and freeze mode in a single command.

Activation

1. Activate careful mode (destructive command warnings):

_OCTO_SESSION_ID="${CLAUDE_CODE_SESSION_ID:-${CLAUDE_SESSION_ID:-$$}}"
echo "active" > "/tmp/octopus-careful-${_OCTO_SESSION_ID}.txt"

2. Activate freeze mode (edit boundary enforcement):

freeze_dir="$(cd "$1" 2>/dev/null && pwd)" || freeze_dir="$1"
_OCTO_SESSION_ID="${CLAUDE_CODE_SESSION_ID:-${CLAUDE_SESSION_ID:-$$}}"
echo "${freeze_dir}" > "/tmp/octopus-freeze-${_OCTO_SESSION_ID}.txt"

What It Does

Guard mode combines both safety primitives:

  • **Careful mode**: Warns before destructive Bash commands (rm -rf, DROP TABLE, git push --force, etc.)
  • **Freeze mode**: Blocks Edit/Write operations outside the specified directory

This is the recommended safety configuration for focused work in sensitive codebases.

Usage

/octo:guard src/auth
/octo:guard ./packages/core
/octo:guard /absolute/path/to/module

After activation, confirm to the user:

๐Ÿ›ก๏ธ Guard mode activated:
   โš ๏ธ Careful: Destructive commands require confirmation
   ๐Ÿ”’ Freeze: Edits restricted to <resolved-path>
   Use /octo:unfreeze to remove edit restriction.

Argument Required

If invoked without a directory argument, activate only careful mode and ask about freeze:

โš ๏ธ Careful mode activated (destructive command warnings).
Which directory should I restrict edits to? Example: /octo:guard src/auth

When to Use

  • Starting work in a production-adjacent codebase
  • Debugging with maximum safety
  • When you want both protections without two separate commands

See Also

  • `/octo:careful` โ€” Activate only destructive command warnings
  • `/octo:freeze` โ€” Activate only edit boundary enforcement
  • `/octo:unfreeze` โ€” Remove freeze restriction
Read more
Ships withocto

Every AI model has blind spots. Claude Octopus supports twelve external provider integrations โ€” Codex, Antigravity CLI, Copilot, Qwen, Ollama, Perplexity, OpenRouter, OrcaRouter, OpenCode, Cursor CLI, Grok, and Kimi Code โ€” alongside the built-in Claude Code

Get the whole plugin

Other commands on octo.