Bug Fixes
Two critical bugs that caused zero memory persistence since v3.0.0:
1. Stop Hook Path Resolution (hooks/stop-hook.cjs)
The stop hook used a hardcoded fallback path (~/.claude/memory) instead of resolving relative to __dirname like all other hooks. This caused a split-brain: insights were written to a shadow directory that no other component reads from. 2329 bytes of real insights were silently lost.
Fix: Use path.dirname(__dirname) (matching session-start.cjs and session-end.cjs).
2. WriteGate Threshold Too Strict (core/write-gate.cjs)
The persistence thresholds (maxScore >= 0.5, totalScore > 1.5) were unreachable for real-world extractions. A pattern like "always add signal handlers" scored only 0.2 total (one keyword match at 0.2 each), resulting in 100% filter rate.
Fix: Lowered to maxScore >= 0.2, totalScore > 0.5. The extraction engine already pre-filters at 0.7 confidence, so the write gate now serves as a lightweight secondary filter.
Impact
Before this fix, Cortex appeared functional but persisted zero memories across sessions. After this fix, both the stop hook (every response) and session-end hook correctly write to the shared data directory.
Upgrade
cd ~/.claude/memory # or your install path
git pull origin masterOr fresh install:
git clone https://github.com/robertogogoni/cortex-claude.git ~/.claude/memory
cd ~/.claude/memory && npm install