Repository navigation
chore(agents): install shelltime hooks for agy and cursor - #19
Conversation
Install project-level ShellTime tracking hooks for Antigravity (.agents/hooks.json) and Cursor (.cursor/hooks.json).
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
| "shelltime": { | ||
| "SessionStart": [ | ||
| { | ||
| "type": "command", |
There was a problem hiding this comment.
Important: The agy hook entries use two different shapes. SessionStart, PreInvocation, PostInvocation and Stop are flat {type, command, timeout} objects. PostToolUse is a {matcher, hooks: [...]} group. A given agy version most likely accepts only one of these per event, so some of these hooks could be skipped or rejected. Session and invocation telemetry would then be lost without any error, because the config only loads silently. Fix: check the shape against the agy hooks schema or the shelltime installer output. If the installer really emits both, add a comment or test saying so. Otherwise use one shape throughout.
| "hooks": { | ||
| "beforeSubmitPrompt": [ | ||
| { | ||
| "command": "PATH=${PATH:+$PATH:}$HOME/.shelltime/bin:/opt/homebrew/bin:/usr/local/bin; command -v shelltime >/dev/null 2>&1 && command -v shelltime-daemon >/dev/null 2>&1 && out=$(shelltime hook-ingest --agent cursor --event beforeSubmitPrompt --project) && printf '%s\\n' \"$out\" || echo '{\"continue\":true}'" |
There was a problem hiding this comment.
Nit (optional): The Cursor hooks have no timeout, but the agy hooks use "timeout": 15. beforeSubmitPrompt runs synchronously before every prompt. If shelltime hook-ingest hangs, for example on a stuck shelltime-daemon socket, Cursor could wait on it with no limit. Fix: add a timeout to each Cursor hook, or confirm that Cursor's default is acceptable.
| "hooks": { | ||
| "beforeSubmitPrompt": [ | ||
| { | ||
| "command": "PATH=${PATH:+$PATH:}$HOME/.shelltime/bin:/opt/homebrew/bin:/usr/local/bin; command -v shelltime >/dev/null 2>&1 && command -v shelltime-daemon >/dev/null 2>&1 && out=$(shelltime hook-ingest --agent cursor --event beforeSubmitPrompt --project) && printf '%s\\n' \"$out\" || echo '{\"continue\":true}'" |
There was a problem hiding this comment.
Nit (optional): This hook, and the matching ones in .agents/hooks.json, runs a shell command for every contributor who opens the repo in Cursor or agy. If shelltime is installed, it sends project-scoped session data (--project) to that tool. Committing this as project config opts everyone in. The pattern cmd && printf "$out" || echo '{}' also hides any hook-ingest failure, because a non-zero exit falls back to the default JSON. Fix: confirm that opt-in-by-commit is intended. Consider keeping these files in per-user config, or note them in the README.
Install project-level ShellTime tracking hooks for Antigravity (
.agents/hooks.json) and Cursor (.cursor/hooks.json).Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.