diff --git a/hooks/memory-loop-activator.sh b/hooks/memory-loop-activator.sh index a079746..888d862 100644 --- a/hooks/memory-loop-activator.sh +++ b/hooks/memory-loop-activator.sh @@ -1,18 +1,10 @@ #!/bin/bash cat << 'EOF' -MANDATORY MEMORY PROTOCOL - -If this starts a new sub-task or phase (tests, refactor, deploy, etc.) -→ search the KB via mcp__memory-loop__query for relevant patterns first. - -If you hit an unexpected error or are about to debug/diagnose -→ search the KB FIRST, before reasoning from scratch. - -If this session produced reusable knowledge, or showed a memory is wrong -or outdated, invoke Skill(continuous-learning) — it routes the change to -the correct destination. Do not ask permission. - -NEVER write to .claude/memories/ directly. Only the continuous-learning -and memory-audit skills write there, so the routing and quality gates run. +Memory: search the KB before a new phase, and on an unexpected error +before diagnosing it from scratch. Run Skill(continuous-learning) when +a cause is found or a decision made, and before your final reply for a +task (fix, refactor, investigation, commit, PR), if it produced reusable +knowledge. Run it as soon as a memory proves wrong, outdated or +incomplete. Never write .claude/memories/ directly. EOF diff --git a/tests/fixtures/hook-messages.json b/tests/fixtures/hook-messages.json index cdd1b74..11402f5 100644 --- a/tests/fixtures/hook-messages.json +++ b/tests/fixtures/hook-messages.json @@ -18,5 +18,5 @@ "additionalContext": "This project keeps a knowledge base of past learnings, decisions, and\ndebugging discoveries in .claude/memories/, searchable with\nmcp__memory-loop__query.\n\n- If your prompt contains a \"KB context:\" block, treat it as established\n ground truth. Verify it against the code, but do NOT search the KB and\n do NOT re-derive it.\n- Otherwise, if you are about to read or grep more than a couple of files,\n issue ONE mcp__memory-loop__query for the topic of your task first — a\n lex line of terms you expect verbatim plus a vec line phrased as a\n question, and an intent saying what you want and what to avoid, with\n rerank:false and limit:6. One search is far cheaper than a blind\n file sweep. Unlike the main thread, do not try keyword variations: if\n nothing relevant comes back, move on to the code.\n- Snippets are leads, not evidence — they are capped at 300 characters and\n often show only a title. mcp__memory-loop__get a document before relying\n on what it says.\n- Report back anything the KB got wrong or left out." } }, - "activator": "MANDATORY MEMORY PROTOCOL\n\nIf this starts a new sub-task or phase (tests, refactor, deploy, etc.)\n→ search the KB via mcp__memory-loop__query for relevant patterns first.\n\nIf you hit an unexpected error or are about to debug/diagnose\n→ search the KB FIRST, before reasoning from scratch.\n\nIf this session produced reusable knowledge, or showed a memory is wrong\nor outdated, invoke Skill(continuous-learning) — it routes the change to\nthe correct destination. Do not ask permission.\n\nNEVER write to .claude/memories/ directly. Only the continuous-learning\nand memory-audit skills write there, so the routing and quality gates run.\n" + "activator": "Memory: search the KB before a new phase, and on an unexpected error\nbefore diagnosing it from scratch. Run Skill(continuous-learning) when\na cause is found or a decision made, and before your final reply for a\ntask (fix, refactor, investigation, commit, PR), if it produced reusable\nknowledge. Run it as soon as a memory proves wrong, outdated or\nincomplete. Never write .claude/memories/ directly.\n" }