Skip to content

Commit fead4df

Browse files
authored
fix(hook): align SessionStart registration with memsearch pattern (#7)
1 parent 2289338 commit fead4df

4 files changed

Lines changed: 7 additions & 13 deletions

File tree

.claude-plugin/marketplace.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "passthru",
3-
"version": "0.2.2",
3+
"version": "0.2.3",
44
"description": "Regex-based permission rules for Claude Code via hooks",
55
"owner": {
66
"name": "nnemirovsky"

.claude-plugin/plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "passthru",
3-
"version": "0.2.2",
3+
"version": "0.2.3",
44
"description": "Regex-based permission rules for Claude Code via hooks",
55
"license": "MIT"
66
}

hooks/hooks.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,10 @@
2727
],
2828
"SessionStart": [
2929
{
30-
"matcher": "startup",
3130
"hooks": [
3231
{
3332
"type": "command",
34-
"command": "${CLAUDE_PLUGIN_ROOT}/hooks/handlers/session-start.sh",
33+
"command": "bash ${CLAUDE_PLUGIN_ROOT}/hooks/handlers/session-start.sh",
3534
"timeout": 5
3635
}
3736
]

tests/plugin_loads.bats

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -137,17 +137,12 @@ setup() {
137137
[ "$output" = "1" ]
138138
}
139139

140-
@test "hooks/hooks.json SessionStart matcher is startup" {
141-
# Restricts the one-time hint to brand-new sessions. Resume/clear/compact
142-
# must not re-fire it.
143-
run jq -r '.hooks.SessionStart[0].matcher' "$REPO_ROOT/hooks/hooks.json"
144-
[ "$status" -eq 0 ]
145-
[ "$output" = "startup" ]
146-
}
147-
148-
@test "hooks/hooks.json SessionStart command uses CLAUDE_PLUGIN_ROOT" {
140+
@test "hooks/hooks.json SessionStart command uses bash prefix and CLAUDE_PLUGIN_ROOT" {
141+
# Matches memsearch's known-working pattern: `bash ${CLAUDE_PLUGIN_ROOT}/...`.
142+
# The bash prefix avoids executable-bit / shebang edge cases on some hosts.
149143
run jq -r '.hooks.SessionStart[0].hooks[0].command' "$REPO_ROOT/hooks/hooks.json"
150144
[ "$status" -eq 0 ]
145+
[[ "$output" == bash\ * ]]
151146
[[ "$output" == *'${CLAUDE_PLUGIN_ROOT}'* ]]
152147
[[ "$output" == *'session-start.sh' ]]
153148
}

0 commit comments

Comments
 (0)