{{ message }}
feat(cursor): add native session-start hooks - #819
Open
kr4chinin wants to merge 1 commit into
Open
Conversation
kr4chinin
marked this pull request as ready for review
September 5, 2026 11:08
bankasimo-tech
approved these changes
Sep 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Refs #817.
Cursor currently offers fixed Ponytail guidance through an always-on rule. This adds a native
sessionStartadapter that returns the shared, mode-filtered instructions through Cursor's documentedadditional_contextfield.offreturns 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 explicitlite,full,ultra, oroffstartup 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
/ponytailswitches and per-prompt reinjection are unsupported.beforeSubmitPromptandsubagentStarthave no documented context-injection output.postToolUse.additional_contextmisses 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.sessionStart. The docs cover this restriction, other instruction copies that can undermineoff, 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.jsandnode scripts/check-versions.js— passed.npm pack --dry-run --json— verified the adapter, template, installer and guide ship.git diff --check— passed.