---
title: "Hooks"
summary: "The hook events driga installs per agent and their timeouts, generated by running each installer in dry-run mode."
description: "Which agent hook events `driga hooks install` writes for Claude Code, Codex and Copilot, with timeouts."
generated: true
read_when:
  - "You want to know exactly what `driga hooks install` adds to an agent's configuration."
  - "You are reviewing a hooks diff before accepting it."
---

Hooks are optional. Without them Driga still reads session files and the
process table; hooks add lifecycle and attention events, Claude prompt
answering and Copilot session state. Every install shows a unified diff and asks before
writing, backs up edited files to `*.driga-bak-<timestamp>`, and uninstall
removes only Driga's own entries. A hook always exits successfully and
prints nothing, so a failing hook never blocks the agent.

Each hook runs `driga hook <adapter> <event>`. The tables below are produced
by running each installer against an empty configuration, so they list what
the installer writes.

```sh
driga hooks install --dry-run   # preview every adapter
driga hooks install claude      # or codex, copilot, all
driga hooks status
driga hooks uninstall
```

## Claude Code

`PermissionRequest` lets Driga answer permission prompts; its long timeout keeps the prompt open while you decide. The other events record lifecycle and attention.

Written to `~/.claude/settings.json` (or under `CLAUDE_CONFIG_DIR`), appended beside existing hooks.

| Event | Timeout |
|---|---|
| `Notification` | agent default |
| `PermissionRequest` | 660 s |
| `SessionEnd` | agent default |
| `SessionStart` | agent default |
| `Stop` | agent default |

## Codex

Codex reports permission requests to Driga. Driga does not answer Codex prompts.

Written to a marked block in `~/.codex/config.toml` (or `$CODEX_HOME/config.toml`), preserving comments and existing `notify` settings.

| Event | Timeout |
|---|---|
| `PermissionRequest` | 3 s |

## GitHub Copilot CLI

Copilot session state comes only from hooks and the process table. Restart running Copilot sessions after installing or removing hooks.

Written to Driga's own file, `~/.copilot/hooks/driga.json` (or under `COPILOT_HOME`); uninstall deletes only that file.

| Event | Timeout |
|---|---|
| `agentStop` | 3 s |
| `errorOccurred` | 3 s |
| `notification` | 3 s |
| `postToolUse` | 3 s |
| `postToolUseFailure` | 3 s |
| `sessionEnd` | 3 s |
| `sessionStart` | 3 s |
| `subagentStart` | 3 s |
| `subagentStop` | 3 s |
| `userPromptSubmitted` | 3 s |

## Gemini CLI

Driga installs no Gemini hooks. Gemini sessions are read from their chat
transcripts.