Skip to content

Commit 2dec87d

Browse files
authored
fix: extend git-root collection fix to codex/opencode skills; async session-end (#331)
The git-root collection mismatch fixed in #330 for the Claude Code plugin also affects the Codex and OpenCode plugins — their memory-recall skills call derive-collection.sh without arguments (defaults to pwd) while the hook/install scripts use the git repo root. Mirror the same fix so all three plugins converge on the same collection regardless of launch directory. Also mark SessionEnd async in the Claude Code hooks.json: the hook only performs watch-process cleanup (stop_watch + orphan sweep), which the user does not need to wait for. This removes up to a few hundred milliseconds of perceived exit latency without changing behavior. Signed-off-by: Cheney Zhang <chen.zhang@zilliz.com>
1 parent ae26835 commit 2dec87d

3 files changed

Lines changed: 3 additions & 2 deletions

File tree

plugins/claude-code/hooks/hooks.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
{
4242
"type": "command",
4343
"command": "bash ${CLAUDE_PLUGIN_ROOT}/hooks/session-end.sh",
44+
"async": true,
4445
"timeout": 10
4546
}
4647
]

plugins/codex/skills/memory-recall/SKILL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ You are performing memory retrieval for memsearch. Search past memories and retu
99

1010
Determine the collection name by running:
1111
```
12-
bash __INSTALL_DIR__/scripts/derive-collection.sh
12+
bash -c 'root=$(git rev-parse --show-toplevel 2>/dev/null || true); if [ -n "$root" ]; then bash __INSTALL_DIR__/scripts/derive-collection.sh "$root"; else bash __INSTALL_DIR__/scripts/derive-collection.sh; fi'
1313
```
1414

1515
## Steps

plugins/opencode/skills/memory-recall/SKILL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ You are a memory retrieval agent for memsearch. Your job is to search past memor
88

99
## Project Collection
1010

11-
Collection: !`bash __INSTALL_DIR__/scripts/derive-collection.sh`
11+
Collection: !`bash -c 'root=$(git rev-parse --show-toplevel 2>/dev/null || true); if [ -n "$root" ]; then bash __INSTALL_DIR__/scripts/derive-collection.sh "$root"; else bash __INSTALL_DIR__/scripts/derive-collection.sh; fi'`
1212

1313
## Your Task
1414

0 commit comments

Comments
 (0)