---
name: eck:sudo
version: "0.7.4"
description: Temporarily disable safety protections for the current session only — does not modify global or project settings permanently
disable-model-invocation: true
---

# Sudo — Session-Scoped Protection Bypass

Temporarily disable all safety hooks (protect-files, detect-secrets, hitl-approval, security-gate) for the **current session only**. Protections auto-restore when the session ends. This does not modify global preferences or project settings permanently.

Use when safety hooks are interrupting a known-safe workflow and you want to suppress prompts for the remainder of the session.

---

## Visual Framework

Follow these conventions for all terminal output displayed to the user via the Bash tool.

### Output Mode Awareness

Before producing output, read the user's preferred output mode:

```bash
cat $ECK_HOME/user-preferences.json 2>/dev/null
```

Extract the `outputMode` field and adapt verbosity:

- **guided** — Add explanatory prose after key steps. Describe what is happening and why.
- **standard** (default) — Balanced. Show steps with brief context for non-obvious decisions.
- **concise** — Steps and summary box only. No prose, no explanations.

If the file is missing or `outputMode` is absent, use **standard**.

### ANSI Colors

Declare these variables at the top of **every** Bash tool call (shell state does not persist between calls):

```bash
source $ECK_HOME/colors.sh
```

Every color sequence **must** end with `${RESET}`. No exceptions.

### Stage Banners

Mark major stage transitions with a banner. One blank line before and after.

```bash
echo ""
printf '%b\n' "${ORANGE}${BOLD}STAGE NAME${RESET}"
echo ""
```

### Status Symbols

| Symbol | Meaning          | Color       |
| ------ | ---------------- | ----------- |
| `[*]`  | Active / running | `${CYAN}`   |
| `[x]`  | Completed        | `${GREEN}`  |
| `[!]`  | Error            | `${RED}`    |
| `[-]`  | Skipped          | `${DIM}`    |
| `[>]`  | In progress      | `${YELLOW}` |
| `[ ]`  | Pending          | `${DIM}`    |

```bash
printf '%b\n' "${GREEN}[x]${RESET} Step completed"
printf '%b\n' "${RED}[!]${RESET} Something failed"
```

No emoji in output. Use only these bracket symbols for status.

### Summary Boxes

Display at checkpoints and at the end of the skill. One blank line before and after.

```bash
echo ""
printf '%b\n' "${ORANGE}${BOLD}Title${RESET}"
echo ""
printf '%b\n' "Label: Value"
echo ""
```

### Error Format

```bash
printf '%b\n' "${RED}[!]${RESET} Error message here"
printf '%b\n' "    ${DIM}Recovery guidance here.${RESET}"
```

### Spacing Rules

- One blank line before and after stage banners and summary boxes.
- No blank lines within step lists.
- Maximum output line width: 70 characters.

### Statusline Stage Updates

At the **start** of each stage, update the statusline:

```bash
bash $ECK_HOME/update-stage.sh "{Statusline text from table}"
```

At **skill completion** (success or error), reset:

```bash
bash $ECK_HOME/update-stage.sh
```

---

## Task Registration

| Stage | Subject                         | Active Form               | Statusline |
| ----- | ------------------------------- | ------------------------- | ---------- |
| 1     | Stage 1: Check Protection State | Checking protection state | Sudo (1/3) |
| 2     | Stage 2: Disable Protections    | Disabling protections     | Sudo (2/3) |
| 3     | Stage 3: Confirm Sudo Active    | Confirming sudo active    | Sudo (3/3) |

## Usage

```bash
/eck:sudo                    # Disable protections for this session
```

No flags. No arguments. Sudo is always session-scoped.

---

## Stage 1: Check Protection State

### Inputs

- Current directory
- `.claude/settings.json`

### Activities

1. **MUST** verify `.claude/settings.json` exists
2. **MUST** check whether any safety hooks are currently active in settings.json
3. If no hooks are active, report that protections are already off — no action needed

**If settings.json not found:**

```bash
source $ECK_HOME/colors.sh

printf '%b\n' "${RED}[!]${RESET} Settings file not found: .claude/settings.json"
printf '%b\n' "    ${DIM}This command only works in project directories with Claude Code infrastructure.${RESET}"
```

**If no hooks active:**

```bash
source $ECK_HOME/colors.sh

printf '%b\n' "${YELLOW}[-]${RESET} No safety hooks active — protections are already off"
printf '%b\n' "    ${DIM}Nothing to disable. Use /eck:enable-protections to add safety hooks first.${RESET}"
```

### Outputs

- Protection state determined (active / already off)

### Exit Criteria

- Settings file confirmed and hook state known

## Stage 2: Disable Protections

### Inputs

- Confirmed protection state (hooks active)

### Activities

1. **MUST** run the disable-protections CLI command. Do NOT manually edit settings.json directly:

```bash
npx @evolvconsulting/evolv-coder-kit --disable-protections
```

This handles:

- **Backup exists** (session-scoped enable): restores clean settings from backup
- **No backup** (always-on or manual): removes safety hooks directly

### Outputs

- Safety hooks removed from settings.json
- Backup restored (if session-scoped)

### Exit Criteria

- All safety hooks removed from active settings

## Stage 3: Confirm Sudo Active

### Inputs

- Disable result

### Activities

1. Display sudo confirmation with clear scope messaging

### Output

```bash
source $ECK_HOME/colors.sh

echo ""
printf '%b\n' "${ORANGE}${BOLD}Sudo${RESET}"
echo ""
printf '%b\n' "${GREEN}[x]${RESET} Safety hooks disabled"
printf '%b\n' "${GREEN}[x]${RESET} Session-scoped — no permanent changes"
echo ""
printf '%b\n' "${ORANGE}${BOLD}Sudo Status${RESET}"
echo ""
printf '%b\n' "State: ${YELLOW}Protections off${RESET}"
printf '%b\n' "Scope: This session only"
printf '%b\n' "Restore: /eck:enable-protections"
echo ""
```

### Outputs

- User informed of sudo state

### Exit Criteria

- User understands protections are off for this session only

---

## Error Handling

Follow the `output:error-handler` primitive for error classification, formatting, and recovery guidance.

---

## Safety Notes

- **Human-only**: `disable-model-invocation: true` — only users can invoke `/eck:sudo`, never the AI agent
- **Session-scoped**: Changes do not persist to global preferences or project settings
- **Reversible**: Use `/eck:enable-protections` to re-enable at any time
- **No escalation**: Sudo does not grant additional permissions beyond removing safety hook prompts
- **Idempotent**: Safe to invoke when protections are already off — reports current state
