Workflow Patternscritical

Executing With Care

Agents should distinguish reversible from irreversible actions. Local edits, test runs, scratch commits — reversible, can proceed freely. Force-pushes, deleted branches, dropped tables, sent emails — irreversible, require explicit confirmation.

Memory anchor

Executing with care is a surgeon's checklist — verify the patient, verify the side, verify the procedure, then cut. Cheap to check, expensive to reverse.

Expected depth

Risk axes: reversibility (can I undo this?), blast radius (who else is affected?), authorization (was this requested?). Common irreversible operations: rm -rf, git push --force, kubectl delete, DROP TABLE, git reset --hard, git branch -D, anything sent to external systems (Slack, email, GitHub PR comments). Default behavior: announce before executing, ask for confirmation. User can pre-authorize via settings.json allowlists or one-time approval, but authorization for action X doesn't mean authorization for action Y.

Deep — senior internals

The cost-of-confirmation is low (a few seconds), the cost-of-wrong-action is high (lost work, accidental message, broken main branch). Hooks are the enforcement layer — PreToolUse hooks for git push --force, kubectl delete, etc. Investigate before deleting: unfamiliar files or branches may be the user's in-progress work. Resolve merge conflicts rather than discarding. If a lock file exists, find what owns it before removing. Authorization scope: 'allow npm install' is not 'allow npm publish.' Match scope of action to scope of permission.

🎤Interview-ready answer

I treat actions on two axes: reversibility and blast radius. Local edits, scratch commits, test runs — reversible, low blast — proceed freely. Force-pushes, DB drops, sent messages, deleted branches — irreversible — confirm first. The cost of asking is low, the cost of an accidental destructive action is high. PreToolUse hooks are my enforcement layer for the truly dangerous commands. Authorization scope matters: approval to push a feature branch is not approval to push to main; approval to delete a branch is not approval to delete the repo.

Common trap

Approving an action once and assuming it's authorized for the rest of the session. Each destructive action is its own decision unless the user durably authorized the broader scope (e.g., in CLAUDE.md or settings.json).