@aiplumber/session-recall 1.8.4 → 1.8.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/session-recall +22 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aiplumber/session-recall",
3
- "version": "1.8.4",
3
+ "version": "1.8.5",
4
4
  "description": "Pull context from previous Claude Code sessions. Sessions end, context resets - this tool lets you continue where you left off.",
5
5
  "bin": {
6
6
  "session-recall": "./session-recall"
package/session-recall CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- const VERSION = '1.8.4';
3
+ const VERSION = '1.8.5';
4
4
 
5
5
  const fs = require('fs');
6
6
  const path = require('path');
@@ -39,7 +39,28 @@ const TANGENT_START_PATTERN = /@@SESSION-TANGENT-START@@\s+"([^"]*)"\s+uuid=(\S+
39
39
  const TANGENT_END_PATTERN = /@@SESSION-TANGENT-END@@\s+start_uuid=(\S+)\s+end_uuid=(\S+)\s+ts=(\S+)/;
40
40
  // Groups: [1]=start_uuid, [2]=end_uuid, [3]=timestamp
41
41
 
42
+ // Size thresholds for large file warnings
43
+ const LARGE_FILE_WARNING_MB = 100;
44
+ const LARGE_FILE_DANGER_MB = 300;
45
+
42
46
  function readJsonl(filePath) {
47
+ // Check file size before loading
48
+ try {
49
+ const stats = fs.statSync(filePath);
50
+ const sizeMB = stats.size / (1024 * 1024);
51
+
52
+ if (sizeMB > LARGE_FILE_DANGER_MB) {
53
+ console.error(`[session-recall] ERROR: File is ${sizeMB.toFixed(0)}MB - too large, will crash.`);
54
+ console.error(`Tip: Use 'session-recall last 1 --compactions' for just current phase`);
55
+ console.error(`Or: NODE_OPTIONS="--max-old-space-size=8192" session-recall ...`);
56
+ process.exit(1);
57
+ } else if (sizeMB > LARGE_FILE_WARNING_MB) {
58
+ console.error(`[session-recall] WARNING: ${sizeMB.toFixed(0)}MB file - may be slow`);
59
+ }
60
+ } catch (e) {
61
+ // Ignore stat errors, let readFileSync handle them
62
+ }
63
+
43
64
  const content = fs.readFileSync(filePath, 'utf-8');
44
65
  return content.trim().split('\n').map((line) => {
45
66
  try {