Skip to content

Hooks

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.

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

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.

EventTimeout
Notificationagent default
PermissionRequest660 s
SessionEndagent default
SessionStartagent default
Stopagent default

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.

EventTimeout
PermissionRequest3 s

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.

EventTimeout
agentStop3 s
errorOccurred3 s
notification3 s
postToolUse3 s
postToolUseFailure3 s
sessionEnd3 s
sessionStart3 s
subagentStart3 s
subagentStop3 s
userPromptSubmitted3 s

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