You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 7f27b41
Browse filesBrowse the repository at this point in the historyBrowse files
fix(hooks): inject only the session's project and global memories (#604)
session_start and auto_recall queried memories with no project
predicate, so a session under one project received the hot and
protected memories of every project the store held. The PostgreSQL
recall function already scoped by directory_context; the two hooks
bypassed that column entirely.
Both hooks now apply one rule, shared across the PostgreSQL and
SQLite paths (mcp_server/shared/project_scope.py, ADR-1080): a memory
injects when it is global, or its directory_context is the session's
project root or an ancestor of it. An empty directory_context is not
a wildcard. The project root comes from CLAUDE_PROJECT_ROOT or the
hook event's cwd; when neither resolves, the hook logs it and
restricts injection to global memories, never everything. Team
decisions stay global by design and are unaffected. The recall tool
is untouched.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Cz7A6goxVzfKL9NT7k4zDH
<!-- Generated by Cortex wiki_reindex from wiki/adr/cortex/1080-inject-only-the-sessions-project-and-global-memories-in-session-hooks.md; ADR-1080. Read-only mirror: edit the canonical wiki page. -->
"project root unresolved (no CLAUDE_PROJECT_ROOT, no event cwd), "
267
+
"restricting to global memories"
268
+
)
247
269
try:
248
270
frommcp_server.infrastructure.memory_storeimportget_shared_store# noqa: PLC0415 — hook latency boundary: the per-event hook process defers the handler/store stack (hook boot ~0.05 s vs ~0.6 s registry import, measured 2026-07-28)
"project root unresolved (no CLAUDE_PROJECT_ROOT, no event cwd), "
1114
+
"restricting to global memories"
1115
+
)
1085
1116
try:
1086
1117
frommcp_server.infrastructure.memory_storeimportget_shared_store# noqa: PLC0415 — hook latency boundary: the per-event hook process defers the handler/store stack (hook boot ~0.05 s vs ~0.6 s registry import, measured 2026-07-28)
0 commit comments