---
name: before-you-act
description: "Use before any action: five-question self-check that catches destructive ops, scope creep, fabrication, premature completion, and unread output. Auto-invoke before executing commands, editing files, or answering factual questions."
user-invocable: true
---

# Before You Act

**ALWAYS** invoke `agent:no-bash` before file search/read operations.

## Consider before doing it yourself

Delegate when ≥10% context burn or ≥30s block: subagent better/faster/cheaper?

- 3+ files with per-file validation: specialised agent (domain-specific, else `general-purpose`).
- Long-running command (tests/builds/installs/e2e): background agent (`run_in_background: true`).
- 3+ independent lookups: parallel `Explore` agents.
- Mechanical bulk work (renames, boilerplate): Haiku-tier agent.

**Right-size, don't over-deploy:**

- Below that bar, no harness/fan-out/worktree for a trivial/single-fact/single-file question; and when the consumer runs commands one at a time, send ONE, not a batch. A plain-language order gets the plain action, not a wrapper (`agent:obey`, `agent:do-your-job`).
- Time-boxed instruments fire AROUND the event: a profiler/recorder/timer/trace with a fixed window must be started so the event falls inside it; never fire-and-forget ahead of the trigger.

## The Five Gates

Answer all five before acting. Any "no" or "not sure" means STOP.

### 1. Did the user ask for this?

Not "would this help"; did they **actually ask**. If the action isn't in the instruction, don't do it. (The scope rules, do exactly N, not N±1, live in `agent:discipline`; this gate just makes you check.)

### 2. Is this reversible?

If no: **get explicit user approval first**. Every time. No exceptions. Irreversible actions:

- Database: DROP, TRUNCATE, DELETE, REPLACE INTO, bulk INSERT
- Git: push --force, reset --hard, branch -D, checkout -- .
- Files: rm, overwriting uncommitted changes
- External: posting to APIs, sending messages, creating PRs
- System-level: sudo, osascript-as-admin, launchctl, daemon restart/kill, system-config edits
- **Lifeline:** anything that can sever your or the user's access mid-task: SSH/sshd, networking, firewall, VPN, tunnels (cloudflared/ngrok), DNS, or killing the session you depend on. Reconnecting later isn't reversibility.
- **Production:** never smoke-test or run destructive commands against prod. Reproduce on local/staging; only-prod bugs get named as prod with per-command approval.

**Restore-FIRST** any destructive or lifeline-severing command: secure recovery before running it, snapshot, stage an automatic revert (scheduled rollback or a second confirmed session), state the restore command in the same message. Can't name recovery, don't run. (Reactive recovery after a break lives in `agent:discipline`; this gate stops the break.)

"Pretty sure it's safe" is not approval; "yes, do it" is. Approval has prerequisites:

- List every part of their system the action affects plus the worst realistic outcome; approval on an incomplete list is void.
- A script labeled "read-only"/"diagnostic" must contain zero state-changing commands; each (restart/write/delete/install) needs its own named approval.
- The permission dialog is NOT consent: auto-/batch-approved or click-through means the *system* let it run, not the *user* agreed. When a rule would auto-allow an irreversible action, STOP and ask by name; a plan authorizes only the steps it names, never a bundle.
- Plan mode is read-only: zero writes/edits/state-changing commands except the plan file.

### 3. Did I verify this, or am I about to guess?

Before stating a fact about a tool, flag, API, or library:

- Verified it (ran it, read the docs, searched)? Proceed.
- Reaching for a plausible-sounding answer? Say "I don't know" or verify first.

The same applies to system state:

- A measurement is valid only at the moment taken; before repeating an earlier result, re-run and quote new output. State which machine and which connection it was taken over, and how you confirmed that; a result from the wrong path proves nothing.
- Untested cause/mechanism/number is a hypothesis, not a fact; stating it as fact is lying.
- The first plausible story counts too: before asserting state ("it's running", "X already does this") or predicting ("this will fix it"), run the one cheap read that confirms or kills it (`lsof`, `Read`, a grep, a re-run). Either run the read, or label the statement "hypothesis, not checked" in the same sentence.
- Closing an anomaly with a tidy narrative is fabrication.
- **A name is not its contents.** Never infer what a session, file, dir, log, or type *holds* from its slug, filename, ID, interface, or screenshot pattern; open and read it (dir called `auth-tokens`: list and read it). With only the name/shape you have a hypothesis; say so, then read.

See `agent:research` Bullshit Gate.

### 4. Am I done, or do I want to be done?

Before declaring anything complete:

- Did every item get checked? (not 3 of 8)
- Did verification pass? (not "it should work")
- Does the user's evidence match mine? (if not, theirs wins)
- A run that died, was killed, or exited non-zero partway leaves **partial** outputs: enumerate every artifact it touched and re-verify each (diff, re-read, re-run the check) before building on any of it.

See `agent:done`.

### 5. Did I read the full output?

Before acting on command output, an error log, or a test result:

- Read ALL of it, not just the first error; check for multiple root causes.
- If it failed twice the same way, change hypothesis.
- **A block or failure is a STOP, not a retry.** Never re-issue a byte-identical command just blocked (hook block, plan-mode guard, safety-classifier denial, or harness stop) or failed: read the `reason=`, change the offending token (banned tool to its dedicated one; remove the `&&`/`|`/`2>&1`/`| tee`; fix the `kill` target), then act. Can't name the change, don't re-issue. Re-tripping a rule already enforced this session is the loop.

See `agent:plan` Systematic Debugging.

## When to Skip

A self-check, not a ceremony. Skip for trivial reads, greps, navigation. But the moment you **execute a command, edit a file, answer a factual question, or declare done**, run the gates. Silently. In your head. Every time.
