36 Commits

Author SHA1 Message Date
Alex Newman 5169cfa46d Merge branch 'main' into feature/hybrid-search
Resolved conflicts by:
- Keeping feature/hybrid-search build process documentation in CLAUDE.md
- Removing deleted plugin/scripts/search-server.js (intentionally deleted in feature branch)
- Removing usage logging from worker-service.ts (telemetry captured at SDK level)
- Rebuilt worker-service.cjs after resolving source file conflicts

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-03 19:15:18 -05:00
Alex Newman 03ba89b703 fix: update user prompt formatting and correct 90-day cutoff logic
- Changed user prompt formatting to use full text instead of truncated version.
- Updated date filtering logic to use milliseconds instead of seconds for 90-day cutoff.
- Renamed doc_type values in ChromaSync to ensure consistency and prevent deduplication issues.
- Improved documentation for concept tags in input schema.
2025-11-03 19:05:12 -05:00
Alex Newman 633f89a5fb feat: Implement user prompt syncing to Chroma and enhance timeline querying
- Added `getObservationById` method to retrieve observations by ID in SessionStore.
- Introduced `getSessionSummariesByIds` and `getUserPromptsByIds` methods for fetching session summaries and user prompts by IDs.
- Developed `getTimelineAroundTimestamp` and `getTimelineAroundObservation` methods to provide a unified timeline of observations, sessions, and prompts around a specified anchor point.
- Enhanced ChromaSync to format and sync user prompts, including a new `syncUserPrompt` method.
- Updated WorkerService to sync the latest user prompt to Chroma after updating the worker port.
- Created tests for timeline querying and MCP handler logic to ensure functionality.
- Documented the implementation plan for user prompts and timeline context tool in the Chroma search completion plan.
2025-11-03 16:55:33 -05:00
copilot-swe-agent[bot] 192adf5cbc Fix: /clear DOES inject context via SessionStart hook
Corrected incorrect documentation that claimed /clear doesn't inject context.
The SessionStart hook fires with source: "clear" when /clear is used, which
re-injects context from recent sessions. Updated docs to accurately reflect
that /clear both clears conversation AND re-injects fresh context.

Co-authored-by: thedotmack <683968+thedotmack@users.noreply.github.com>
2025-10-31 21:28:54 +00:00
copilot-swe-agent[bot] 140a5f3469 Clarify Stop hook behavior and /clear vs exit in docs
- Changed "Stop Claude" to "Claude finishes responding" to clarify that the Stop hook fires automatically
- Explained Stop hook triggers summary generation automatically, not as a user action
- Added detailed section explaining /clear behavior vs completely exiting Claude Code
- Clarified when new context is injected (new session start, not after /clear)
- Fixed session count: changed "last 3 sessions" to "last 10 sessions" (matches implementation)

Co-authored-by: thedotmack <683968+thedotmack@users.noreply.github.com>
2025-10-31 21:06:59 +00:00
Alex Newman b0fae0cfd4 Add stderr test hook for UI experiment 2025-10-26 22:29:43 -04:00
Alex Newman 44b69b737b Remove memory toggle feature documentation as it is no longer relevant 2025-10-26 00:44:31 -04:00
Alex Newman 56213ef84a Fix: Update npm loglevel to silent in SessionStart hook to prevent context injection issues; consolidate hooks architecture and update documentation for v4.3.1 2025-10-26 00:44:04 -04:00
Alex Newman 9f3bf55c76 refactor: Remove hardcoded paths for project and Claude Code executable in various scripts, fixes issue #23 2025-10-25 13:28:20 -04:00
Alex Newman e18f02e2af plan: Implement memory toggle feature for pausing/resuming recording 2025-10-25 01:51:42 -04:00
Alex Newman 81fdf28347 Fix critical bug: getSessionById missing claude_session_id
Critical bugfix for NOT NULL constraint violation.

Problem:
- Worker service calls getSessionById(sessionDbId) to fetch session data
- Worker then uses dbSession.claude_session_id to create ActiveSession
- But getSessionById was NOT selecting claude_session_id from database
- Result: claudeSessionId = undefined in worker
- Caused: "NOT NULL constraint failed: sdk_sessions.claude_session_id" errors
- Impact: Observations and summaries couldn't be stored

