Skip to content

Commit fab317c

Browse files
authored
Merge pull request #115 from nowledge-co/dev_0610
fix(claude-code-plugin): WSL-aware hook fallbacks for nmem CLI
2 parents d486fc4 + 0b6c11a commit fab317c

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

nowledge-mem-claude-code-plugin/hooks/hooks.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"hooks": [
88
{
99
"type": "command",
10-
"command": "nmem --json wm read 2>/dev/null | python3 -c \"import sys,json;d=json.load(sys.stdin);c=d.get('content','');print(c) if c else sys.exit(1)\" 2>/dev/null || cat ~/ai-now/memory.md 2>/dev/null || true"
10+
"command": "command -v nmem >/dev/null 2>&1 || { command -v nmem.cmd >/dev/null 2>&1 && nmem(){ local q=''; for a in \"$@\"; do q=\"$q \\\"$a\\\"\"; done; cmd.exe /s /c \"\\\"nmem.cmd\\\"$q\"; }; }; nmem --json wm read 2>/dev/null | python3 -c \"import sys,json;d=json.load(sys.stdin);c=d.get('content','');print(c) if c else sys.exit(1)\" 2>/dev/null || cat ~/ai-now/memory.md 2>/dev/null || true"
1111
}
1212
]
1313
},
@@ -16,7 +16,7 @@
1616
"hooks": [
1717
{
1818
"type": "command",
19-
"command": "{ nmem --json wm read 2>/dev/null | python3 -c \"import sys,json;d=json.load(sys.stdin);c=d.get('content','');print(c) if c else sys.exit(1)\" 2>/dev/null || cat ~/ai-now/memory.md 2>/dev/null || true; } && printf '\\n---\\nContext was compacted. If you discovered important insights, save them before continuing:\\n nmem m add \"<insight>\" --title \"<short title>\" --importance 0.8\\n'"
19+
"command": "command -v nmem >/dev/null 2>&1 || { command -v nmem.cmd >/dev/null 2>&1 && nmem(){ local q=''; for a in \"$@\"; do q=\"$q \\\"$a\\\"\"; done; cmd.exe /s /c \"\\\"nmem.cmd\\\"$q\"; }; }; { nmem --json wm read 2>/dev/null | python3 -c \"import sys,json;d=json.load(sys.stdin);c=d.get('content','');print(c) if c else sys.exit(1)\" 2>/dev/null || cat ~/ai-now/memory.md 2>/dev/null || true; } && printf '\\n---\\nContext was compacted. If you discovered important insights, save them before continuing:\\n nmem m add \"<insight>\" --title \"<short title>\" --importance 0.8\\n'"
2020
}
2121
]
2222
}
@@ -26,7 +26,7 @@
2626
"hooks": [
2727
{
2828
"type": "command",
29-
"command": "command -v nmem >/dev/null 2>&1 && printf '[Nowledge Mem] Search past knowledge: nmem --json m search \"query\". Save insights: nmem m add \"content\" -t \"Title\" -i 0.8' || true"
29+
"command": "command -v nmem >/dev/null 2>&1 || { command -v nmem.cmd >/dev/null 2>&1 && nmem(){ local q=''; for a in \"$@\"; do q=\"$q \\\"$a\\\"\"; done; cmd.exe /s /c \"\\\"nmem.cmd\\\"$q\"; }; }; command -v nmem >/dev/null 2>&1 && printf '[Nowledge Mem] Search past knowledge: nmem --json m search \"query\". Save insights: nmem m add \"content\" -t \"Title\" -i 0.8' || true"
3030
}
3131
]
3232
}
@@ -36,7 +36,7 @@
3636
"hooks": [
3737
{
3838
"type": "command",
39-
"command": "nmem t save --from claude-code --truncate 2>/dev/null || true",
39+
"command": "command -v nmem >/dev/null 2>&1 || { command -v nmem.cmd >/dev/null 2>&1 && nmem(){ local q=''; for a in \"$@\"; do q=\"$q \\\"$a\\\"\"; done; cmd.exe /s /c \"\\\"nmem.cmd\\\"$q\"; }; }; nmem t save --from claude-code --truncate 2>/dev/null || true",
4040
"async": true
4141
}
4242
]

0 commit comments

Comments
 (0)