← All features

Install and operateAvailable in v0.3.0

Opt-in hooks

oah offers hooks you install only if you want them: a Claude Code Stop hook that keeps a session from ending while gates are unmet, a session-start hook, a pre-push hook that refuses pushes during a task and scans pushed commits with gitleaks, and post-commit and post-merge hooks that keep the impact map fresh.

When you need it

The riskiest moments — ending a session early, pushing mid-task, pushing a key — happen between commands, where a check at the end of the task comes too late.

How it works

  1. oah init asks about hooks, and oah hooks installs or removes the opt-in Claude Code and git hooks.
  2. oah hooks install stop keeps a Claude Code session from ending while its gates are unmet; [gates] stop_agents limits it to leases held under the names you list.
  3. oah hooks install pre-push refuses a push while any lease, active or stale, is recorded for the worktree (OAH_PUSH_REFUSED), and runs gitleaks over exactly the pushed commits (OAH_PUSH_SECRETS).
  4. Opt-in post-commit and post-merge hooks keep the impact map fresh.
  5. Claude Code also has a session-start hook; in v0.3.0 it keeps the generated oah-<tier> subagent files in step with the current model choice.

Example

Install the Claude Code Stop hook (from Concepts).

oah hooks install stop

Requirements

  • Claude Code for the Stop and session-start hooks; gitleaks for the pre-push scan.

Limits and recovery

  • Without gitleaks, the pre-push hook warns and permits an unscanned push; oah land still refuses without a scan (OAH_LAND_SCAN_REQUIRED).
  • A lease held under a name left off stop_agents no longer stops the session; oah finish still refuses unmet gates.
  • Hooks are opt-in; the shared rules block separately tells agents not to push or force-push.

Original documents

Related