Root cause:
- SessionStore.getSessionById() SQL query missing claude_session_id column
- Line 710-713: "SELECT id, sdk_session_id, project, user_prompt"
- Should be: "SELECT id, claude_session_id, sdk_session_id, project, user_prompt"

Fix:
- Added claude_session_id to SELECT query in getSessionById
- Updated return type to include claude_session_id: string
- Now worker correctly receives claude_session_id from database
- Session ID from hook flows properly through entire system

Files changed:
- src/services/sqlite/SessionStore.ts (getSessionById method)

Testing:
- Build succeeded
- Ready for PM2 restart and live testing

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-24 22:18:03 -04:00
Alex Newman c48290a156 Refactor code structure for improved readability and maintainability 2025-10-24 19:29:16 -04:00
Alex Newman 226a52f8b8 Implement structural updates and optimizations across multiple modules 2025-10-24 19:26:46 -04:00
Alex Newman 93b5f80168 Implement code changes to enhance functionality and improve performance 2025-10-24 18:17:49 -04:00
Alex Newman f6cf895847 fix: update documentation structure and add missing properties 2025-10-24 18:14:39 -04:00
Alex Newman dba29de2a7 fix: remove unused background colors and tabs from documentation configuration 2025-10-24 18:07:13 -04:00
Alex Newman c16f453017 fix: add missing theme property in documentation configuration 2025-10-24 18:05:35 -04:00
Alex Newman 8b4c962e62 Add initial documentation for Claude-Mem plugin
- Created docs structure including introduction, installation, troubleshooting, and usage guides.
- Added detailed installation instructions with quick start and advanced options.
- Documented the automatic operation of Claude-Mem and its session management features.
- Introduced MCP search tools with usage examples and query strategies.
- Provided troubleshooting steps for common issues related to worker service, hooks, database, and search tools.
- Included system requirements and upgrade notes for transitioning from v3.x to v4.0.0.
2025-10-24 18:04:03 -04:00
Alex Newman 12149470a2 Add installation, troubleshooting, and usage documentation for Claude-Mem plugin
- Created comprehensive installation guide detailing quick start, system requirements, and advanced installation steps.
- Developed troubleshooting guide addressing common issues with worker service, hooks, database, and search tools.
- Introduced getting started documentation explaining automatic operation, session summaries, and context injection.
- Added detailed usage instructions for MCP search tools, including query examples and advanced filtering techniques.
2025-10-23 23:40:42 -04:00
Alex Newman 635f456ecf fix: Resolve race condition in summary generation by deferring flag setting in worker 2025-10-18 17:37:04 -04:00
Alex Newman 938eb9dc0e feat: Implement new memory processing prompts and XML structures
- Added final finalize prompt for session summary generation with required XML fields.
- Introduced recommended prompt flow with structured observation format and hierarchical storage principles.
- Created final init prompt for processing tool executions with clear guidelines on when to store observations.
- Developed final observation prompt for analyzing tool outputs and generating structured observations.
- Migrated old prompt flow to a new system with improved clarity and structured data handling.
- Updated parser and storage mechanisms to accommodate new observation formats and fields.
- Enhanced documentation for new prompts and their usage in memory processing sessions.
2025-10-18 17:27:46 -04:00
Alex Newman a11199a527 Implement hybrid prompt flow system with enhanced memory storage and retrieval
- Introduced a new hierarchical memory format for observations, including title, subtitle, facts, narrative, concepts, and files.
- Updated session start, tool execution, and session end prompts to reflect new structure and guidance.
- Replaced bash command execution with XML parsing for observation storage, improving reliability and reducing complexity.
- Established clear criteria for what to store and skip, eliminating ambiguous language and tool-type bias.
- Enhanced database schema to support new observation fields and relationships, ensuring data integrity.
- Added comprehensive session summaries at the end of each session, capturing key insights and next steps.
- Improved retrieval patterns for observations, allowing for granular searches by concept and file.
- Outlined future enhancements for semantic search and cross-session memory linking.
2025-10-17 16:56:12 -04:00
Alex Newman 372854948c feat: Implement Worker Service with session management and SDK integration
- Added WorkerService to handle long-running HTTP service with session management.
- Implemented endpoints for initializing, observing, finalizing, checking status, and deleting sessions.
- Integrated with Claude SDK for processing observations and generating responses.
- Added port allocator utility to dynamically find available ports for the service.
- Configured TypeScript settings for the project.
2025-10-17 15:59:36 -04:00
Alex Newman 3e617a8b1e Refactor code structure for improved readability and maintainability 2025-10-16 19:50:24 -04:00
Alex Newman 307c87b9f6 refactor: restructure session logic documentation and prioritize happy path verification 2025-10-16 17:49:35 -04:00
Alex Newman 834cf4095e Add standalone hook entry points for context, new, save, summary, and worker
- Implemented context-hook.ts for handling session start events.
- Created new-hook.ts for user prompt submission events.
- Developed save-hook.ts for post tool use events.
- Added summary-hook.ts for handling stop events.
- Introduced worker.ts as a standalone background process for the SDK agent.
- Each hook reads input from stdin, processes it, and handles errors gracefully.
2025-10-16 15:39:30 -04:00
Alex Newman 723f1f5374 refactor: update plugin installation guide and add MCP server configuration 2025-10-16 15:18:48 -04:00
Alex Newman 5f05f991bc refactor: add hooks configuration and plugin installation documentation 2025-10-16 15:09:40 -04:00
Alex Newman f2551ac366 Refactor path management: Migrate path discovery logic to shared paths module
- Removed `path-discovery.ts` service and replaced its usage with a new `paths.ts` module.
- Updated all commands and services to utilize the new path constants and helper functions.
- Ensured all necessary directories are created using the new utility functions.
- Improved code readability and maintainability by centralizing path configurations.
2025-10-16 14:46:47 -04:00
Alex Newman eddb321489 refactor: streamline claude-mem integration and remove unused code
- Updated CODEMAP to reflect changes in fallback methods for package root discovery.
- Removed the `detectClaudePath` function and replaced its usage with direct references to `PACKAGE_NAME`.
- Eliminated the `claudePath` property from Settings interface and user settings configuration.
- Cleaned up path discovery logic by removing the npm list command method.
- Removed the `findExecutable` method from the Platform utility as it was no longer needed.
2025-10-16 14:24:32 -04:00
Alex Newman 6e9be84a01 Add comprehensive documentation for claude-mem codebase and create a test worker script
- Introduced CODEMAP.md detailing project overview, architecture, directory structure, core components, commands, hooks system, SDK, services, shared components, utilities, and key workflows.
- Added a test-worker.sh script to automate testing of the SDK worker, including session creation, worker initiation, socket communication, and cleanup after finalization.
2025-10-16 13:56:18 -04:00
Alex Newman 2608fb180e Refactor: Remove hook-templates and related functionality
- Updated the published package contents to exclude `hook-templates`.
- Removed references to the hooks directory and related scripts in the installation and uninstallation processes.
- Simplified the status command by eliminating checks for runtime hook scripts.
- Adjusted the path discovery service to remove methods related to hook templates.
- Updated the installation logic to directly configure hooks using CLI commands.
- Cleaned up the uninstall process to remove claude-mem hooks from settings.
2025-10-15 20:38:11 -04:00
Alex Newman edeed2ee2c refactor: remove deprecated hook templates and related utilities
- Deleted hook-prompt-renderer.js and hook-prompts.config.js as they are no longer needed.
- Removed path-resolver.js, stop.js, and user-prompt-submit.js for streamlining the codebase.
- Updated package.json scripts to point to new build and publish scripts.
- Adjusted test imports to reflect new directory structure after removing unnecessary files.
2025-10-15 20:24:08 -04:00
Alex Newman 01b477da26 feat: Add build and publish scripts for claude-mem
- Implemented build.js to bundle TypeScript source into a minified executable using Bun.
- Created publish.js to handle version bumping, building, and publishing to npm with user prompts.
- Added tests for database schema and hook functions in database-schema.test.ts.
- Introduced integration tests for hooks database in hooks-database-integration.test.ts.
- Developed end-to-end tests for SDK prompts and parser in sdk-prompts-parser.test.ts.
- Created session lifecycle tests to simulate complete Claude Code session in session-lifecycle.test.ts.
2025-10-15 20:23:32 -04:00
thedotmack 4fbb25e385 Remove internal documentation 2025-09-06 19:36:38 +00:00
thedotmack 598369e894 Initial release v3.3.8
- Hook system for customization
- Documentation and installation scripts
- Multi-platform support via GitHub releases
- Binaries available for Windows, Linux (x64/ARM64), macOS (Intel/Apple Silicon)

Generated with Claude Code via Happy
2025-09-06 19:34:53 +00:00