Skip to content

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

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 eac805d into main Nov 27, 2026
1 check passed
@AnnatarHe
AnnatarHe deleted the chore/install-shelltime-hooks branch November 27, 2026 17:12
@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:13:45.300058Z 1549b11 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
"shelltime": {
"SessionStart": [
{
"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 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.

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 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.

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): 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.

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