summaryrefslogtreecommitdiff
path: root/hooks
diff options
context:
space:
mode:
authorericzakariasson <eric@anysphere.co>2026-02-13 12:00:52 -0500
committerDrew Ritter <drew@ritter.dev>2026-02-17 11:42:34 -0800
commit772ec9f8342ea8f356ff99e469e6b11dd803edb4 (patch)
tree99459f0813d3100528dd6df017dfb920772dbf34 /hooks
parente16d611eee14ac4c3253b4bf4c55a98d905c2e64 (diff)
Add Cursor plugin manifest and hook response compatibility
Enable native Cursor plugin discovery with a .cursor-plugin manifest, and make the SessionStart hook emit both Cursor and Claude response shapes so context injection works across both platforms. Document Cursor install usage in the README while keeping Claude-first wording. Co-authored-by: Cursor <cursoragent@cursor.com>
Diffstat (limited to 'hooks')
-rwxr-xr-xhooks/session-start.sh9
1 files changed, 7 insertions, 2 deletions
diff --git a/hooks/session-start.sh b/hooks/session-start.sh
index 8c029af..0eba96b 100755
--- a/hooks/session-start.sh
+++ b/hooks/session-start.sh
@@ -32,13 +32,18 @@ escape_for_json() {
using_superpowers_escaped=$(escape_for_json "$using_superpowers_content")
warning_escaped=$(escape_for_json "$warning_message")
+session_context="<EXTREMELY_IMPORTANT>\nYou have superpowers.\n\n**Below is the full content of your 'superpowers:using-superpowers' skill - your introduction to using skills. For all other skills, use the 'Skill' tool:**\n\n${using_superpowers_escaped}\n\n${warning_escaped}\n</EXTREMELY_IMPORTANT>"
-# Output context injection as JSON
+# Output context injection as JSON.
+# Keep both shapes for compatibility:
+# - Cursor hooks expect additional_context.
+# - Claude hooks expect hookSpecificOutput.additionalContext.
cat <<EOF
{
+ "additional_context": "${session_context}",
"hookSpecificOutput": {
"hookEventName": "SessionStart",
- "additionalContext": "<EXTREMELY_IMPORTANT>\nYou have superpowers.\n\n**Below is the full content of your 'superpowers:using-superpowers' skill - your introduction to using skills. For all other skills, use the 'Skill' tool:**\n\n${using_superpowers_escaped}\n\n${warning_escaped}\n</EXTREMELY_IMPORTANT>"
+ "additionalContext": "${session_context}"
}
}
EOF