Skip to content

chore(agents): install shelltime hooks for agy and cursor - #20

Merged
AnnatarHe merged 1 commit into
mainfrom
chore/install-shelltime-hooks
Nov 27, 2026
Merged

AnnatarHe merged 1 commit into
mainfrom
chore/install-shelltime-hooks

Conversation

@AnnatarHe

@AnnatarHe AnnatarHe commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

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-bot with what you need.

Install project-level ShellTime tracking hooks for Antigravity (.agents/hooks.json) and Cursor (.cursor/hooks.json).
@AnnatarHe
AnnatarHe merged commit ca8090e into main Nov 27, 2026
@AnnatarHe
AnnatarHe deleted the chore/install-shelltime-hooks branch November 27, 2026 17:13
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-27T17:14:59.827159Z 66485b3 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Comment thread .agents/hooks.json
],
"PreInvocation": [
{
"type": "command",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread .cursor/hooks.json
"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}'"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread .cursor/hooks.json
@@ -0,0 +1,40 @@
{

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant