feat(cursor): add native session-start hooks by kr4chinin · Pull Request #819 · DietrichGebert/ponytail · GitHub
Skip to content

feat(cursor): add native session-start hooks - #819

Open
kr4chinin wants to merge 1 commit into
DietrichGebert:mainfrom
kr4chinin:feat/cursor-native-hooks-817
Open

feat(cursor): add native session-start hooks#819
kr4chinin wants to merge 1 commit into
DietrichGebert:mainfrom
kr4chinin:feat/cursor-native-hooks-817

Conversation

@kr4chinin

@kr4chinin kr4chinin commented Sep 5, 2026

Copy link
Copy Markdown

Refs #817.

Cursor currently offers fixed Ponytail guidance through an always-on rule. This adds a native sessionStart adapter that returns the shared, mode-filtered instructions through Cursor's documented additional_context field. off returns an empty JSON object. It leaves the Claude Code/Codex runtime unchanged.

The project installer merges .cursor/hooks.json, preserves unrelated hooks/settings, and supports an explicit lite, full, ultra, or off startup mode without changing other agents' defaults. Reinstall updates only this checkout's exact command; uninstall removes only that command. Installation refuses the old active .cursor/rules/ponytail.mdc; the migration guide preserves it as a backup outside the rules directory.

Supported scope

  • Mode changes apply to new chats only. Existing conversations retain their initial context; live /ponytail switches and per-prompt reinjection are unsupported.
  • beforeSubmitPrompt and subagentStart have no documented context-injection output. postToolUse.additional_context misses prompts without successful tools and the start of each turn, so it is not used as a partial replacement. No automatic subagent delivery is claimed.
  • Hosted cloud agents do not currently run sessionStart. The docs cover this restriction, other instruction copies that can undermine off, and the lack of an adherence comparison against the static rule.

Validation

  • node --test tests/cursor.test.js — passed. Exercises real adapter processes for all modes, overrides, unsupported events, malformed input, state isolation, installation/update/removal, rule migration, and preservation of unrelated/chained hooks.
  • npm test — passed (root, pi extension, and MCP suites; Node.js 22.14.0 with pandas installed in an isolated Python environment).
  • node scripts/check-rule-copies.js and node scripts/check-versions.js — passed.
  • npm pack --dry-run --json — verified the adapter, template, installer and guide ship.
  • git diff --check — passed.

@kr4chinin
kr4chinin marked this pull request as ready for review September 5, 2026 11:08
Comment thread hooks/ponytail-cursor.js

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

my mom so very MoM.

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.

2 participants