feat: Claude Code hooks for automatic memory integration#124
feat: Claude Code hooks for automatic memory integration#124russellbrenner wants to merge 5 commits intoCaviraOSS:mainfrom
Conversation
- Fix openmemory-js Dockerfile: replace Bun with npm (no bun.lockb exists) - Add NODE_OPTIONS for increased heap size during TypeScript compilation - Restore dashboard app from git history (removed in Beta 1.3.0) - Update docker-compose.yml to re-enable dashboard service Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add SessionStart hook to query project context at session start - Add Stop hook to store session summaries - Both hooks fail silently if OpenMemory/Docker unavailable - Include CLAUDE.md.example with comprehensive MCP tool documentation - Add import-claude-mem.js for migrating claude-mem databases Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Use jq to build JSON output instead of bash substring expression that fails on some bash versions. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR adds Claude Code integration hooks and a comprehensive dashboard for OpenMemory, enabling automatic memory capture during development sessions and providing visual analytics for memory management.
Changes:
- Added session start/stop hooks for automatic memory integration with Claude Code
- Created a Next.js dashboard with memory analytics, chat interface, and system monitoring
- Provided migration tooling for users coming from claude-mem
- Switched Docker build from Bun to npm with increased Node.js heap size
Reviewed changes
Copilot reviewed 33 out of 36 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| scripts/import-claude-mem.js | Migration script to import memories from claude-mem SQLite database |
| packages/openmemory-js/Dockerfile | Changed build system from Bun to npm with heap size optimization |
| hooks/openmemory-session-stop.sh | Bash script to capture session summaries at Claude Code session end |
| hooks/openmemory-session-start.sh | Bash script to inject relevant context at Claude Code session start |
| hooks/README.md | Installation and configuration guide for Claude Code hooks |
| hooks/CLAUDE.md.example | Template documentation for Claude to use OpenMemory MCP tools |
| docker-compose.yml | Removed obsolete version specification |
| dashboard/* | Complete Next.js dashboard implementation with memory visualization and chat interface |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # OpenMemory Dashboard Configuration | ||
| NEXT_PUBLIC_API_URL=http://localhost:8080 | ||
| # Set this if your backend has OM_API_KEY configured for authentication | ||
| NEXT_PUBLIC_API_KEY=your No newline at end of file |
There was a problem hiding this comment.
The API key value 'your' is incomplete and ambiguous. It should either be 'your-api-key-here' or include a comment indicating this is a placeholder that needs to be replaced with an actual API key.
| NEXT_PUBLIC_API_KEY=your | |
| NEXT_PUBLIC_API_KEY=your-api-key-here |
| AWS_REGION: { | ||
| category: 'API Keys', | ||
| label: 'AWS Region', | ||
| description: 'Region aws (us-east-1 prefered)', |
There was a problem hiding this comment.
Corrected spelling of 'prefered' to 'preferred'.
| description: 'Region aws (us-east-1 prefered)', | |
| description: 'Region aws (us-east-1 preferred)', |
- Add NODE_OPTIONS=--max-old-space-size=128 to Dockerfile production stage - Document memory tuning in README for users needing larger heaps - Default 128MB provides ~4x headroom over minimal Node.js heap Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The previous 128MB limit caused 96% memory pressure during normal operations. Increased to 512MB to provide headroom for vector operations and embedding storage. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
Hi Russell, thank you for your contribution! This helps us a lot, but I don't understand why there is a neccesity for frontend files here |
Summary
Adds Claude Code integration via hooks and a migration script for users coming from claude-mem.
Both hooks fail silently with 3-second timeouts when OpenMemory isn't running.
Disclosure
This PR was authored with assistance from Claude (Anthropic). The hooks and documentation were developed iteratively based on actual usage. Happy to adjust anything to fit the project's direction.
Files
Test plan
🤖 Generated with Claude Code