Repository navigation
chore(agents): install shelltime hooks for agy and cursor - #20
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. |
| ], | ||
| "PreInvocation": [ | ||
| { | ||
| "type": "command", |
There was a problem hiding this comment.
Important: the hook shapes in this file are inconsistent. SessionStart, PreInvocation, PostInvocation and Stop are flat {type, command, timeout} entries. PostToolUse alone uses the nested {matcher, hooks:[...]} form, and everything sits under a custom top-level "shelltime" key. If the agy loader accepts only one shape, or doesn't read the "shelltime" namespace, some or all of these hooks are silently ignored and nothing is tracked. Fix: check the file against the agy hooks schema and the CLI's installer output, and use one entry shape per event type.
| "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 cmd1 && cmd2 && out=$(hook-ingest) && printf '%s\n' "$out" || echo '{"continue":true}' pattern only falls back to the default when hook-ingest exits non-zero. If it exits 0 with empty stdout, printf emits a blank line and the fallback is skipped. Cursor's beforeSubmitPrompt then gets no {"continue":true} JSON. Fix: print the fallback when $out is empty, for example [ -n "$out" ] && printf ... || echo .... The same applies to every hook in .agents/hooks.json.
| @@ -0,0 +1,40 @@ | |||
| { | |||
There was a problem hiding this comment.
Nit (optional): these are per-user, generated installs of the agent hooks (twelve copies of the same long one-liner), committed to the installer repo. Every contributor who has shelltime installed and opens this repo in Cursor or agy will ship their session events (--project) to shelltime. The Cursor hooks also have no timeout, unlike the agy file's 15s, so a hung hook-ingest can stall the agent. Fix: confirm that committing them is intended, or move the files to .gitignore or user-level config. Add a timeout if Cursor supports one, and add the new files to the Repository Structure section in CLAUDE.md.
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.