Modes System

Modes are specialized prompts that shape AI behavior for different types of work.

How Modes Work

Each mode is a Markdown file in ~/.crux/modes/ with YAML frontmatter:

---
name: security
description: Security-focused code review and hardening
temperature: 0.3
tool_constraints: read-heavy
think_mode: extended
gates: [0, 1, 2, 3, 4, 5]
---

# Security Mode

You are a security-focused code reviewer...

Frontmatter Fields

Field Description Values
name Mode identifier String
description One-line description String
temperature LLM temperature 0.0 - 1.0
tool_constraints Tool usage pattern read-heavy, write-heavy, balanced
think_mode Reasoning depth none, standard, extended
gates Safety gates to activate Array of gate numbers

Using Modes

Via MCP

Tool: get_mode_prompt
Input: { "mode": "security" }
Output: { "prompt": "# Security Mode\n\nYou are..." }

Via CLI

# List modes
crux modes

# Get mode prompt
crux mode security

In Session

Session state tracks active mode:

{
  "active_mode": "security",
  "active_tool": "claude-code"
}

Built-in Modes (24)

Development

Review & Analysis

Security

Design

Infrastructure

Planning & Strategy

Communication

Specialized

Creating Custom Modes

  1. Create a file in ~/.crux/modes/:
cat > ~/.crux/modes/my-mode.md << 'EOF'
---
name: my-mode
description: My custom mode
temperature: 0.5
tool_constraints: balanced
think_mode: standard
gates: [0, 1, 2]
---

# My Custom Mode

You are specialized for [my use case]...

## Guidelines

- Specific instruction 1
- Specific instruction 2
EOF
  1. Use it immediately:
crux mode my-mode

Mode Switching

Modes can be switched mid-session:

Tool: update_session
Input: { "active_mode": "security" }

The next prompt will use the new mode's context.

See Also