028. The agy hooks and files of a turn
- Date
- 2026-10-30
- Agents
- Antigravity CLI
- Measured on
- real machine
Measured
2026-10-30, Antigravity CLI (agy) 1.4.7, on Linux (Debian 13, x64), in a
private tmux server with a throwaway HOME and a copied login. The
scenario scenarios/agy/turn-signals.sh set a hook for each of the six
events in ~/.gemini/config/hooks.json, and recorded at each step the
screen, the open files of the process, and the record types of the
transcript. It read no content.
Measured on: real machine.
What was measured
-
agy 1.4.7 knows six hook events:
SessionStart,PreInvocation,PostInvocation,PreToolUse,PostToolUseandStop. The file has one object for each hook group:{"<group>": {"<event>": [{"type": "command", "command": "...", "timeout": 10}]}}. -
The hooks fired in this order:
Step Hooks The process starts none The first prompt SessionStart, thenPreInvocationA file dialog opens ("Allow creation of this file?") none Esc on the dialog none The next prompt PreInvocationThe turn ends PostInvocation, thenStopPreToolUseandPostToolUsedid not fire for the file write, with the hook shape of item 1. -
Each payload has
conversationId,transcriptPath,artifactDirectoryPath,workspacePaths,lastUserInputandmodelName.PreInvocationandPostInvocationaddinvocationNumandinitialNumSteps.StopaddsexecutionNum,fullyIdle(true),terminationReason(NO_TOOL_CALL) anderror(empty). The hook process hasANTIGRAVITY_CONVERSATION_IDin its environment. -
From the first prompt until the process exits, the process holds these files open:
~/.gemini/antigravity-cli/conversations/<conversation id>.db, with its-waland-shmfiles.~/.gemini/antigravity-cli/presence/<conversation id>.lock. Before the first prompt it holds neither file.
-
The transcript is
~/.gemini/antigravity-cli/brain/<conversation id>/.system_generated/logs/transcript.jsonl. Each turn added aUSER_INPUTrecord and aPLANNER_RESPONSErecord. Esc on the dialog added no record. -
A new install shows a wizard: a colour page, then a terms page. The terms page has a box, checked by default, that agrees to the collection of interaction data. The scenario clears it. Down, then Right, selects "Done".
Mechanism
A reader can link a process to its conversation with no screen: the
conversation ID is in the names of the open presence and conversations
files. PreInvocation shows the start of a turn, and PostInvocation or
Stop shows its end.
An Esc gives no hook and no transcript record. A reader that waits for
Stop after an Esc waits for ever. Only the screen shows the end of that
turn.
Incident
tg-bridge has only screen rules for agy. agy 1.4.7 --continue in an
empty folder draws an empty box that looks idle.
Screens
None.
Not measured
- A hook shape with a
matcherforPreToolUseandPostToolUse. - "2. No, deny creation" instead of Esc.
- Whether the
presencelock is an advisory lock (flock) that a reader can test. --continueand--conversation <id>.- macOS and Windows.
Later measurement (2026-10-30, agy 1.4.7)
The scenarios scenarios/agy/deny-and-tools.sh and
scenarios/agy/continue.sh measured four items of "Not measured" above.
The items above stay as they were measured.
PreToolUseandPostToolUsefire when each handler list is in a group with amatcher:{"<group>": {"PreToolUse": [{"matcher": "*", "hooks": [{"type": "command", "command": "...", "timeout": 10}]}]}}. Item 2 above used the flat shape, which agy does not read for these two events. See fact 42.- "2. No, deny creation" fires no hook after
PreToolUse, as an Esc. It adds aGENERICrecord withstatusERRORto the transcript. See fact 41. - The
presencefile is aflocklock, held while the process runs. See fact 44. --continueand--conversation <id>reuse thepresenceandconversationsfiles of the conversation, and open them at the start, before the first prompt. This changes item 4 above for such a process.SessionStartdoes not fire again. See fact 43.conversation_summaries.dbshows a running turn and the end of a turn, also after an Esc. See fact 45.