Concepts
Emergency disable
When a hook blocks work that genuinely must proceed, what is the recovery — and what does it cost? One confirmed, operator-owned action that bypasses every Tama-managed dispatcher on the machine, records exactly what it moved, and stays visible until a verified re-enable restores everything. It is deliberately the only way to weaken policy: sessions can enable, only operators can disable, and only globally (enforcement-control).
#What it is
emergency_disable_hooks, a bundled POSIX script the desktop runs from
Posture and re-runs with TAMA_EMERGENCY_ACTION=enable for re-enable
(scripts). Disable, in order:
- pauses every supervised session
(
agent-session-supervisor.py control pause --require-all); an exit trap resumes them after success, failure, or interruption; - reinstalls the session controllers
(
tama hooks install-release --session-control-only) so session visibility survives the bypass; - backs up
~/.claude/settings.jsonand~/.codex/hooks.jsonintoemergency-backup/and empties theirhooksmaps; - moves entrypoints aside to
<name>.tama-disabled: the OMP agent hooks directory and every Git hook source the installed registry declares; - stops the editor watcher (the
~/.shared-hooks/editor-hooks.pidprocess, then thecom.wisent.editor-hooks.plistLaunchAgent); - writes
emergency-backup/manifest.jsononce andhook-emergency-state.json(ai.wisent.tama.hook-emergency-state.v1,disabled: true,changedAt).
Success prints Disabled hooks. Supervised agent sessions will resume without an editor restart.; repeating it prints Tama hooks are already disabled. and changes nothing.
#What it costs
The desktop's confirmation states the price before the button exists —
title Disable every Tama hook on this machine, then verbatim:
Agent, editor and Git dispatchers will bypass all <N> policies until the approved release is verified and reinstalled.<N> blocking hooks will stop refusing unsafe work, including in sessions that are running right now.Supervised sessions keep running. Their per-session overrides survive, and Tama restores them when the release is reinstalled.
with reason code hook-emergency-state.v1 disabled=true, the full listing
of blocking hook ids, the footnote recovery files are preserved under Application Support/Tama/emergency-backup, and three actions: Read the blocking decision (jumps to Session),
destructive Disable all hooks, primary Keep policy active.
#How state is judged
Tama treats the machine as disabled only when both the manifest and the
state file exist, and it re-reads that durable state after the script
returns — Tama could not persist the emergency hook state. is a failure,
never claimed success. A machine-wide hook selection remains recorded, but
the emergency bypass takes precedence: none of its selected ids run until
re-enable succeeds. During the bypass, only a session's generation-bound
enabledHookIds allowlist can run
(session-enable).
#Re-enable
Enable refuses without evidence: no manifest answers Tama has no emergency backup manifest to restore., and the bundled release must pass its
seal gates. It performs the full transactional installation with
--emergency-manifest — restoring every moved entrypoint, regenerating
provider configs from the backups, re-bootstrapping the editor LaunchAgent —
and only then removes the emergency state and manifest, printing Enabled approved hook release <first-12>. Supervised agent sessions will resume without an editor restart. A failed enable preserves the recovery evidence. After successful re-enable, the retained all-hooks or selected-hooks machine policy resumes.
#Where it lives
| Path | Content |
|---|---|
~/Library/Application Support/Tama/hook-emergency-state.json | The durable disabled flag |
~/Library/Application Support/Tama/hook-enforcement.json | The independent all-hooks or selected-hooks baseline; retained while emergency state takes precedence |
~/Library/Application Support/Tama/emergency-backup/manifest.json | configs emptied, moved entrypoint pairs, editorWatcherStopped — written once |
~/Library/Application Support/Tama/emergency-backup/claude-settings.json, codex-hooks.json | Original provider configs, restored on enable |
The desktop wrapper (HookEmergencySwitch) waits for the script's own exit and for its
output to close, and reports the script's exit status and what it printed; output beyond
64 KiB is refused rather than cut. Its own failures
(The local policy command exceeded Tama's bounded output limit. Inspect local policy state before retrying., The Tama bundle does not contain the emergency hook controller., …) are listed in the
runbook.
#Not to be confused with
- Deactivate. Settings → Deactivate everything runs this same global disable and then unregisters the privileged daemon, System Extension, and network filter independently (desktop/settings). Emergency disable alone leaves the privileged backend registered.
- A per-session disable. Does not exist, anywhere in the product (core-contracts).
- Uninstalling. The bypass moves entrypoints aside and empties config maps; every byte needed to restore enforcement stays on disk, deliberately (operations).