summaryrefslogtreecommitdiff
path: root/hooks/session-start
diff options
context:
space:
mode:
Diffstat (limited to 'hooks/session-start')
-rwxr-xr-xhooks/session-start8
1 files changed, 6 insertions, 2 deletions
diff --git a/hooks/session-start b/hooks/session-start
index 93a6bc2..083cb23 100755
--- a/hooks/session-start
+++ b/hooks/session-start
@@ -32,14 +32,18 @@ session_context="<EXTREMELY_IMPORTANT>\nYou have superpowers.\n\n**Below is the
# Copilot CLI (v1.0.11+) and others expect additionalContext (top-level, SDK standard).
# Claude Code reads BOTH additional_context and hookSpecificOutput without
# deduplication, so we must emit only the field the current platform consumes.
+# Muse sets MUSE_PLUGIN_ROOT and expects additionalContext (SDK standard).
#
# Uses printf instead of heredoc to work around bash 5.3+ heredoc hang.
# See: https://github.com/obra/superpowers/issues/571
if [ -n "${CURSOR_PLUGIN_ROOT:-}" ]; then
# Cursor sets CURSOR_PLUGIN_ROOT (may also set CLAUDE_PLUGIN_ROOT)
printf '{\n "additional_context": "%s"\n}\n' "$session_context" | cat
-elif [ -n "${CLAUDE_PLUGIN_ROOT:-}" ] && [ -z "${COPILOT_CLI:-}" ]; then
- # Claude Code sets CLAUDE_PLUGIN_ROOT without COPILOT_CLI
+elif [ -n "${CLAUDE_PLUGIN_ROOT:-}" ] && [ -z "${COPILOT_CLI:-}" ] && [ -z "${MUSE_PLUGIN_ROOT:-}" ]; then
+ # Claude Code sets CLAUDE_PLUGIN_ROOT without COPILOT_CLI/MUSE_PLUGIN_ROOT
+ printf '{\n "hookSpecificOutput": {\n "hookEventName": "SessionStart",\n "additionalContext": "%s"\n }\n}\n' "$session_context" | cat
+elif [ -n "${MUSE_PLUGIN_ROOT:-}" ]; then
+ # Muse sets MUSE_PLUGIN_ROOT — try Claude-style nested output for Muse Spark
printf '{\n "hookSpecificOutput": {\n "hookEventName": "SessionStart",\n "additionalContext": "%s"\n }\n}\n' "$session_context" | cat
else
# Copilot CLI (sets COPILOT_CLI=1) or unknown platform — SDK standard format