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.
driga hooks install --dry-run # preview every adapterdriga hooks install claude # or codex, copilot, alldriga hooks statusdriga hooks uninstallClaude Code
Section titled “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 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
Section titled “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
Section titled “Gemini CLI”Driga installs no Gemini hooks. Gemini sessions are read from their chat transcripts.