---
name: eck:disable-protections
version: "0.7.4"
description: Remove safety hooks from settings.json (restores from backup if session-scoped, removes directly if permanent)
disable-model-invocation: true
---

# Disable Protections

Remove safety hooks (protect-files, detect-secrets, hitl-approval, security-gate) from the project's `.claude/settings.json`. If protections were session-scoped (backup exists), restores clean settings from backup. If permanent or manually added, removes hooks directly.

---

## 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 clean bold header. 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 Blocks

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: Verify Project Context | Verifying project context | Verify (1/3)  |
| 2     | Stage 2: Disable Protections    | Disabling protections     | Disable (2/3) |
| 3     | Stage 3: Confirm Results        | Confirming results        | Confirm (3/3) |

## Usage

```bash
/eck:disable-protections                  # Remove safety hooks
/eck:disable-protections --dry-run        # Preview what would change
```

---

## Stage 1: Verify Project Context

### Inputs

- Current working directory
- `.claude/settings.json` (must exist)

### Activities

Confirm we are in a project directory with `.claude/settings.json`:

```bash
ls .claude/settings.json
```

**If 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}"
```

### Outputs

- Confirmation that `.claude/settings.json` exists

### Exit Criteria

- `.claude/settings.json` is found, or error is displayed and skill stops

## Stage 2: Disable Protections

### Inputs

- `$ECK_HOME/global-state.json`
- `.claude/settings.json` and any backup file

### Activities

Run the CLI command:

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

The command handles two paths automatically:

- **Backup exists** (session-scoped enable): restores clean settings from backup, cleans up backup and restore hook
- **No backup** (always-on or manual): walks settings and removes safety hooks directly
- **No hooks found + no backup**: reports success (this is the expected default state)

### Outputs

- `global-state.json` updated with `protectionsEnabled: false`
- `.claude/settings.json` restored from backup or safety hooks removed directly

### Exit Criteria

- Protection state is disabled and settings file reflects the change

## Stage 3: Confirm Results

### Inputs

- Result from Stage 2 (restore path or direct removal)

### Activities

Report to the user:

- Whether settings were restored from backup or hooks were removed directly
- That safety hooks are no longer active
- That protections are off by default — no action needed to keep them off
- They can re-enable anytime with `/eck:enable-protections`

### Outputs

```bash
source $ECK_HOME/colors.sh

echo ""
printf '%b\n' "${ORANGE}${BOLD}Disable Protections${RESET}"
echo ""
printf '%b\n' "${GREEN}[x]${RESET} Settings verified"
printf '%b\n' "${GREEN}[x]${RESET} Safety hooks removed"
echo ""
printf '%b\n' "State: ${YELLOW}Disabled${RESET}"
printf '%b\n' "Method: {restore/direct}"
printf '%b\n' "Re-enable: /eck:enable-protections"
echo ""
```

### Exit Criteria

- Confirmation summary displayed to user
- Statusline reset

---

## Error Handling

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

---

## Safety Notes

- **Off by default**: New projects do not include safety hooks — this command is mainly for undoing `/eck:enable-protections`
- **Selective**: Only safety hooks are removed — observability, learning, and quality hooks remain active
- **Safety hooks**: `protect-files.sh`, `detect-secrets.sh`, `hitl-approval.sh`, `security-gate.sh`
