Repository navigation
chore(agents): install shelltime hooks for agy and cursor - #22
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. |
| "PostToolUse": [ | ||
| { | ||
| "matcher": "*", | ||
| "hooks": [ |
There was a problem hiding this comment.
Important: the PostToolUse entry uses a different schema from the other four events in this file. SessionStart, PreInvocation, PostInvocation and Stop are flat {type, command, timeout} objects. PostToolUse is nested as {matcher, hooks: [...]}. If agy expects one shape for all events, either PostToolUse or the other four will be silently ignored or rejected, and tool-use tracking (or session and invocation tracking) won't work. Fix: confirm against the agy hooks schema and use one shape for every event, or generate the file from the same template the shelltime installer uses.
| @@ -0,0 +1,44 @@ | |||
| { | |||
| "shelltime": { | |||
There was a problem hiding this comment.
Important: every hook is nested under a custom top-level "shelltime" key, while the Cursor file puts events directly under hooks with a version field. If agy reads events from the top level (or a hooks key), nothing here is ever loaded, and the agy integration does nothing. Fix: verify the file layout agy actually reads, and move the events to that location, or drop the shelltime wrapper.
| "version": 1, | ||
| "hooks": { | ||
| "beforeSubmitPrompt": [ | ||
| { |
There was a problem hiding this comment.
Important: the command can print an empty line on the success path. When shelltime hook-ingest exits 0 with no stdout, out is empty and printf '%s\n' "$out" emits a blank line. The || echo '{...}' fallback only runs on a non-zero exit. Cursor then gets empty output instead of JSON. For beforeSubmitPrompt that means no {"continue":true}, and the prompt may be blocked or the hook reported as failed. The same applies to every hook in .agents/hooks.json (Stop expects {"decision":"allow"}). Fix: fall back when $out is empty, for example [ -n "$out" ] && printf ... || echo '{...}'. Or have the command always end with the default JSON.
| @@ -0,0 +1,40 @@ | |||
| { | |||
There was a problem hiding this comment.
Nit (optional): none of the Cursor hooks sets a timeout, although the agy file uses 15 s for each. If shelltime hook-ingest blocks (for example on a hung daemon socket), beforeSubmitPrompt can stall every prompt until Cursor's default timeout. Fix: add a timeout to each entry. Also, these files are checked into a JetBrains plugin repo and make every contributor's agent session (prompts and tool calls) get sent to the ShellTime daemon. Confirm that is intended, and consider documenting it in CLAUDE.md or the README.
Codecov Report✅ All modified and coverable lines are covered by tests. ❌ Your project status has failed because the head coverage (43.31%) is below the target coverage (60.00%). You can increase the head coverage or adjust the target coverage. @@ Coverage Diff @@
## main #22 +/- ##
=======================================
Coverage 43.31% 43.31%
=======================================
Files 23 23
Lines 972 972
Branches 231 231
=======================================
Hits 421 421
Misses 487 487
Partials 64 64 Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
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.