hookslisted
Install: claude install-skill stxrmik/antigravity-plus
# /hooks — automation for this project
> **Only on the user's request, or under full access:** it changes the project's configuration.
Antigravity runs hooks from `.agents/hooks.json` at the project root (and from plugins). A hook is a command that
gets a JSON payload on stdin and prints a JSON answer on stdout. The command runs via `sh -c` from the folder that
holds `hooks.json`.
## Events and answers
| Event | When | Answer (stdout) |
|---|---|---|
| `PreToolUse` (with `matcher`: tool name regex, e.g. `run_command`, `write_file\|edit_file`) | before a tool runs; payload has `toolCall {name, args}` (`args.Path`, `args.CommandLine`) | `{"decision": "allow"}` = no objection; `"deny"` + `"reason"` blocks (the agent sees the reason); `"ask"` / `"force_ask"` asks the user |
| `PostToolUse` (with `matcher`) | after a tool ran; payload adds `error` | `{}` |
| `PreInvocation` | before every model call | `{"injectSteps": [{"ephemeralMessage": "…"}]}` or `{}` |
| `Stop` | the agent ends its turn; payload has `terminationReason` (`NO_TOOL_CALL` = normal), `fullyIdle`, `executionNum` | `{"decision": "continue", "reason": "…"}` sends it back to work; `{}` lets it stop |
| `SessionStart` | a conversation starts | `{"injectSteps": [{"systemMessage": {"systemMessage": "…"}}]}` |
Every payload also has `conversationId`, `workspacePaths`, `transcriptPath`, `lastUserInput`.
**Pitfall:** for `PreToolUse`, an empty `{}` means **deny**. A hook that should only watch must print
`{"decision": "