Project Overview
TypeScript CLI tool providing persistent memory for Claude Code sessions:- Session Compression: Converts conversation transcripts into structured memories
- Context Loading: Retrieves relevant memories for new sessions
- Vector Search: Uses ChromaDB for semantic memory retrieval
- Claude Code Integration: Seamless hooks for automatic operation
- Smart Trash System: Safe deletion with recovery capabilities
Development Environment Setup
1
Prerequisites
Required tools:
Bun vs NPM: While the project works with both, Bun is preferred for development due to faster installation and builds.
2
Clone and Setup
3
Build System
4
Local Testing
Project Structure
Understanding the codebase organization:Key Directories Explained
/src/commands/ - CLI Command Logic
/src/commands/ - CLI Command Logic
Each command is a separate TypeScript file:Key Files:
install.ts
- Hook installation and setupload-context.ts
- Memory retrieval and formattingcompress.ts
- Transcript compressiontrash.ts
- Safe deletion system
/src/core/ - Business Logic
/src/core/ - Business Logic
Core compression and memory management:Critical Components:
TranscriptCompressor.ts
- Main compression engineMemoryManager.ts
- Memory CRUD operationsChromaClient.ts
- Vector database interface
/src/prompts/templates/ - LLM Prompts
/src/prompts/templates/ - LLM Prompts
Modular template system for LLM interactions:
/hooks/ - Claude Code Integration
/hooks/ - Claude Code Integration
Shell scripts that integrate with Claude Code:These scripts call the compiled CLI with specific commands.
Development Workflow
Making Changes
1
Create Feature Branch
2
Development Cycle
3
Local Integration Testing
4
Code Quality Checks
Testing Strategies
Unit Testing
Unit Testing
Test individual functions and modules:
Integration Testing
Integration Testing
Test complete command flows:
Hook Testing
Hook Testing
Test Claude Code integration:
Memory System Testing
Memory System Testing
Verify memory operations:
Common Development Tasks
Adding a New CLI Command
1
Create Command File
2
Register in CLI
3
Test and Build
Modifying Memory Compression
The compression system uses LLM prompts to analyze transcripts:1
Update Analysis Templates
2
Modify Compression Logic
3
Test Compression
Adding New Memory Features
1
Extend Memory Schema
2
Update Storage Logic
3
Update Context Loading
Code Quality Guidelines
TypeScript Best Practices
Error Handling Patterns
CLI Command Patterns
Release Process
Testing Before Release
1
Local Testing
2
Integration Testing
3
Build Testing
Version Management
Debugging Techniques
Development Debugging
Hook Debugging
Memory System Debugging
Contributing Guidelines
Pull Request Process
1
Before Submitting
- All tests pass locally
- Code follows style guidelines
- Documentation updated if needed
- Breaking changes are documented
2
PR Description
Include:
- Clear description of changes
- Motivation and context
- Testing performed
- Screenshots if UI changes
- Related issue numbers
3
Review Process
- Automated checks must pass
- Code review by maintainers
- Integration testing
- Documentation review
Issue Reporting
When reporting bugs or requesting features:- Bug Reports: Include steps to reproduce, expected vs actual behavior, system info
- Feature Requests: Describe use case, proposed solution, alternatives considered
- Documentation Issues: Specify what’s unclear or missing
Getting Help
Ready to contribute? Start by exploring the codebase, setting up your development environment, and looking for issues labeled “good first issue” or “help wanted” in the repository.