Skip to content

Commit 35b7aab

Browse files
committed
Release v3.6.10
Published from npm package build Source: https://github.com/thedotmack/claude-mem-source
1 parent 2601215 commit 35b7aab

7 files changed

Lines changed: 118 additions & 90 deletions

File tree

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,17 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
66

77

8+
## [3.6.10] - 2025-09-16
9+
10+
### Added
11+
- Claude Code statusline integration for real-time memory status
12+
- MCP memory tools server providing compress, stats, search, and overview commands
13+
- Concept documentation explaining memory compression and context loading
14+
15+
### Fixed
16+
- Corrected integration architecture to use hooks instead of MCP SDK
17+
18+
819
## [3.6.9] - 2025-09-14
920

1021
### Added

dist/claude-mem.min.js

Lines changed: 76 additions & 75 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "claude-mem",
3-
"version": "3.6.9",
3+
"version": "3.6.10",
44
"description": "Memory compression system for Claude Code - persist context across sessions",
55
"keywords": [
66
"claude",

src/commands/load-context.ts

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,21 @@ import {
1010
outputSessionStartContent
1111
} from '../prompts/templates/context/ContextTemplates.js';
1212

13-
interface IndexEntry {
14-
summary: string;
15-
entity: string;
16-
keywords: string[];
17-
}
18-
1913
interface TrashStatus {
2014
folderCount: number;
2115
fileCount: number;
2216
totalSize: number;
2317
isEmpty: boolean;
2418
}
2519

20+
function buildProjectMatcher(projectName: string): (value?: string) => boolean {
21+
const aliases = new Set<string>();
22+
aliases.add(projectName);
23+
aliases.add(projectName.replace(/-/g, '_'));
24+
aliases.add(projectName.replace(/_/g, '-'));
25+
return (value?: string) => !!value && aliases.has(value);
26+
}
27+
2628
function formatSize(bytes: number): string {
2729
if (bytes === 0) return '0 B';
2830
const k = 1024;
@@ -115,20 +117,25 @@ export async function loadContext(options: OptionValues = {}): Promise<void> {
115117
const sessions = jsonObjects.filter(obj => obj.type === 'session');
116118

117119
// Filter each type by project if specified
120+
// Handle both hyphen and underscore formats since index has mixed entries
118121
let filteredMemories = memories;
119122
let filteredOverviews = overviews;
123+
let filteredSessions = sessions;
120124
if (options.project) {
121-
filteredMemories = memories.filter(obj => obj.project === options.project);
122-
filteredOverviews = overviews.filter(obj => obj.project === options.project);
125+
const matchesProject = buildProjectMatcher(options.project);
126+
filteredMemories = memories.filter(obj => matchesProject(obj.project));
127+
filteredOverviews = overviews.filter(obj => matchesProject(obj.project));
128+
filteredSessions = sessions.filter(obj => matchesProject(obj.project));
123129
}
124130

125131
if (options.format === 'session-start') {
126132
// Get last 10 memories and last 5 overviews for session-start
127133
const recentMemories = filteredMemories.slice(-10);
128134
const recentOverviews = filteredOverviews.slice(-5);
135+
const recentSessions = filteredSessions.slice(-5);
129136

130137
// Combine them for the display
131-
const recentObjects = [...recentMemories, ...recentOverviews];
138+
const recentObjects = [...recentSessions, ...recentMemories, ...recentOverviews];
132139

133140
// Find most recent timestamp for last session info
134141
let lastSessionTime = 'recently';
@@ -195,4 +202,4 @@ export async function loadContext(options: OptionValues = {}): Promise<void> {
195202
console.log(createUserFriendlyError('Context loading', errorMessage, 'Check file permissions and try again'));
196203
}
197204
}
198-
}
205+
}

src/commands/save.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ function generateSessionId(message: string): string {
2828
* Save command - stores a message to both Chroma collection and JSONL index
2929
*/
3030
export async function save(message: string, options: OptionValues = {}): Promise<void> {
31+
// Debug: Log what we receive
32+
appendFileSync('/Users/alexnewman/.claude-mem/save-debug.log',
33+
`[${new Date().toISOString()}] Received message: "${message}" (type: ${typeof message}, length: ${message?.length})\n`,
34+
'utf8');
35+
3136
if (!message || message.trim() === '') {
3237
console.error('Error: Message is required');
3338
process.exit(1);

src/core/orchestration/PromptOrchestrator.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,8 @@ export class PromptOrchestrator {
191191
projectName = this.projectName,
192192
} = context;
193193

194-
// Extract project prefix from project name (convert to snake_case)
195-
const projectPrefix = projectName.replace(/[-\s]/g, '_').toLowerCase();
194+
// Use project name as-is for consistency with directory names
195+
const projectPrefix = projectName;
196196

197197
// Use the simple prompt with the transcript included
198198
return createAnalysisPrompt(

src/prompts/templates/context/ContextTemplates.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -578,6 +578,10 @@ export function outputSessionStartContent(params: {
578578
// Extract overviews for user display - get more to show session grouping
579579
const overviews = extractOverviews(recentObjects, 10, projectName);
580580

581+
// Debug: Log what we're getting
582+
console.error(`[DEBUG] recentObjects has ${recentObjects.length} items`);
583+
console.error(`[DEBUG] overviews extracted: ${overviews.length}`);
584+
581585
// Process memory entries for Claude context
582586
const memories = processMemoryEntries(recentObjects);
583587
// Helper to split and normalize keywords into a map (lowercased -> original)
@@ -630,11 +634,11 @@ export function outputSessionStartContent(params: {
630634
if (overviews.length > 0) {
631635
const sessionGroups = groupOverviewsBySession(overviews);
632636

633-
// Sort groups by timestamp, newest first
637+
// Sort groups by timestamp, oldest first for chronological reading order
634638
sessionGroups.sort((a, b) => {
635639
const timeA = a.earliestTimestamp?.getTime() || 0;
636640
const timeB = b.earliestTimestamp?.getTime() || 0;
637-
return timeB - timeA; // Descending order (newest first)
641+
return timeA - timeB; // Ascending order (oldest first)
638642
});
639643

640644
console.log('');

0 commit comments

Comments
 (0)