Commit Graph

78 Commits

Author SHA1 Message Date
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 015b38c763 Refactor database hooks to add new session tracking features
- Introduced `getSessionById` method in HooksDatabase to retrieve session details by ID.
- Updated context, new, save, and summary hooks to utilize the new `getSessionById` method.
- Enhanced session management by adding `worker_port` and `prompt_counter` columns to relevant tables.
- Improved logging in WorkerService to provide clearer output during session initialization and processing.
- Removed redundant error logging in favor of more informative console logs.
2025-10-17 16:42:23 -04:00
Alex Newman be936d8413 Enhance HooksDatabase and WorkerService functionality
- Updated save-hook.js and summary-hook.js to include new database columns for tracking worker ports and prompt numbers.
- Implemented migration logic to remove UNIQUE constraints from session_summaries table and added necessary indices.
- Modified HooksDatabase methods to return boolean values indicating success or failure of updates.
- Changed logging from error to info level in WorkerService for better clarity on session management and initialization.
2025-10-17 16:32:20 -04:00
Alex Newman d4a71c994d feat: Enhance session management with prompt tracking
- Added prompt_number to observations and session summaries for better tracking.
- Implemented prompt counter in SDK sessions to manage user prompts effectively.
- Updated database schema to include prompt tracking columns and removed unique constraints on session summaries.
- Modified hooks to utilize prompt_number in observations and summaries.
- Changed worker service to handle summarize requests instead of finalize, keeping the SDK agent active.
- Improved logging for better debugging and tracking of prompt numbers across sessions.
2025-10-17 16:23:11 -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 d6462919cb chore: update chroma.sqlite3 database file 2025-10-16 21:17:05 -04:00
Alex Newman ec79e085b2 Refactor code structure for improved readability and maintainability 2025-10-16 21:02:56 -04:00
Alex Newman cedb635176 Refactor hooks to standardize response format and improve error handling
- Introduced a new `hook-response.ts` module to create standardized hook responses.
- Updated `context-hook.ts`, `new.ts`, `save.ts`, and `summary.ts` to utilize the new response format.
- Enhanced error handling in `context-hook.ts` to check for input from stdin.
- Refactored database interaction in hooks to ensure consistent session management.
- Improved readability and maintainability of hook implementations by restructuring code.
- Updated database queries to use consistent variable naming and formatting.
- Modified the handling of socket connections in `save.ts` and `summary.ts` to ensure proper response on close and error events.
2025-10-16 20:50:04 -04:00
Alex Newman 6f62a569df refactor: streamline input validation and error handling in hooks 2025-10-16 20:10:51 -04:00
Alex Newman 7c5e5b1941 feat: update context hook to extract project name from cwd and improve error handling 2025-10-16 20:06:00 -04:00
Alex Newman 8e460a8c2a feat: remove install, logs, restore, status, trash, and uninstall commands
- Deleted the install.ts command file, removing the installation logic for the Claude Memory System.
- Removed logs.ts command file, eliminating the log viewing functionality.
- Deleted restore.ts command file, which handled restoring files from trash.
- Removed status.ts command file, which provided system status checks.
- Deleted trash-empty.ts and trash-view.ts command files, removing trash management features.
- Removed trash.ts command file, which handled moving files to trash.
- Deleted uninstall.ts command file, eliminating the uninstallation process for the memory system.
- Updated new.ts hook to enforce plugin mode for Claude Code integration.
- Cleaned up config.ts by removing unused export for CLI_NAME.
2025-10-16 19:57:54 -04:00
Alex Newman 18d5e0d3bb Implement feature X to enhance user experience and fix bug Y in module Z 2025-10-16 19:51:51 -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 2d080b0264 Add a basic Unix socket server using Bun
- Implemented a simple server using the net module.
- The server listens on a specified socket path.
- Added error handling for server errors.
- Included checks to verify the existence of the socket file.
2025-10-16 17:07:14 -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 b44853fb2c refactor: update hooks to handle missing input and provide usage instructions 2025-10-16 15:04:08 -04:00
Alex Newman 29aa945ae0 refactor: enhance contextHook to handle missing input and improve no summaries message 2025-10-16 14:59:18 -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 2ba840aaac refactor: remove PathDiscovery service and associated functionality 2025-10-16 14:46:32 -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 18aa4f2538 feat: add doctor and status commands to CLI
- Implemented the `doctor` command to run health checks on the claude-mem installation, with an option to output results as JSON.
- Implemented the `status` command to display the system status of claude-mem.
- Updated the `doctor` command to use `HooksDatabase` for SQLite connectivity checks.
- Removed unused session management code from the `status` command for cleaner output.
2025-10-15 20:57:24 -04:00
Alex Newman 4489249ecc Refactor: Remove unused logging and path management utilities
- Removed the rollingLog import and its usage in doctor.ts.
- Deleted the animatedRainbow function from install.ts.
- Removed the log following implementation in logs.ts.
- Deleted the PathResolver class and its related methods in paths.ts.
- Removed the SettingsManager class and its associated methods in settings.ts.
- Deleted the JSONLStorageProvider class and its methods in storage.ts.
- Removed the CompressionError class from types.ts.
- Cleaned up the Platform utility by removing unnecessary methods related to shell and file permissions.
2025-10-15 20:53:22 -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
Alex Newman 58a9554bb3 feat: Complete Phase 1 implementation with database schema, shared layer, and hook functions
- Created new tables for SDK sessions and observations
- Implemented HooksDatabase for CRUD operations
- Developed four hook functions: context, new, save, and summary
- Added CLI commands for each hook
- Established comprehensive test suite with all tests passing

