Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 35b7aab174 | |||
| 2601215c91 | |||
| 4ebf0cad6b |
@@ -5,6 +5,32 @@ All notable changes to this project will be documented in this file.
|
|||||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
||||||
|
|
||||||
|
|
||||||
|
## [3.6.10] - 2025-09-16
|
||||||
|
|
||||||
|
### Added
|
||||||
|
- Claude Code statusline integration for real-time memory status
|
||||||
|
- MCP memory tools server providing compress, stats, search, and overview commands
|
||||||
|
- Concept documentation explaining memory compression and context loading
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- Corrected integration architecture to use hooks instead of MCP SDK
|
||||||
|
|
||||||
|
|
||||||
|
## [3.6.9] - 2025-09-14
|
||||||
|
|
||||||
|
### Added
|
||||||
|
- Display current date and time at the top of session-start hook output for better temporal context
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- Enhanced session-start hook formatting with emoji icons and separator lines for improved readability
|
||||||
|
|
||||||
|
|
||||||
|
## [3.6.8] - 2025-09-14
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- Fixed publish command failing when no version-related memories exist for changelog generation
|
||||||
|
|
||||||
|
|
||||||
## [3.6.6] - 2025-09-14
|
## [3.6.6] - 2025-09-14
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|||||||
+2
-2
@@ -3,5 +3,5 @@ allowed-tools: Bash
|
|||||||
description: Write an overview and save with claude-mem
|
description: Write an overview and save with claude-mem
|
||||||
---
|
---
|
||||||
**Write an overview** of the current conversation context and:
|
**Write an overview** of the current conversation context and:
|
||||||
1. **Add it to claude-mem** using the chroma MCP tools
|
1. **Add it to claude-mem** using the chroma MCP tools. Always use primitive types (strings, numbers, booleans) when calling MCP Chroma tools directly. Arrays should be comma-separated strings, and nested objects should be flattened.
|
||||||
2. **IMPORTANT! Save the overview to index** using the claude-mem CLI tool: `claude-mem save "your overview message"`
|
2. **Save the overview to index** using the claude-mem CLI tool: `claude-mem save "your overview message"`
|
||||||
Vendored
+117
-115
File diff suppressed because one or more lines are too long
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "claude-mem",
|
"name": "claude-mem",
|
||||||
"version": "3.6.6",
|
"version": "3.6.10",
|
||||||
"description": "Memory compression system for Claude Code - persist context across sessions",
|
"description": "Memory compression system for Claude Code - persist context across sessions",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"claude",
|
"claude",
|
||||||
|
|||||||
@@ -393,8 +393,34 @@ Start searching now.` :
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (memories.length === 0) {
|
if (memories.length === 0) {
|
||||||
console.log('\n⚠️ No version-related memories found. Try compressing more sessions first.');
|
console.log('\n⚠️ No version-related memories found for this version.');
|
||||||
process.exit(1);
|
console.log(' This is normal for the first release or when no changes were tracked.');
|
||||||
|
console.log(' Creating a placeholder changelog entry...');
|
||||||
|
|
||||||
|
// Create a minimal placeholder entry
|
||||||
|
const placeholderEntry: ChangelogEntry = {
|
||||||
|
version: versionsToSearch[0], // Use the first (current) version
|
||||||
|
date: todayStr,
|
||||||
|
type: 'Changed',
|
||||||
|
description: 'Initial release or minor updates',
|
||||||
|
timestamp: new Date().toISOString(),
|
||||||
|
generatedAt: new Date().toISOString()
|
||||||
|
};
|
||||||
|
|
||||||
|
// Save the placeholder entry
|
||||||
|
if (!fs.existsSync(projectChangelogDir)) {
|
||||||
|
fs.mkdirSync(projectChangelogDir, { recursive: true });
|
||||||
|
}
|
||||||
|
|
||||||
|
const jsonlContent = JSON.stringify(placeholderEntry) + '\n';
|
||||||
|
fs.appendFileSync(changelogJsonlPath, jsonlContent);
|
||||||
|
|
||||||
|
console.log(`✅ Created placeholder changelog entry for v${versionsToSearch[0]}`);
|
||||||
|
|
||||||
|
// Generate the CHANGELOG.md with the placeholder
|
||||||
|
await updateChangelogFromJsonl(options);
|
||||||
|
|
||||||
|
return; // Exit successfully
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(`✅ Found ${memories.length} version-related memories\n`);
|
console.log(`✅ Found ${memories.length} version-related memories\n`);
|
||||||
|
|||||||
@@ -10,12 +10,6 @@ import {
|
|||||||
outputSessionStartContent
|
outputSessionStartContent
|
||||||
} from '../prompts/templates/context/ContextTemplates.js';
|
} from '../prompts/templates/context/ContextTemplates.js';
|
||||||
|
|
||||||
interface IndexEntry {
|
|
||||||
summary: string;
|
|
||||||
entity: string;
|
|
||||||
keywords: string[];
|
|
||||||
}
|
|
||||||
|
|
||||||
interface TrashStatus {
|
interface TrashStatus {
|
||||||
folderCount: number;
|
folderCount: number;
|
||||||
fileCount: number;
|
fileCount: number;
|
||||||
@@ -23,6 +17,14 @@ interface TrashStatus {
|
|||||||
isEmpty: boolean;
|
isEmpty: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function buildProjectMatcher(projectName: string): (value?: string) => boolean {
|
||||||
|
const aliases = new Set<string>();
|
||||||
|
aliases.add(projectName);
|
||||||
|
aliases.add(projectName.replace(/-/g, '_'));
|
||||||
|
aliases.add(projectName.replace(/_/g, '-'));
|
||||||
|
return (value?: string) => !!value && aliases.has(value);
|
||||||
|
}
|
||||||
|
|
||||||
function formatSize(bytes: number): string {
|
function formatSize(bytes: number): string {
|
||||||
if (bytes === 0) return '0 B';
|
if (bytes === 0) return '0 B';
|
||||||
const k = 1024;
|
const k = 1024;
|
||||||
@@ -115,20 +117,25 @@ export async function loadContext(options: OptionValues = {}): Promise<void> {
|
|||||||
const sessions = jsonObjects.filter(obj => obj.type === 'session');
|
const sessions = jsonObjects.filter(obj => obj.type === 'session');
|
||||||
|
|
||||||
// Filter each type by project if specified
|
// Filter each type by project if specified
|
||||||
|
// Handle both hyphen and underscore formats since index has mixed entries
|
||||||
let filteredMemories = memories;
|
let filteredMemories = memories;
|
||||||
let filteredOverviews = overviews;
|
let filteredOverviews = overviews;
|
||||||
|
let filteredSessions = sessions;
|
||||||
if (options.project) {
|
if (options.project) {
|
||||||
filteredMemories = memories.filter(obj => obj.project === options.project);
|
const matchesProject = buildProjectMatcher(options.project);
|
||||||
filteredOverviews = overviews.filter(obj => obj.project === options.project);
|
filteredMemories = memories.filter(obj => matchesProject(obj.project));
|
||||||
|
filteredOverviews = overviews.filter(obj => matchesProject(obj.project));
|
||||||
|
filteredSessions = sessions.filter(obj => matchesProject(obj.project));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (options.format === 'session-start') {
|
if (options.format === 'session-start') {
|
||||||
// Get last 10 memories and last 5 overviews for session-start
|
// Get last 10 memories and last 5 overviews for session-start
|
||||||
const recentMemories = filteredMemories.slice(-10);
|
const recentMemories = filteredMemories.slice(-10);
|
||||||
const recentOverviews = filteredOverviews.slice(-5);
|
const recentOverviews = filteredOverviews.slice(-5);
|
||||||
|
const recentSessions = filteredSessions.slice(-5);
|
||||||
|
|
||||||
// Combine them for the display
|
// Combine them for the display
|
||||||
const recentObjects = [...recentMemories, ...recentOverviews];
|
const recentObjects = [...recentSessions, ...recentMemories, ...recentOverviews];
|
||||||
|
|
||||||
// Find most recent timestamp for last session info
|
// Find most recent timestamp for last session info
|
||||||
let lastSessionTime = 'recently';
|
let lastSessionTime = 'recently';
|
||||||
@@ -195,4 +202,4 @@ export async function loadContext(options: OptionValues = {}): Promise<void> {
|
|||||||
console.log(createUserFriendlyError('Context loading', errorMessage, 'Check file permissions and try again'));
|
console.log(createUserFriendlyError('Context loading', errorMessage, 'Check file permissions and try again'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,6 +28,11 @@ function generateSessionId(message: string): string {
|
|||||||
* Save command - stores a message to both Chroma collection and JSONL index
|
* Save command - stores a message to both Chroma collection and JSONL index
|
||||||
*/
|
*/
|
||||||
export async function save(message: string, options: OptionValues = {}): Promise<void> {
|
export async function save(message: string, options: OptionValues = {}): Promise<void> {
|
||||||
|
// Debug: Log what we receive
|
||||||
|
appendFileSync('/Users/alexnewman/.claude-mem/save-debug.log',
|
||||||
|
`[${new Date().toISOString()}] Received message: "${message}" (type: ${typeof message}, length: ${message?.length})\n`,
|
||||||
|
'utf8');
|
||||||
|
|
||||||
if (!message || message.trim() === '') {
|
if (!message || message.trim() === '') {
|
||||||
console.error('Error: Message is required');
|
console.error('Error: Message is required');
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
|
|||||||
@@ -191,8 +191,8 @@ export class PromptOrchestrator {
|
|||||||
projectName = this.projectName,
|
projectName = this.projectName,
|
||||||
} = context;
|
} = context;
|
||||||
|
|
||||||
// Extract project prefix from project name (convert to snake_case)
|
// Use project name as-is for consistency with directory names
|
||||||
const projectPrefix = projectName.replace(/[-\s]/g, '_').toLowerCase();
|
const projectPrefix = projectName;
|
||||||
|
|
||||||
// Use the simple prompt with the transcript included
|
// Use the simple prompt with the transcript included
|
||||||
return createAnalysisPrompt(
|
return createAnalysisPrompt(
|
||||||
|
|||||||
@@ -559,9 +559,29 @@ export function outputSessionStartContent(params: {
|
|||||||
const { projectName, memoryCount, lastSessionTime, recentObjects } = params;
|
const { projectName, memoryCount, lastSessionTime, recentObjects } = params;
|
||||||
const width = getWrapWidth();
|
const width = getWrapWidth();
|
||||||
|
|
||||||
|
// Start with current date and time at the top
|
||||||
|
const now = new Date();
|
||||||
|
const dateTimeFormatted = now.toLocaleString('en-US', {
|
||||||
|
weekday: 'long',
|
||||||
|
year: 'numeric',
|
||||||
|
month: 'long',
|
||||||
|
day: 'numeric',
|
||||||
|
hour: '2-digit',
|
||||||
|
minute: '2-digit',
|
||||||
|
timeZoneName: 'short',
|
||||||
|
});
|
||||||
|
|
||||||
|
console.log('');
|
||||||
|
console.log(wrapText(`📅 ${dateTimeFormatted}`, width));
|
||||||
|
console.log(makeLine('─', width));
|
||||||
|
|
||||||
// Extract overviews for user display - get more to show session grouping
|
// Extract overviews for user display - get more to show session grouping
|
||||||
const overviews = extractOverviews(recentObjects, 10, projectName);
|
const overviews = extractOverviews(recentObjects, 10, projectName);
|
||||||
|
|
||||||
|
// Debug: Log what we're getting
|
||||||
|
console.error(`[DEBUG] recentObjects has ${recentObjects.length} items`);
|
||||||
|
console.error(`[DEBUG] overviews extracted: ${overviews.length}`);
|
||||||
|
|
||||||
// Process memory entries for Claude context
|
// Process memory entries for Claude context
|
||||||
const memories = processMemoryEntries(recentObjects);
|
const memories = processMemoryEntries(recentObjects);
|
||||||
// Helper to split and normalize keywords into a map (lowercased -> original)
|
// Helper to split and normalize keywords into a map (lowercased -> original)
|
||||||
@@ -614,11 +634,11 @@ export function outputSessionStartContent(params: {
|
|||||||
if (overviews.length > 0) {
|
if (overviews.length > 0) {
|
||||||
const sessionGroups = groupOverviewsBySession(overviews);
|
const sessionGroups = groupOverviewsBySession(overviews);
|
||||||
|
|
||||||
// Sort groups by timestamp, newest first
|
// Sort groups by timestamp, oldest first for chronological reading order
|
||||||
sessionGroups.sort((a, b) => {
|
sessionGroups.sort((a, b) => {
|
||||||
const timeA = a.earliestTimestamp?.getTime() || 0;
|
const timeA = a.earliestTimestamp?.getTime() || 0;
|
||||||
const timeB = b.earliestTimestamp?.getTime() || 0;
|
const timeB = b.earliestTimestamp?.getTime() || 0;
|
||||||
return timeB - timeA; // Descending order (newest first)
|
return timeA - timeB; // Ascending order (oldest first)
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log('');
|
console.log('');
|
||||||
|
|||||||
Reference in New Issue
Block a user