feat: add cross-session memory via MCP memory server#58
feat: add cross-session memory via MCP memory server#58DavidROliverBA wants to merge 1 commit intotractorjuice:mainfrom
Conversation
Add @modelcontextprotocol/server-memory integration for persisting project decisions, vendor insights, review outcomes, and session summaries across Claude Code sessions. Entities are stored in .arckit/memory.jsonl within the project directory. - Add memory MCP server to plugin .mcp.json (stdio, project-local storage) - Create session-learner.sh hook (Notification/Stop) that analyses recent git commits, detects artifact types, classifies session type, and writes JSON manifests for the next session to process - Enhance arckit-session.sh to read pending memory manifests on start and surface them as context instructing Claude to call create_entities and search_nodes - Auto-allow mcp__memory__* tools in allow-mcp-tools.sh - Add cross-session-memory.md guide with entity types, design principles, session classification, and troubleshooting - Update CHANGELOG.md with [Unreleased] section Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
PR #58 Review: Cross-Session Memory via MCP Memory Server+537 / -6 across 7 files SummaryAdds a two-stage cross-session memory system:
Well-conceived feature with solid documentation. However, there are several critical issues that need addressing before merge. Critical Issues1. Stale base branch — will regress security hooks The PR was branched before the security hooks were added to
Current
PR base description:
Merging as-is would silently remove all security hooks. The branch needs to be rebased onto current 2. The PR base is missing the 3. Missing plugin guide copy Guide is created at Design Concerns4. Auto-allowing write MCP tools is a security model change The existing 5. Manifest cleanup relies on Claude compliance The session-start hook tells Claude: "After processing, delete the pending manifest files." If Claude doesn't comply (context window pressure, user interrupts, etc.), manifests accumulate and re-surface every session. Consider adding a fallback — e.g., the session-learner could clean up manifests older than 7 days, or the session-start hook could archive processed files with a timestamp rename. 6. Node.js runtime dependency All existing MCP servers are HTTP-based (zero local dependencies). The memory server requires Node.js 18+ and Minor Issues7. Hardcoded 2-hour window ( SINCE="2 hours ago"If a session runs longer than 2 hours, later commits are captured but earlier ones are missed. Consider using the session start timestamp (if available in hook input) or a broader window. 8. No automated entity pruning The guide correctly warns about the ~50 entity cap, but there's no automated cleanup. 9. "Notification": [
{
"matcher": "stop",
...
}
]This is a newer hook event type not currently used by the plugin. Confirm this is the correct event/matcher format for session-end notifications. Code Quality — Positive Notes
VerdictNeeds work before merge. The stale base branch is the blocker — it would regress security hooks. After rebasing onto current Required before merge:
Recommended (can be follow-up): 🤖 Generated with Claude Code |
|
Closing — superseded by #104, which is a v2 rewrite using |
Summary
@modelcontextprotocol/server-memoryas bundled stdio MCP server with project-local.arckit/memory.jsonlstoragesession-learner.shStop hook analyses commits, detects artifact types, classifies sessions, writes JSON manifestsarckit-session.shreads pending manifests and surfaces them as context with MCP tool instructionsmcp__memory__*tools via updatedallow-mcp-tools.shMotivation
ArcKit sessions have no memory between sessions. Knowledge discovered in one session is lost. This adds a two-stage memory system: hooks write manifests to disk, session-start surfaces them for Claude to process via MCP memory tools.
Test plan
.mcp.jsonvalid with stdio-type memory serversession-learner.shexits cleanly with no recent commitssession-learner.shwrites valid JSON manifestarckit-session.shsurfaces pending manifests🤖 Generated with Claude Code