feat: Complete Phase 2 implementation with SDK worker process and XML parsing

- Developed SDK prompts for initializing and processing observations
- Implemented XML parser for SDK responses
- Created SDK worker process to handle background observation processing
- Verified integration with HooksDatabase and added tests for all components

feat: Complete Phase 3 integration with comprehensive testing and validation

- Verified all hook functions with database integration
- Created integration and end-to-end tests for session lifecycle
- Ensured non-blocking operations and performance requirements met
- Updated CLI commands for hook architecture and installation flow
- Documented success criteria and next steps for real-world testing
2025-10-15 20:13:04 -04:00
Alex Newman 29f1cb3b4c feat: Add comprehensive best practices guide for context engineering in AI agents 2025-10-15 20:09:57 -04:00
Alex Newman 7307563cfe Refactor: Remove legacy data access objects and logging utilities
- Deleted MemoryStore, OverviewStore, SessionStore, StreamingSessionStore, and TranscriptEventStore classes to streamline database interactions.
- Removed logger and rolling log utilities to simplify logging mechanisms.
- Updated index file to reflect the removal of stores and logging functionalities.
2025-10-15 20:02:15 -04:00
Alex Newman 047298a183 feat: Complete Phase 3 implementation of claude-mem architecture
- Removed legacy hook file writing and ensured hooks directory exists for backward compatibility.
- Updated hook configuration to use CLI commands directly, simplifying installation and maintenance.
- Created comprehensive integration and end-to-end tests for the new hook lifecycle.
- Verified database integration for session management, observation queuing, and summary storage.
- Ensured performance requirements are met with all operations completing in under 50ms.
- Documented Phase 3 completion and updated related documentation.
2025-10-15 19:37:36 -04:00
Alex Newman 78fd1368db feat: Implement Phase 2 of SDK Worker Process
- Added background agent architecture for processing tool observations and generating session summaries.
- Created SDK Prompts Module for generating prompts for the Claude Agent SDK.
- Developed XML Parser Module for parsing observation and summary XML blocks from SDK responses.
- Implemented SDK Worker Process to handle observation processing and session management.
- Updated newHook implementation to spawn the SDK worker as a detached process with path resolution for development and production.
- Created comprehensive test suite for SDK prompts, XML parsing, and HooksDatabase integration, ensuring all tests pass.
- Documented Phase 2 implementation details, architecture validation, and success criteria in PHASE2-COMPLETE.md.
2025-10-15 19:18:38 -04:00
Alex Newman d07a40616d feat: Add Phase 2 implementation prompt for SDK worker process and related tasks 2025-10-15 19:08:19 -04:00
Alex Newman e81ea69143 feat: Implement Phase 1 of SDK agent architecture with hook integration
- Added CLI commands for context, new session, save observation, and summary.
- Created HooksDatabase for managing SDK sessions and observations.
- Implemented migration 004 to add new tables: sdk_sessions, observation_queue, observations, and session_summaries.
- Developed hook functions for context display, session initialization, observation queuing, and session finalization.
- Added comprehensive tests for database schema and hook functionality.
- Documented Phase 1 implementation in PHASE1-COMPLETE.md.
2025-10-15 19:06:51 -04:00
Alex Newman 917ab9740c feat: add architecture validation summary and pre-implementation checklist for SDK integration 2025-10-15 18:23:19 -04:00
Alex Newman b43b7f02ae feat: enhance refactor plan with detailed session management and SDK integration 2025-10-15 18:22:36 -04:00
Alex Newman d989ba62f9 feat: add models overview and detailed comparison for Claude models 2025-10-15 18:08:50 -04:00
Alex Newman 87f26d7b0d Plan document update 2025-10-15 17:50:29 -04:00
Alex Newman 7fac3e3bb6 Add comprehensive documentation for Claude Code hooks and streaming input modes
- Introduced a detailed reference for implementing hooks in Claude Code, covering configuration, project-specific scripts, plugin hooks, and various hook events.
- Explained the input modes available in the Claude Agent SDK, emphasizing the benefits of streaming input mode and providing implementation examples for both streaming and single message input.
- Highlighted security considerations and best practices for writing hooks, along with debugging tips and execution details.
2025-10-15 15:51:25 -04:00
Alex Newman 2663121d9f Refactor database integration to use bun:sqlite instead of better-sqlite3
- Updated import statements across multiple files to use bun:sqlite.
- Changed database query methods from `prepare` to `query` for consistency.
- Removed dependency on better-sqlite3 from package.json and adjusted package.json to specify bun as the engine.
- Modified hook installation process to eliminate unnecessary dependency installation.
- Updated migration scripts to align with bun:sqlite's API.
2025-10-15 15:03:43 -04:00
Alex Newman b5bfc029c3 feat: implement graceful shutdown handlers and session locking in hooks 2025-10-14 19:58:48 -04:00
Alex Newman 5886fe7d8f feat: add publish script for claude-mem
- Implemented a CLI tool for version bumping, building, and publishing to npm.
- Added checks for uncommitted changes and current version retrieval.
- Included options for patch, minor, major, and custom version bumps.
- Integrated git commit and tagging after version update.
- Added npm publish functionality and git push after successful publish.
- Implemented error handling and user confirmations throughout the process.
2025-10-14 19:26:11 -04:00
Alex Newman 5f15695c3f Release v3.9.16
Published from npm package build
Source: https://github.com/thedotmack/claude-mem-source
v3.9.16
2025-10-06 22:55:16 -04:00
Alex Newman c49533c250 Release v3.9.14
Published from npm package build
Source: https://github.com/thedotmack/claude-mem-source
v3.9.14
2025-10-03 21:47:35 -04:00
Alex Newman 4f49cb1bc9 Release v3.9.13
Published from npm package build
Source: https://github.com/thedotmack/claude-mem-source
v3.9.13
2025-10-03 21:45:36 -04:00
Alex Newman 874726b193 Release v3.9.12
Published from npm package build
Source: https://github.com/thedotmack/claude-mem-source
v3.9.12
2025-10-03 21:09:11 -04:00
Alex Newman 5244a12422 Release v3.9.11
Published from npm package build
Source: https://github.com/thedotmack/claude-mem-source
v3.9.11
2025-10-03 20:55:36 -04:00