Compare commits

...

9 Commits

Author SHA1 Message Date
Alex Newman 92c4d245c4 chore: bump version to 9.0.4
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-10 18:24:02 -05:00
Alex Newman a2ab45a461 feat: move development commands to plugin distribution (#666)
* feat: move development commands to plugin distribution

Move /do, /make-plan, and /anti-pattern-czar commands from project-level
.claude/commands/ to plugin/commands/ so they are distributed with the
plugin and available to all users as /claude-mem:do, /claude-mem:make-plan,
and /claude-mem:anti-pattern-czar.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* chore: Update CLAUDE.md and package version; fix bugs and enhance tests

- Updated CLAUDE.md to reflect changes and new entries for January 2026.
- Bumped package version from 9.0.2 to 9.0.3 in package.json.
- Refactored worker-service.cjs for improved error handling and process management.
- Added new bugfix documentation for critical issues identified on January 10, 2026.
- Cleaned up integration test logs and removed outdated entries in tests/integration/CLAUDE.md.
- Updated server test documentation to reflect recent changes and removed old entries.
- Enhanced hook response patterns and added new entries in hooks/CLAUDE.md.

* fix: keep anti-pattern-czar as internal dev tool

The anti-pattern-czar command relies on scripts that only exist in
the claude-mem development repository, so it shouldn't be distributed
with the plugin. Moving it back to .claude/commands/ for internal use.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-10 18:22:08 -05:00
Nastenka 1d68e299dc Revise Arabic README for clarity and corrections (#661)
Updated the Arabic README to improve clarity and fix translation errors.
2026-01-10 15:31:56 -05:00
Alex Newman b987789754 docs: update CHANGELOG.md for v9.0.3 2026-01-10 03:13:52 -05:00
Alex Newman e91868a7f6 chore: bump version to 9.0.3 2026-01-10 03:13:18 -05:00
Alex Newman 644cccd3e1 fix(worker): add JSON status output for hook framework (#655)
* fix(worker): add JSON status output for hook framework (#638)

Adds JSON output before all process.exit() calls in the start command
so Claude Code's hook framework can track worker startup progress.

- Add exitWithStatus() helper function
- Output {"continue":true,"suppressOutput":true,"status":"ready"|"error"}
- Maintains exit code 0 for Windows Terminal compatibility

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* test(worker): add unit tests for buildStatusOutput function

Extract buildStatusOutput() as pure function for testability and add
comprehensive unit tests validating JSON structure for hook framework.

Tests cover:
- Ready/error status variants
- Required fields (continue, suppressOutput, status)
- Optional message field inclusion logic
- Edge cases (empty strings, special characters, long messages)
- JSON serialization roundtrip

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* test(worker): add CLI output capture tests for start command

Add integration tests that spawn actual worker-service start command
and verify JSON output matches hook framework contract.

Tests:
- Valid JSON with required fields (continue, suppressOutput, status)
- JSON structure matches expected format when worker healthy
- Skipped placeholders for error scenarios requiring complex setup

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* test(worker): add Claude Code hook framework compatibility tests

Add contract tests documenting the hook framework requirements:
- Exit code 0 (Windows Terminal compatibility)
- JSON output on stdout (not stderr)
- Valid JSON structure with required fields
- Critical 'continue: true' for Claude Code to proceed
- 'suppressOutput: true' for transcript mode

These tests serve as living documentation of the hook output contract,
explaining both WHAT and WHY for each requirement.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-10 03:11:42 -05:00
Alex Newman e6df88bf42 chore: remove error handling baseline file 2026-01-09 23:20:15 -05:00
Alex Newman ef823a89c1 build assets 2026-01-09 23:19:25 -05:00
Alex Newman b169e18de0 docs: update CHANGELOG.md for v9.0.2 2026-01-09 23:18:08 -05:00
21 changed files with 789 additions and 1089 deletions
+1 -1
View File
@@ -10,7 +10,7 @@
"plugins": [
{
"name": "claude-mem",
"version": "9.0.2",
"version": "9.0.4",
"source": "./plugin",
"description": "Persistent memory system for Claude Code - context compression across sessions"
}
+2 -20
View File
@@ -3,27 +3,9 @@
<!-- This section is auto-generated by claude-mem. Edit content outside the tags. -->
### Dec 21, 2025
### Nov 3, 2025
**test-analysis-report.md**
| ID | Time | T | Title | Read |
|----|------|---|-------|------|
| #31743 | 10:36 PM | 🔵 | PR #412 proposes mode system with inheritance and multilingual support | ~523 |
### Dec 22, 2025
**test-analysis-report.md**
| ID | Time | T | Title | Read |
|----|------|---|-------|------|
| #31865 | 6:56 PM | ✅ | 開発ドキュメントのクリーンアップをコミット | ~150 |
| #31864 | " | ✅ | 計画ドキュメントと分析ファイルの削除 | ~142 |
| #31859 | 6:55 PM | ✅ | 計画ドキュメントファイルの削除 | ~109 |
| #31855 | 6:53 PM | ✅ | テストスイートの大規模削除とテスト分析レポートの追加 | ~197 |
### Dec 25, 2025
**settings.json**
| ID | Time | T | Title | Read |
|----|------|---|-------|------|
| #32602 | 8:42 PM | 🔵 | Identified potential settings configuration files | ~224 |
| #3366 | 3:40 PM | 🔵 | Claude Mem MCP Search Architecture and Timeline Tool Capabilities | ~438 |
</claude-mem-context>
+7 -21
View File
@@ -5,30 +5,16 @@
### Oct 25, 2025
**changelog.md**
| ID | Time | T | Title | Read |
|----|------|---|-------|------|
| #2491 | 10:59 PM | 🟣 | Added changelog viewer slash command | ~290 |
| #2484 | 6:33 PM | 🔴 | Removed slash commands from incorrect root .claude/commands directory | ~268 |
### Jan 10, 2026
**terminal-shortcut.md**
| ID | Time | T | Title | Read |
|----|------|---|-------|------|
| #2480 | 6:32 PM | 🟣 | Cross-platform terminal shortcut command for claude-mem CLI | ~459 |
**setup-alias.md**
| ID | Time | T | Title | Read |
|----|------|---|-------|------|
| #2479 | 6:29 PM | 🟣 | Shell Alias Setup Slash Command | ~423 |
**version-bump.md**
| ID | Time | T | Title | Read |
|----|------|---|-------|------|
| #2358 | 1:07 PM | 🟣 | Created version-bump slash command for automated version updates | ~361 |
### Jan 1, 2026
**anti-pattern-czar.md**
| ID | Time | T | Title | Read |
|----|------|---|-------|------|
| #35638 | 11:17 PM | 🟣 | Anti-Pattern Czar Custom Command Created | ~583 |
| #39054 | 3:45 PM | 🔄 | Development commands removed from root .claude directory | ~249 |
| #39053 | " | 🟣 | Added development commands to plugin distribution | ~276 |
| #39051 | 3:44 PM | 🔵 | Development commands confirmed in .claude/commands/ | ~315 |
| #39049 | " | 🔵 | Development commands located in .claude/commands/ directory | ~293 |
</claude-mem-context>
+38 -24
View File
@@ -2,6 +2,44 @@
All notable changes to claude-mem.
## [v9.0.3] - 2026-01-10
## Bug Fixes
### Hook Framework JSON Status Output (#655)
Fixed an issue where the worker service startup wasn't producing proper JSON status output for the Claude Code hook framework. This caused hooks to appear stuck or unresponsive during worker initialization.
**Changes:**
- Added `buildStatusOutput()` function for generating structured JSON status output
- Worker now outputs JSON with `status`, `message`, and `continue` fields on stdout
- Proper exit code 0 ensures Windows Terminal compatibility (no tab accumulation)
- `continue: true` flag ensures Claude Code continues processing after hook execution
**Technical Details:**
- Extracted status output generation into a pure, testable function
- Added comprehensive test coverage in `tests/infrastructure/worker-json-status.test.ts`
- 23 passing tests covering unit, CLI integration, and hook framework compatibility
## Housekeeping
- Removed obsolete error handling baseline file
## [v9.0.2] - 2026-01-10
## Bug Fixes
- **Windows Terminal Tab Accumulation (#625, #628)**: Fixed terminal tab accumulation on Windows by implementing graceful exit strategy. All expected failure scenarios (port conflicts, version mismatches, health check timeouts) now exit with code 0 instead of code 1.
- **Windows 11 Compatibility (#625)**: Replaced deprecated WMIC commands with PowerShell `Get-Process` and `Get-CimInstance` for process enumeration. WMIC is being removed from Windows 11.
## Maintenance
- **Removed Obsolete CLAUDE.md Files**: Cleaned up auto-generated CLAUDE.md files from `~/.claude/plans/` and `~/.claude/plugins/marketplaces/` directories.
---
**Full Changelog**: https://github.com/thedotmack/claude-mem/compare/v9.0.1...v9.0.2
## [v9.0.1] - 2026-01-08
## Bug Fixes
@@ -1265,27 +1303,3 @@ Fixed unbounded database growth in the `pending_messages` table by implementing
**Full Changelog**: https://github.com/thedotmack/claude-mem/compare/v7.2.4...v7.3.0
## [v7.2.4] - 2025-12-15
## What's Changed
### Documentation
- Updated endless mode setup instructions with improved configuration guidance for better user experience
**Full Changelog**: https://github.com/thedotmack/claude-mem/compare/v7.2.3...v7.2.4
## [v7.2.3] - 2025-12-15
## Bug Fixes
- **Fix MCP server failures on plugin updates**: Add 2-second pre-restart delay in `ensureWorkerVersionMatches()` to give files time to sync before killing the old worker. This prevents the race condition where the worker restart happened too quickly after plugin file updates, causing "Worker service connection failed" errors.
## Changes
- Add `PRE_RESTART_SETTLE_DELAY` constant (2000ms) to `hook-constants.ts`
- Add delay before `ProcessManager.restart()` call in `worker-utils.ts`
- Fix pre-existing bug where `port` variable was undefined in error logging
---
🤖 Generated with [Claude Code](https://claude.com/claude-code)
+52 -46
View File
@@ -1,5 +1,4 @@
🌐 هذه ترجمة آلية. نرحب بالتصحيحات من المجتمع!
<section dir="rtl">
<h1 align="center">
<br>
<a href="https://github.com/thedotmack/claude-mem">
@@ -43,7 +42,8 @@
<a href="README.no.md">🇳🇴 Norsk</a>
</p>
<h4 align="center">نظام ضغط الذاكرة المستمرة المبني لـ <a href="https://claude.com/claude-code" target="_blank">Claude Code</a>.</h4>
<h4 align="center">أداة إضافية لـ <a href="https://claude.com/claude-code" target="_blank">Claude Code</a> تعمل على أتمتة تسجيل معلومات الجلسات السابقه، وضغطها, ثم حقن السياق ذي الصلة في الجلسات المستقبلية.
</h4>
<p align="center">
<a href="LICENSE">
@@ -80,25 +80,27 @@
</a>
</p>
<p align="center">
<a href="#البدء-السريع">البدء السريع</a> •
<a href="#كيف-يعمل">كيف يعمل</a> •
<a href="#أدوات-البحث-mcp">أدوات البحث</a> •
<a href="#التوثيق">التوثيق</a> •
<a href="#الإعدادات">الإعدادات</a> •
<a href="#استكشاف-الأخطاء-وإصلاحها">استكشاف الأخطاء وإصلاحها</a> •
<a href="#الترخيص">الترخيص</a>
</p>
<p align="center">
يحافظ Claude-Mem بسلاسة على السياق عبر الجلسات من خلال التقاط الملاحظات حول استخدام الأدوات تلقائيًا، وإنشاء ملخصات دلالية، وإتاحتها للجلسات المستقبلية. هذا يمكّن Claude من الحفاظ على استمرارية المعرفة حول المشاريع حتى بعد انتهاء الجلسات أو إعادة الاتصال.
<a href="#بداية-سريعة">بداية سريعة</a> •
<a href="#كيف-يعمل">كيف يعمل</a> •
<a href="#أدوات-البحث-mcp-search-tools">أدوات البحث</a> •
<a href="#المستندات">التوثيق</a> •
<a href="#الإعدادات">الإعدادات</a> •
<a href="#استكشاف-الأخطاء-وإصلاحها">استكشاف الأخطاء وإصلاحها</a> •
<a href="#الترخيص-license">الترخيص</a>
</p>
<p align="center" dir="rtl">
Claude-Mem هو نظام متطور مصمم لضغط وحفظ الذاكرة لسياق عمل Claude Code. وظيفته الأساسية هي جعل "كلود" يتذكر ما فعله في جلسات العمل السابقة بسلاسة، عبر تسجيل تحركاته، وإنشاء ملخصات ذكية، واستدعائها في الجلسات المستقبلية. هذا يضمن عدم ضياع سياق المشروع حتى لو أغلقت البرنامج وفتحته لاحقاً.
</p>
---
## البدء السريع
## بداية سريعة
ابدأ جلسة Claude Code جديدة في الطرفية وأدخل الأوامر التالية:
للبدء، افتح "Claude Code" في مبنى الأوامر (Terminal) واكتب الأوامر التالية:
<div dir="ltr" align="left">
```
> /plugin marketplace add thedotmack/claude-mem
@@ -106,24 +108,26 @@
> /plugin install claude-mem
```
أعد تشغيل Claude Code. سيظهر السياق من الجلسات السابقة تلقائيًا في الجلسات الجديدة.
</div>
بمجرد إعادة تشغيل Claude Code، سيتم استدعاء السياق من الجلسات السابقة تلقائيا عند الحاجة.
**الميزات الرئيسية:**
- 🧠 **ذاكرة مستمرة** - يبقى السياق عبر الجلسات
- 📊 **الكشف التدريجي** - استرجاع الذاكرة بطبقات مع رؤية تكلفة الرموز
- 🔍 **بحث قائم على المهارات** - استعلم عن تاريخ مشروعك باستخدام مهارة mem-search
- 🖥️ **واجهة مستخدم ويب** - بث الذاكرة المباشر على http://localhost:37777
- 💻 **مهارة Claude Desktop** - ابحث في الذاكرة من محادثات Claude Desktop
- 🔒 **التحكم في الخصوصية** - استخدم وسوم `<private>` لاستبعاد المحتوى الحساس من التخزين
- ⚙️ **إعدادات السياق** - تحكم دقيق في السياق الذي يتم حقنه
- 🤖 **تشغيل تلقائي** - لا يتطلب تدخلاً يدويًا
- 🔗 **الاستشهادات** - رجوع إلى الملاحظات السابقة باستخدام المعرفات (الوصول عبر http://localhost:37777/api/observation/{id} أو عرض الكل في عارض الويب على http://localhost:37777)
- 🧪 **قناة تجريبية** - جرّب الميزات التجريبية مثل Endless Mode عبر تبديل الإصدار
- 🧠 **ذاكرة مستديمه**: سياق عملك لا ينتهي بانتهاء الجلسة، بل ينتقل معك للجلسة التالية.
- 📊 **الكشف التدريجي** (Progressive Disclosure): نظام ذكي يستدعي المعلومات على طبقات، مما يمنحك رؤية واضحة لاستهلاك الـ "Tokens" (التكلفة).
- 🔍 **بحث سريع** - استعلم عن سجل مشروعك باستخدام خاصية `mem-search`.
- 🖥️ **واجهة مستخدم ويب** - رؤية معلومات الذاكرة مع تحديث فوري عبر المتصفح من خلال الرابط: http://localhost:37777
- 💻 **تكامل مع Claude Desktop** - إمكانية البحث في الذاكرة مباشرة من واجهة Claude المكتبية
- 🔒 **التحكم في الخصوصية** - دعم وسم `<private>` لمنع النظام من تخزين أي معلومات حساسة.
- ⚙️ **إعدادات السياق** - تحكم دقيق في السياق (context) التي سيتم حقنها في سياق المحادثة.
- 🤖 **أتمتة كاملة:** - النظام يعمل في الخلفية دون الحاجة لتدخل يدوي منك.
- 🔗 **الاستشهادات** - رجوع إلى الملاحظات السابقة باستخدام (http://localhost:37777/api/observation/{id} أو عرض جميع المعلومات على http://localhost:37777)
- 🧪 **مزايا التجريبيه** - تجربة مميزات مثل "الوضع اللانهائي" (Endless Mode).
---
## التوثيق
## المستندات
📚 **[عرض التوثيق الكامل](docs/)** - تصفح مستندات markdown على GitHub
@@ -131,7 +135,7 @@
- **[دليل التثبيت](https://docs.claude-mem.ai/installation)** - البدء السريع والتثبيت المتقدم
- **[دليل الاستخدام](https://docs.claude-mem.ai/usage/getting-started)** - كيف يعمل Claude-Mem تلقائيًا
- **[أدوات البحث](https://docs.claude-mem.ai/usage/search-tools)** - استعلم عن تاريخ مشروعك باللغة الطبيعية
- **[أدوات البحث](https://docs.claude-mem.ai/usage/search-tools)** - استعلم عن سجل مشروعك بلغتك
- **[الميزات التجريبية](https://docs.claude-mem.ai/beta-features)** - جرّب الميزات التجريبية مثل Endless Mode
### أفضل الممارسات
@@ -142,9 +146,9 @@
### البنية المعمارية
- **[نظرة عامة](https://docs.claude-mem.ai/architecture/overview)** - مكونات النظام وتدفق البيانات
- **[تطور البنية المعمارية](https://docs.claude-mem.ai/architecture-evolution)** - الرحلة من v3 إلى v5
- **[بنية الخطافات](https://docs.claude-mem.ai/hooks-architecture)** - كيف يستخدم Claude-Mem خطافات دورة الحياة
- **[مرجع الخطافات](https://docs.claude-mem.ai/architecture/hooks)** - شرح 7 سكريبتات خطافات
- **[تطور البنية المعمارية](https://docs.claude-mem.ai/architecture-evolution)** - تطور المعمارية من v3 إلى v5
- **[بنية برامج الربط (Hooks)](https://docs.claude-mem.ai/hooks-architecture)** - كيف يستخدم Claude-Mem خطافات دورة الحياة
- **[مرجع برامج الربط (Hooks)](https://docs.claude-mem.ai/architecture/hooks)** - شرح 7 سكريبتات خطافات
- **[خدمة العامل](https://docs.claude-mem.ai/architecture/worker-service)** - HTTP API وإدارة Bun
- **[قاعدة البيانات](https://docs.claude-mem.ai/architecture/database)** - مخطط SQLite وبحث FTS5
- **[بنية البحث](https://docs.claude-mem.ai/architecture/search-architecture)** - البحث المختلط مع قاعدة بيانات المتجهات Chroma
@@ -161,24 +165,23 @@
**المكونات الأساسية:**
1. **5 خطافات دورة الحياة** - SessionStart، UserPromptSubmit، PostToolUse، Stop، SessionEnd (6 سكريبتات خطافات)
2. **تثبيت ذكي** - فاحص التبعيات المخزنة مؤقتًا (سكريبت ما قبل الخطاف، ليس خطاف دورة حياة)
1. **5 برامج ربط (Hooks)** - SessionStart، UserPromptSubmit، PostToolUse، Stop، SessionEnd
2. **تثبيت ذكي** - فاحص التبعيات المخزنة مؤقتًا
3. **خدمة العامل** - HTTP API على المنفذ 37777 مع واجهة مستخدم عارض الويب و10 نقاط نهاية للبحث، تديرها Bun
4. **قاعدة بيانات SQLite** - تخزن الجلسات، الملاحظات، الملخصات
5. **مهارة mem-search** - استعلامات اللغة الطبيعية مع الكشف التدريجي
6. **قاعدة بيانات المتجهات Chroma** - البحث المختلط الدلالي + الكلمات المفتاحية لاسترجاع السياق الذكي
6. **قاعدة بيانات المتجهات Chroma** - البحث الدلالي الهجين + الكلمات المفتاحية لاسترجاع السياق الذكي
انظر [نظرة عامة على البنية المعمارية](https://docs.claude-mem.ai/architecture/overview) للتفاصيل.
---
## مهارة mem-search
## أدوات البحث (MCP Search Tools)
يوفر Claude-Mem بحثًا ذكيًا من خلال مهارة mem-search التي تُستدعى تلقائيًا عندما تسأل عن العمل السابق:
**كيف يعمل:**
- فقط اسأل بشكل طبيعي: *"ماذا فعلنا في الجلسة الأخيرة؟"* أو *"هل أصلحنا هذا الخطأ من قبل؟"*
- يستدعي Claude تلقائيًا مهارة mem-search للعثور على السياق ذي الصلة
- يستدعي Claude تلقائيًا خاصية mem-search للعثور على السياق ذي الصلة
**عمليات البحث المتاحة:**
@@ -193,7 +196,7 @@
9. **الجدول الزمني حسب الاستعلام** - البحث عن الملاحظات والحصول على سياق الجدول الزمني حول أفضل تطابق
10. **مساعدة API** - الحصول على توثيق API البحث
**أمثلة على استعلامات اللغة الطبيعية:**
**أمثلة على الاستعلامات:**
```
"What bugs did we fix last session?"
@@ -219,8 +222,7 @@
- **Node.js**: 18.0.0 أو أعلى
- **Claude Code**: أحدث إصدار مع دعم الإضافات
- **Bun**: بيئة تشغيل JavaScript ومدير العمليات (يُثبت تلقائيًا إذا كان مفقودًا)
- **uv**: مدير حزم Python للبحث المتجهي (يُثبت تلقائيًا إذا كان مفقودًا)
- **Bun & uv**: (يتم تثبيتهما تلقائياً) لإدارة العمليات والبحث المتجه.
- **SQLite 3**: للتخزين المستمر (مدمج)
---
@@ -241,7 +243,7 @@
## استكشاف الأخطاء وإصلاحها
إذا واجهت مشكلات، صِف المشكلة لـ Claude وستقوم مهارة troubleshoot تلقائيًا بتشخيصها وتوفير الإصلاحات.
إذا واجهت مشكلة، اشرحها لـ Claude وسيقوم بتشغيل خاصية troubleshoot لإصلاحها ذاتياً.
انظر **[دليل استكشاف الأخطاء وإصلاحها](https://docs.claude-mem.ai/troubleshooting)** للمشكلات الشائعة والحلول.
@@ -250,27 +252,29 @@
## تقارير الأخطاء
أنشئ تقارير أخطاء شاملة باستخدام المولّد الآلي:
<div align=left>
```bash
cd ~/.claude/plugins/marketplaces/thedotmack
npm run bug-report
```
</div>
## المساهمة
المساهمات مرحب بها! يُرجى:
1. عمل Fork للمستودع
2. إنشاء فرع ميزة
1. عمل Fork للمشروع (Repository)
2. إنشاء فرع (branch)
3. إجراء التغييرات مع الاختبارات
4. تحديث التوثيق
4. تحديث المستندات عند الحاجه
5. تقديم Pull Request
انظر [دليل التطوير](https://docs.claude-mem.ai/development) لسير عمل المساهمة.
---
## الترخيص
## الترخيص (License)
هذا المشروع مرخص بموجب **ترخيص GNU Affero العام الإصدار 3.0** (AGPL-3.0).
@@ -298,4 +302,6 @@ npm run bug-report
---
**مبني باستخدام Claude Agent SDK** | **مدعوم بواسطة Claude Code** | **صُنع باستخدام TypeScript**
**مبني باستخدام Claude Agent SDK** | **مدعوم بواسطة Claude Code** | **صُنع باستخدام TypeScript**
</section>
-688
View File
@@ -1,688 +0,0 @@
🔍 Scanning for error handling anti-patterns...
Found 80 TypeScript files
═══════════════════════════════════════════════════════════════
ERROR HANDLING ANTI-PATTERNS DETECTED
═══════════════════════════════════════════════════════════════
Found 153 anti-patterns:
🔴 CRITICAL: 26
🟠 HIGH: 47
🟡 MEDIUM: 80
🔴 CRITICAL ISSUES (Fix immediately - these cause silent failures):
─────────────────────────────────────────────────────────────
📁 src/utils/transcript-parser.ts:44
❌ NO_LOGGING_IN_CATCH
Catch block has no logging - errors occur invisibly.
Code:
} catch (error) {
// [POSSIBLY RELEVANT]: Parse errors accumulated in parseErrors array for batch access, logging each line would be excessive
this.parseErrors.push({
lineNumber: index + 1,
error: error instanceof Error ? error.message : String(error),
... (2 more lines)
📁 src/shared/timeline-formatting.ts:18
❌ NO_LOGGING_IN_CATCH
Catch block has no logging - errors occur invisibly.
Code:
} catch (err) {
// [POSSIBLY RELEVANT]: Expected JSON parse failures for malformed data fields, too frequent to log
return [];
}
📁 src/shared/paths.ts:105
❌ NO_LOGGING_IN_CATCH
Catch block has no logging - errors occur invisibly.
Code:
} catch (error) {
// [POSSIBLY RELEVANT]: Expected when not in git repo or git unavailable, common fallback path
return basename(process.cwd());
}
📁 src/sdk/prompts.ts:98
❌ NO_LOGGING_IN_CATCH
Catch block has no logging - errors occur invisibly.
Code:
} catch (error) {
// [POSSIBLY RELEVANT]: Expected JSON parse failures for plain string tool inputs, normal fallback
toolInput = obs.tool_input;
}
📁 src/sdk/prompts.ts:105
❌ NO_LOGGING_IN_CATCH
Catch block has no logging - errors occur invisibly.
Code:
} catch (error) {
// [POSSIBLY RELEVANT]: Expected JSON parse failures for plain string tool outputs, normal fallback
toolOutput = obs.tool_output;
}
📁 src/services/worker-service.ts:68
❌ CATCH_AND_CONTINUE_CRITICAL_PATH
Critical path continues after error - may cause silent data corruption.
Code:
} catch (error) {
// [POSSIBLY RELEVANT]: PID file cleanup is non-critical, log full error and continue shutdown
logger.warn('SYSTEM', 'Failed to remove PID file', { path: PID_FILE }, error as Error);
}
📁 src/services/worker-service.ts:131
❌ CATCH_AND_CONTINUE_CRITICAL_PATH
Critical path continues after error - may cause silent data corruption.
Code:
} catch (error) {
// [POSSIBLY RELEVANT]: Context update is non-critical, log full error and continue
logger.warn('CURSOR', 'Failed to update context file', { projectName }, error as Error);
}
📁 src/services/worker-service.ts:152
❌ NO_LOGGING_IN_CATCH
Catch block has no logging - errors occur invisibly.
Code:
} catch (error) {
// [POSSIBLY RELEVANT]: Expected failure when port is free, called frequently for health checks
return false;
}
📁 src/services/worker-service.ts:165
❌ CATCH_AND_CONTINUE_CRITICAL_PATH
Critical path continues after error - may cause silent data corruption.
Code:
} catch (error) {
// [POSSIBLY RELEVANT]: Expected failures during startup health check, will retry
logger.debug('SYSTEM', 'Service not ready yet, will retry', { port }, error as Error);
}
📁 src/services/worker-service.ts:368
❌ CATCH_AND_CONTINUE_CRITICAL_PATH
Critical path continues after error - may cause silent data corruption.
Code:
} catch (error) {
// [POSSIBLY RELEVANT]: Shutdown must complete, log error and exit with failure code
logger.error('SYSTEM', 'Error during shutdown', {}, error as Error);
process.exit(1);
}
📁 src/services/worker-service.ts:623
❌ CATCH_AND_CONTINUE_CRITICAL_PATH
Critical path continues after error - may cause silent data corruption.
Code:
} catch (error) {
// [POSSIBLY RELEVANT]: Process may have already exited during cleanup, expected failure
logger.debug('SYSTEM', 'Failed to kill process, may have already exited', { pid }, error as Error);
}
📁 src/services/worker-service.ts:632
❌ CATCH_AND_CONTINUE_CRITICAL_PATH
Critical path continues after error - may cause silent data corruption.
Code:
} catch (error) {
// [POSSIBLY RELEVANT]: Process may have already exited during cleanup, expected failure
logger.debug('SYSTEM', 'Process already exited', { pid }, error as Error);
}
📁 src/services/worker-service.ts:838
❌ CATCH_AND_CONTINUE_CRITICAL_PATH
Critical path continues after error - may cause silent data corruption.
Code:
} catch (error) {
// Recovery is best-effort - skip failed sessions and continue with others
logger.warn('SYSTEM', `Failed to process session ${sessionDbId}`, {}, error as Error);
result.sessionsSkipped++;
}
📁 src/services/worker-service.ts:987
❌ CATCH_AND_CONTINUE_CRITICAL_PATH
Critical path continues after error - may cause silent data corruption.
Code:
} catch {
// Process may have already exited - continue shutdown
logger.debug('SYSTEM', 'Process already exited during force kill', { pid });
}
📁 src/services/worker-service.ts:1004
❌ NO_LOGGING_IN_CATCH
Catch block has no logging - errors occur invisibly.
Code:
} catch (error) {
// Expected: process has exited
// Not logging - this is called in a tight loop during cleanup
return false;
}
📁 src/services/worker-service.ts:1095
❌ EMPTY_CATCH
Empty catch block - errors are silently swallowed. User will waste hours debugging.
Code:
} catch {
// Start fresh if corrupt
}
📁 src/services/worker-service.ts:1301
❌ EMPTY_CATCH
Empty catch block - errors are silently swallowed. User will waste hours debugging.
Code:
} catch {
// CLI not found
}
📁 src/services/worker-service.ts:1413
❌ CATCH_AND_CONTINUE_CRITICAL_PATH
Critical path continues after error - may cause silent data corruption.
Code:
} catch (error) {
// Start fresh if corrupt
logger.warn('SYSTEM', 'Corrupt mcp.json, creating new config', { path: mcpJsonPath, error: error instanceof Error ? error.message : String(error) });
config = { mcpServers: {} };
}
📁 src/services/worker-service.ts:1670
❌ EMPTY_CATCH
Empty catch block - errors are silently swallowed. User will waste hours debugging.
Code:
} catch {
// Worker not running - that's ok, context will be generated after first session
}
📁 src/services/worker-service.ts:2050
❌ PROMISE_CATCH_NO_LOGGING
Promise .catch() without logging - errors are silently swallowed.
Code:
.catch((error) => {
logger.failure('SYSTEM', 'Worker failed to start', {}, error as Error);
removePidFile();
process.exit(1);
});
📁 src/services/worker/SDKAgent.ts:545
❌ CATCH_AND_CONTINUE_CRITICAL_PATH
Critical path continues after error - may cause silent data corruption.
Code:
} catch (error) {
// [POSSIBLY RELEVANT]: Expected failure when claude not in PATH, falls through to clear error message below
logger.debug('SDK', 'Claude executable auto-detection failed', {}, error as Error);
}
📁 src/services/worker/SearchManager.ts:1403
❌ NO_LOGGING_IN_CATCH
Catch block has no logging - errors occur invisibly.
Code:
} catch (error) {
// [POSSIBLY RELEVANT]: Expected JSON parse failures for plain string file lists, normal fallback
if (summary.files_read.trim()) {
lines.push(`**Files Read:** ${summary.files_read}`);
}
... (1 more lines)
📁 src/services/worker/SearchManager.ts:1418
❌ NO_LOGGING_IN_CATCH
Catch block has no logging - errors occur invisibly.
Code:
} catch (error) {
// [POSSIBLY RELEVANT]: Expected JSON parse failures for plain string file lists, normal fallback
if (summary.files_edited.trim()) {
lines.push(`**Files Edited:** ${summary.files_edited}`);
}
... (1 more lines)
📁 src/services/worker/PaginationHelper.ts:54
❌ NO_LOGGING_IN_CATCH
Catch block has no logging - errors occur invisibly.
Code:
} catch (err) {
// [POSSIBLY RELEVANT]: Expected JSON parse failures for plain string file paths, normal fallback
return filePathsStr;
}
📁 src/services/context-generator.ts:202
❌ NO_LOGGING_IN_CATCH
Catch block has no logging - errors occur invisibly.
Code:
} catch (parseError) {
// [POSSIBLY RELEVANT]: Expected malformed JSON lines in transcript, logging each would be excessive
continue;
}
📁 src/services/context-generator.ts:226
❌ NO_LOGGING_IN_CATCH
Catch block has no logging - errors occur invisibly.
Code:
} catch (error: any) {
if (error.code === 'ERR_DLOPEN_FAILED') {
unlinkSync(VERSION_MARKER_PATH);
} catch (unlinkError) {
// [POSSIBLY RELEVANT]: Marker file may not exist during first run, expected cleanup failure
... (1 more lines)
🟠 HIGH PRIORITY:
─────────────────────────────────────────────────────────────
📁 src/ui/viewer/hooks/useSSE.ts:50 - LARGE_TRY_BLOCK
Try block has 33 lines - too broad. Multiple errors lumped together.
📁 src/ui/viewer/hooks/usePagination.ts:54 - LARGE_TRY_BLOCK
Try block has 19 lines - too broad. Multiple errors lumped together.
📁 src/ui/viewer/hooks/useSettings.ts:64 - LARGE_TRY_BLOCK
Try block has 14 lines - too broad. Multiple errors lumped together.
📁 src/ui/viewer/hooks/useContextPreview.ts:47 - LARGE_TRY_BLOCK
Try block has 11 lines - too broad. Multiple errors lumped together.
📁 src/bin/import-xml-observations.ts:62 - LARGE_TRY_BLOCK
Try block has 12 lines - too broad. Multiple errors lumped together.
📁 src/bin/import-xml-observations.ts:134 - LARGE_TRY_BLOCK
Try block has 15 lines - too broad. Multiple errors lumped together.
📁 src/bin/import-xml-observations.ts:167 - LARGE_TRY_BLOCK
Try block has 13 lines - too broad. Multiple errors lumped together.
📁 src/servers/mcp-server.ts:52 - LARGE_TRY_BLOCK
Try block has 14 lines - too broad. Multiple errors lumped together.
📁 src/servers/mcp-server.ts:97 - LARGE_TRY_BLOCK
Try block has 21 lines - too broad. Multiple errors lumped together.
📁 src/services/sqlite/SessionStore.ts:55 - LARGE_TRY_BLOCK
Try block has 67 lines - too broad. Multiple errors lumped together.
📁 src/services/sqlite/SessionStore.ts:227 - LARGE_TRY_BLOCK
Try block has 38 lines - too broad. Multiple errors lumped together.
📁 src/services/sqlite/SessionStore.ts:346 - LARGE_TRY_BLOCK
Try block has 40 lines - too broad. Multiple errors lumped together.
📁 src/services/sqlite/SessionStore.ts:427 - LARGE_TRY_BLOCK
Try block has 43 lines - too broad. Multiple errors lumped together.
📁 src/services/sqlite/SessionStore.ts:495 - LARGE_TRY_BLOCK
Try block has 15 lines - too broad. Multiple errors lumped together.
📁 src/services/sqlite/SessionStore.ts:532 - LARGE_TRY_BLOCK
Try block has 35 lines - too broad. Multiple errors lumped together.
📁 src/services/sqlite/SessionStore.ts:599 - LARGE_TRY_BLOCK
Try block has 13 lines - too broad. Multiple errors lumped together.
📁 src/services/sqlite/SessionStore.ts:1550 - LARGE_TRY_BLOCK
Try block has 27 lines - too broad. Multiple errors lumped together.
📁 src/services/worker-service.ts:438 - LARGE_TRY_BLOCK
Try block has 16 lines - too broad. Multiple errors lumped together.
📁 src/services/worker-service.ts:526 - LARGE_TRY_BLOCK
Try block has 11 lines - too broad. Multiple errors lumped together.
📁 src/services/worker-service.ts:666 - LARGE_TRY_BLOCK
Try block has 56 lines - too broad. Multiple errors lumped together.
📁 src/services/worker-service.ts:814 - LARGE_TRY_BLOCK
Try block has 15 lines - too broad. Multiple errors lumped together.
📁 src/services/worker-service.ts:1638 - LARGE_TRY_BLOCK
Try block has 24 lines - too broad. Multiple errors lumped together.
📁 src/services/worker-service.ts:1753 - LARGE_TRY_BLOCK
Try block has 28 lines - too broad. Multiple errors lumped together.
📁 src/services/sync/ChromaSync.ts:99 - LARGE_TRY_BLOCK
Try block has 28 lines - too broad. Multiple errors lumped together.
📁 src/services/sync/ChromaSync.ts:344 - LARGE_TRY_BLOCK
Try block has 14 lines - too broad. Multiple errors lumped together.
📁 src/services/sync/ChromaSync.ts:534 - LARGE_TRY_BLOCK
Try block has 32 lines - too broad. Multiple errors lumped together.
📁 src/services/sync/ChromaSync.ts:609 - LARGE_TRY_BLOCK
Try block has 106 lines - too broad. Multiple errors lumped together.
📁 src/services/worker/GeminiAgent.ts:144 - LARGE_TRY_BLOCK
Try block has 76 lines - too broad. Multiple errors lumped together.
📁 src/services/worker/BranchManager.ts:120 - LARGE_TRY_BLOCK
Try block has 13 lines - too broad. Multiple errors lumped together.
📁 src/services/worker/BranchManager.ts:268 - LARGE_TRY_BLOCK
Try block has 21 lines - too broad. Multiple errors lumped together.
📁 src/services/worker/SearchManager.ts:120 - LARGE_TRY_BLOCK
Try block has 43 lines - too broad. Multiple errors lumped together.
📁 src/services/worker/SearchManager.ts:382 - LARGE_TRY_BLOCK
Try block has 13 lines - too broad. Multiple errors lumped together.
📁 src/services/worker/SearchManager.ts:642 - LARGE_TRY_BLOCK
Try block has 22 lines - too broad. Multiple errors lumped together.
📁 src/services/worker/SearchManager.ts:726 - LARGE_TRY_BLOCK
Try block has 18 lines - too broad. Multiple errors lumped together.
📁 src/services/worker/SearchManager.ts:818 - LARGE_TRY_BLOCK
Try block has 14 lines - too broad. Multiple errors lumped together.
📁 src/services/worker/SearchManager.ts:888 - LARGE_TRY_BLOCK
Try block has 16 lines - too broad. Multiple errors lumped together.
📁 src/services/worker/SearchManager.ts:958 - LARGE_TRY_BLOCK
Try block has 16 lines - too broad. Multiple errors lumped together.
📁 src/services/worker/SearchManager.ts:1028 - LARGE_TRY_BLOCK
Try block has 16 lines - too broad. Multiple errors lumped together.
📁 src/services/worker/SearchManager.ts:1098 - LARGE_TRY_BLOCK
Try block has 16 lines - too broad. Multiple errors lumped together.
📁 src/services/worker/SearchManager.ts:1181 - LARGE_TRY_BLOCK
Try block has 17 lines - too broad. Multiple errors lumped together.
📁 src/services/worker/SearchManager.ts:1282 - LARGE_TRY_BLOCK
Try block has 16 lines - too broad. Multiple errors lumped together.
📁 src/services/worker/SearchManager.ts:1493 - LARGE_TRY_BLOCK
Try block has 147 lines - too broad. Multiple errors lumped together.
📁 src/services/worker/SearchManager.ts:1725 - LARGE_TRY_BLOCK
Try block has 15 lines - too broad. Multiple errors lumped together.
📁 src/services/worker/OpenRouterAgent.ts:104 - LARGE_TRY_BLOCK
Try block has 77 lines - too broad. Multiple errors lumped together.
📁 src/services/worker/http/routes/SessionRoutes.ts:151 - LARGE_TRY_BLOCK
Try block has 13 lines - too broad. Multiple errors lumped together.
📁 src/services/worker/http/routes/SessionRoutes.ts:185 - LARGE_TRY_BLOCK
Try block has 20 lines - too broad. Multiple errors lumped together.
📁 src/services/context-generator.ts:182 - LARGE_TRY_BLOCK
Try block has 15 lines - too broad. Multiple errors lumped together.
🟡 MEDIUM PRIORITY:
─────────────────────────────────────────────────────────────
📁 src/ui/viewer/hooks/useStats.ts:13 - GENERIC_CATCH
Catch block handles all errors identically - no error type discrimination.
📁 src/ui/viewer/hooks/useSSE.ts:93 - GENERIC_CATCH
Catch block handles all errors identically - no error type discrimination.
📁 src/ui/viewer/hooks/useTheme.ts:19 - GENERIC_CATCH
Catch block handles all errors identically - no error type discrimination.
📁 src/ui/viewer/hooks/useTheme.ts:64 - GENERIC_CATCH
Catch block handles all errors identically - no error type discrimination.
📁 src/ui/viewer/hooks/usePagination.ts:84 - GENERIC_CATCH
Catch block handles all errors identically - no error type discrimination.
📁 src/ui/viewer/hooks/useContextPreview.ts:31 - GENERIC_CATCH
Catch block handles all errors identically - no error type discrimination.
📁 src/ui/viewer/hooks/useContextPreview.ts:60 - GENERIC_CATCH
Catch block handles all errors identically - no error type discrimination.
📁 src/bin/import-xml-observations.ts:152 - GENERIC_CATCH
Catch block handles all errors identically - no error type discrimination.
📁 src/bin/import-xml-observations.ts:183 - GENERIC_CATCH
Catch block handles all errors identically - no error type discrimination.
📁 src/bin/import-xml-observations.ts:329 - GENERIC_CATCH
Catch block handles all errors identically - no error type discrimination.
📁 src/bin/import-xml-observations.ts:361 - GENERIC_CATCH
Catch block handles all errors identically - no error type discrimination.
📁 src/utils/logger.ts:55 - GENERIC_CATCH
Catch block handles all errors identically - no error type discrimination.
📁 src/utils/logger.ts:74 - GENERIC_CATCH
Catch block handles all errors identically - no error type discrimination.
📁 src/utils/logger.ts:269 - GENERIC_CATCH
Catch block handles all errors identically - no error type discrimination.
📁 src/shared/timeline-formatting.ts:18 - GENERIC_CATCH
Catch block handles all errors identically - no error type discrimination.
📁 src/shared/SettingsDefaultsManager.ts:152 - GENERIC_CATCH
Catch block handles all errors identically - no error type discrimination.
📁 src/shared/paths.ts:105 - GENERIC_CATCH
Catch block handles all errors identically - no error type discrimination.
📁 src/sdk/prompts.ts:98 - GENERIC_CATCH
Catch block handles all errors identically - no error type discrimination.
📁 src/sdk/prompts.ts:105 - GENERIC_CATCH
Catch block handles all errors identically - no error type discrimination.
📁 src/servers/mcp-server.ts:76 - GENERIC_CATCH
Catch block handles all errors identically - no error type discrimination.
📁 src/servers/mcp-server.ts:123 - GENERIC_CATCH
Catch block handles all errors identically - no error type discrimination.
📁 src/servers/mcp-server.ts:269 - GENERIC_CATCH
Catch block handles all errors identically - no error type discrimination.
📁 src/services/sqlite/SessionStore.ts:138 - GENERIC_CATCH
Catch block handles all errors identically - no error type discrimination.
📁 src/services/sqlite/SessionStore.ts:278 - GENERIC_CATCH
Catch block handles all errors identically - no error type discrimination.
📁 src/services/sqlite/SessionStore.ts:399 - GENERIC_CATCH
Catch block handles all errors identically - no error type discrimination.
📁 src/services/sqlite/SessionStore.ts:482 - GENERIC_CATCH
Catch block handles all errors identically - no error type discrimination.
📁 src/services/sqlite/SessionStore.ts:520 - GENERIC_CATCH
Catch block handles all errors identically - no error type discrimination.
📁 src/services/sqlite/SessionStore.ts:575 - GENERIC_CATCH
Catch block handles all errors identically - no error type discrimination.
📁 src/services/sqlite/SessionStore.ts:619 - GENERIC_CATCH
Catch block handles all errors identically - no error type discrimination.
📁 src/services/sqlite/SessionStore.ts:1489 - GENERIC_CATCH
Catch block handles all errors identically - no error type discrimination.
📁 src/services/sqlite/SessionStore.ts:1521 - GENERIC_CATCH
Catch block handles all errors identically - no error type discrimination.
📁 src/services/sqlite/SessionStore.ts:1577 - GENERIC_CATCH
Catch block handles all errors identically - no error type discrimination.
📁 src/services/worker-service.ts:59 - GENERIC_CATCH
Catch block handles all errors identically - no error type discrimination.
📁 src/services/worker-service.ts:68 - GENERIC_CATCH
Catch block handles all errors identically - no error type discrimination.
📁 src/services/worker-service.ts:131 - GENERIC_CATCH
Catch block handles all errors identically - no error type discrimination.
📁 src/services/worker-service.ts:152 - GENERIC_CATCH
Catch block handles all errors identically - no error type discrimination.
📁 src/services/worker-service.ts:165 - GENERIC_CATCH
Catch block handles all errors identically - no error type discrimination.
📁 src/services/worker-service.ts:185 - GENERIC_CATCH
Catch block handles all errors identically - no error type discrimination.
📁 src/services/worker-service.ts:368 - GENERIC_CATCH
Catch block handles all errors identically - no error type discrimination.
📁 src/services/worker-service.ts:623 - GENERIC_CATCH
Catch block handles all errors identically - no error type discrimination.
📁 src/services/worker-service.ts:632 - GENERIC_CATCH
Catch block handles all errors identically - no error type discrimination.
📁 src/services/worker-service.ts:743 - GENERIC_CATCH
Catch block handles all errors identically - no error type discrimination.
📁 src/services/worker-service.ts:838 - GENERIC_CATCH
Catch block handles all errors identically - no error type discrimination.
📁 src/services/worker-service.ts:963 - GENERIC_CATCH
Catch block handles all errors identically - no error type discrimination.
📁 src/services/worker-service.ts:1004 - GENERIC_CATCH
Catch block handles all errors identically - no error type discrimination.
📁 src/services/worker-service.ts:1797 - GENERIC_CATCH
Catch block handles all errors identically - no error type discrimination.
📁 src/services/queue/SessionQueueProcessor.ts:31 - GENERIC_CATCH
Catch block handles all errors identically - no error type discrimination.
📁 src/services/sync/ChromaSync.ts:578 - GENERIC_CATCH
Catch block handles all errors identically - no error type discrimination.
📁 src/services/sync/ChromaSync.ts:808 - GENERIC_CATCH
Catch block handles all errors identically - no error type discrimination.
📁 src/services/worker/SettingsManager.ts:45 - GENERIC_CATCH
Catch block handles all errors identically - no error type discrimination.
📁 src/services/worker/BranchManager.ts:138 - GENERIC_CATCH
Catch block handles all errors identically - no error type discrimination.
📁 src/services/worker/BranchManager.ts:243 - GENERIC_CATCH
Catch block handles all errors identically - no error type discrimination.
📁 src/services/worker/BranchManager.ts:300 - GENERIC_CATCH
Catch block handles all errors identically - no error type discrimination.
📁 src/services/worker/SDKAgent.ts:545 - GENERIC_CATCH
Catch block handles all errors identically - no error type discrimination.
📁 src/services/worker/SearchManager.ts:185 - GENERIC_CATCH
Catch block handles all errors identically - no error type discrimination.
📁 src/services/worker/SearchManager.ts:398 - GENERIC_CATCH
Catch block handles all errors identically - no error type discrimination.
📁 src/services/worker/SearchManager.ts:676 - GENERIC_CATCH
Catch block handles all errors identically - no error type discrimination.
📁 src/services/worker/SearchManager.ts:754 - GENERIC_CATCH
Catch block handles all errors identically - no error type discrimination.
📁 src/services/worker/SearchManager.ts:838 - GENERIC_CATCH
Catch block handles all errors identically - no error type discrimination.
📁 src/services/worker/SearchManager.ts:912 - GENERIC_CATCH
Catch block handles all errors identically - no error type discrimination.
📁 src/services/worker/SearchManager.ts:982 - GENERIC_CATCH
Catch block handles all errors identically - no error type discrimination.
📁 src/services/worker/SearchManager.ts:1052 - GENERIC_CATCH
Catch block handles all errors identically - no error type discrimination.
📁 src/services/worker/SearchManager.ts:1127 - GENERIC_CATCH
Catch block handles all errors identically - no error type discrimination.
📁 src/services/worker/SearchManager.ts:1214 - GENERIC_CATCH
Catch block handles all errors identically - no error type discrimination.
📁 src/services/worker/SearchManager.ts:1311 - GENERIC_CATCH
Catch block handles all errors identically - no error type discrimination.
📁 src/services/worker/SearchManager.ts:1403 - GENERIC_CATCH
Catch block handles all errors identically - no error type discrimination.
📁 src/services/worker/SearchManager.ts:1418 - GENERIC_CATCH
Catch block handles all errors identically - no error type discrimination.
📁 src/services/worker/SearchManager.ts:1700 - GENERIC_CATCH
Catch block handles all errors identically - no error type discrimination.
📁 src/services/worker/SearchManager.ts:1745 - GENERIC_CATCH
Catch block handles all errors identically - no error type discrimination.
📁 src/services/worker/PaginationHelper.ts:54 - GENERIC_CATCH
Catch block handles all errors identically - no error type discrimination.
📁 src/services/worker/http/BaseRouteHandler.ts:28 - GENERIC_CATCH
Catch block handles all errors identically - no error type discrimination.
📁 src/services/worker/http/routes/SettingsRoutes.ts:76 - GENERIC_CATCH
Catch block handles all errors identically - no error type discrimination.
📁 src/services/worker/http/routes/SessionRoutes.ts:165 - GENERIC_CATCH
Catch block handles all errors identically - no error type discrimination.
📁 src/services/worker/SessionManager.ts:208 - GENERIC_CATCH
Catch block handles all errors identically - no error type discrimination.
📁 src/services/worker/SessionManager.ts:256 - GENERIC_CATCH
Catch block handles all errors identically - no error type discrimination.
📁 src/services/domain/ModeManager.ts:146 - GENERIC_CATCH
Catch block handles all errors identically - no error type discrimination.
📁 src/services/domain/ModeManager.ts:163 - GENERIC_CATCH
Catch block handles all errors identically - no error type discrimination.
📁 src/services/domain/ModeManager.ts:173 - GENERIC_CATCH
Catch block handles all errors identically - no error type discrimination.
📁 src/services/context-generator.ts:202 - GENERIC_CATCH
Catch block handles all errors identically - no error type discrimination.
📁 src/services/context-generator.ts:226 - GENERIC_CATCH
Catch block handles all errors identically - no error type discrimination.
═══════════════════════════════════════════════════════════════
REMINDER: Every try-catch must answer these questions:
1. What SPECIFIC error am I catching? (Name it)
2. Show me documentation proving this error can occur
3. Why can't this error be prevented?
4. What will the catch block DO? (Log + rethrow? Fallback?)
5. Why shouldn't this error propagate to the caller?
To approve an anti-pattern, add: // [APPROVED OVERRIDE]: reason
═══════════════════════════════════════════════════════════════
❌ FAILED: 26 critical error handling anti-patterns must be fixed.
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "claude-mem",
"version": "9.0.2",
"version": "9.0.4",
"description": "Memory compression system for Claude Code - persist context across sessions",
"keywords": [
"claude",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "claude-mem",
"version": "9.0.2",
"version": "9.0.4",
"description": "Persistent memory system for Claude Code - seamlessly preserve context across sessions",
"author": {
"name": "Alex Newman"
+2 -57
View File
@@ -3,64 +3,9 @@
<!-- This section is auto-generated by claude-mem. Edit content outside the tags. -->
### Nov 10, 2025
### Jan 10, 2026
| ID | Time | T | Title | Read |
|----|------|---|-------|------|
| #6276 | 12:58 PM | 🔴 | MCP Configuration Path Missing "plugin/" Directory Component | ~418 |
| #6274 | 12:57 PM | 🔵 | Installed MCP Configuration Uses Incorrect Path | ~389 |
| #6270 | " | 🔵 | MCP Search Server Enable/Disable Documentation | ~314 |
| #6253 | 12:55 PM | 🔵 | MCP Configuration Files Are Identical | ~311 |
| #6250 | 12:54 PM | 🔵 | MCP Search Server Connection Failure Reported | ~329 |
| #6249 | " | 🔴 | MCP Enable/Disable Implementation Overcomplicated | ~329 |
| #6244 | 12:50 PM | 🔴 | MCP search configuration persistence fixed in settings UI | ~378 |
| #6225 | 12:44 PM | 🔄 | Renamed MCP Template File from .optional to .template Convention | ~336 |
| #6217 | 12:40 PM | ✅ | MCP Documentation Updated to Reference UI Toggle | ~360 |
| #6214 | 12:39 PM | ✅ | Repository Cleanup - Removed Temporary Documentation Files | ~321 |
| #6201 | 12:28 PM | 🟣 | Created Quick Start Guide for Enabling MCP Search | ~338 |
| #6193 | 12:27 PM | 🟣 | Created Optional MCP Configuration File | ~313 |
| #6190 | " | 🟣 | Created optional MCP configuration file for user-controlled search server enablement | ~364 |
| #6189 | " | 🟣 | Created MCP search server enable/disable documentation | ~307 |
| #6183 | 12:26 PM | 🔵 | MCP Search Server Commented Out in Plugin Configuration | ~322 |
| #6180 | 12:25 PM | 🔵 | MCP configuration file current state | ~127 |
### Dec 10, 2025
| ID | Time | T | Title | Read |
|----|------|---|-------|------|
| #23444 | 2:25 PM | 🟣 | Build Pipeline Execution Successful | ~293 |
### Dec 11, 2025
| ID | Time | T | Title | Read |
|----|------|---|-------|------|
| #24055 | 2:55 PM | ✅ | Build Successful with Bun Runtime Shebangs | ~355 |
### Dec 14, 2025
| ID | Time | T | Title | Read |
|----|------|---|-------|------|
| #26800 | 11:39 PM | ✅ | Version 7.2.3 Build Complete With Worker Restart Fix | ~394 |
| #26766 | 11:30 PM | ⚖️ | Root Cause Identified: Missing Post-Install Worker Restart Trigger in Plugin Update Flow | ~604 |
| #25815 | 5:31 PM | 🔵 | Comprehensive MCP Server and SKILL.md Structure Analysis | ~575 |
| #25813 | " | 🔵 | MCP Server Configuration with Stdio Transport | ~367 |
### Dec 16, 2025
| ID | Time | T | Title | Read |
|----|------|---|-------|------|
| #27555 | 4:48 PM | ✅ | Version bump committed to main branch | ~242 |
| #27554 | " | ✅ | Project built successfully with version 7.3.1 | ~306 |
### Dec 17, 2025
| ID | Time | T | Title | Read |
|----|------|---|-------|------|
| #28922 | 7:28 PM | 🔵 | Plugin MCP Server Configuration for mem-search | ~245 |
### Dec 19, 2025
| ID | Time | T | Title | Read |
|----|------|---|-------|------|
| #30096 | 8:09 PM | 🔵 | Claude-Mem Plugin Includes MCP Server Configuration | ~246 |
| #39048 | 3:44 PM | 🔵 | Plugin directory contains commands folder | ~276 |
</claude-mem-context>
+18
View File
@@ -0,0 +1,18 @@
<claude-mem-context>
# Recent Activity
<!-- This section is auto-generated by claude-mem. Edit content outside the tags. -->
### Oct 25, 2025
| ID | Time | T | Title | Read |
|----|------|---|-------|------|
| #2437 | 4:32 PM | 🟣 | Slash Command Files Created for Quick Settings Toggling | ~478 |
### Jan 10, 2026
| ID | Time | T | Title | Read |
|----|------|---|-------|------|
| #39052 | 3:44 PM | 🟣 | Commands added to plugin distribution | ~268 |
| #39050 | " | 🔵 | Plugin commands directory is empty | ~255 |
</claude-mem-context>
+6
View File
@@ -28,4 +28,10 @@
| ID | Time | T | Title | Read |
|----|------|---|-------|------|
| #32309 | 3:09 PM | 🔵 | Claude-mem hooks system configuration structure | ~435 |
### Jan 9, 2026
| ID | Time | T | Title | Read |
|----|------|---|-------|------|
| #38802 | 5:11 PM | 🔵 | Claude-Mem Hook Configuration Architecture | ~450 |
</claude-mem-context>
+92
View File
@@ -0,0 +1,92 @@
# Bugfix Sprint: 2026-01-10
## Critical Priority (Blocks Users)
### #646 - Plugin bricks Claude Code - stdin fstat EINVAL crash
- **Impact**: Plugin completely bricks Claude Code on Linux. Users cannot recover without manual config editing.
- **Root Cause**: Bun's stdin handling causes fstat EINVAL when reading piped input
- **Related Discussion**: Check if this is a Bun upstream issue
- [ ] Investigate stdin handling in hook scripts
- [ ] Test on Linux with stdin piping
- [ ] Implement fix
### #623 - Crash-recovery loop when memory_session_id not captured
- **Impact**: Infinite loop consuming API tokens, growing queue unbounded
- **Root Cause**: memory_session_id not captured, causes repeated crash-recovery
- [ ] Add null/undefined check for memory_session_id
- [ ] Add circuit breaker for crash-recovery attempts
## High Priority
### #638 - Worker startup missing JSON output causes hooks to appear stuck
- **Impact**: UI appears stuck during worker startup
- [ ] Ensure worker startup emits proper JSON status
- [ ] Add progress feedback to hook output
### #641/#609 - CLAUDE.md files in subdirectories
- **Impact**: CLAUDE.md files scattered throughout project directories
- **Note**: This is a documented feature request that was never implemented (setting exists but doesn't work)
- [ ] Implement the `disableSubdirectoryCLAUDEmd` setting properly
- [ ] Or change default behavior to not create subdirectory files
### #635 - JSON parsing error prevents folder context generation
- **Impact**: Folder context not generating, breaks context injection
- **Root Cause**: String spread instead of array spread
- [ ] Fix the JSON parsing logic
- [ ] Add proper error handling
## Medium Priority
### #582 - Tilde paths create literal ~ directories
- **Impact**: Directories named "~" created instead of expanding to home
- [ ] Use path expansion for tilde in all path operations
- [ ] Audit all path handling code
### #642/#643 - ChromaDB search fails due to initialization timing
- **Impact**: Search fails with JSON parse error
- **Note**: #643 is a duplicate of #642
- [ ] Fix initialization timing issue
- [ ] Add proper async/await handling
### #626 - HealthMonitor hardcodes ~/.claude path
- **Impact**: Fails for users with custom config directories
- [ ] Use configurable path instead of hardcoded ~/.claude
- [ ] Respect CLAUDE_CONFIG_DIR or similar env var
### #598 - Too many messages pollute conversation history
- **Impact**: Hook messages clutter conversation
- [ ] Reduce verbosity of hook messages
- [ ] Make message frequency configurable
## Low Priority (Code Quality)
### #648 - Empty catch blocks swallow JSON parse errors
- [ ] Add proper error logging to catch blocks in SessionSearch.ts
### #649 - Inconsistent logging in CursorHooksInstaller
- [ ] Replace console.log with structured logger
- **Note**: 177 console.log calls across 20 files identified
## Won't Fix / Not a Bug
### #632 - Feature request for disabling CLAUDE.md in subdirectories
- **Note**: Covered by #641 implementation
### #633 - Help request about Cursor integration
- **Note**: Documentation/support issue, not a bug
### #640 - Arabic README translation
- **Note**: Documentation PR, not a bugfix
### #624 - Beta testing strategy proposal
- **Note**: Enhancement proposal, not a bugfix
## Already Fixed in v9.0.2
- Windows Terminal tab accumulation (#625/#628)
- Windows 11 compatibility - WMIC to PowerShell migration
- Claude Code 2.1.1 compatibility + path validation (#614)
---
**Recommended Approach**: Fix #646 first (critical blocker), then #623 (crash loop), then work through high priority issues in order of impact.
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "claude-mem-plugin",
"version": "9.0.1",
"version": "9.0.3",
"private": true,
"description": "Runtime dependencies for claude-mem bundled hooks",
"type": "module",
File diff suppressed because one or more lines are too long
+6 -1
View File
@@ -25,7 +25,6 @@
| #23075 | 6:26 PM | ✅ | Deleted Expired Announcement Code from user-message-hook.ts | ~354 |
| #23074 | " | ✅ | Replaced Verbose Manual Mode Help with Error in cleanup-hook.ts | ~222 |
| #23073 | " | ✅ | Removed cwd from cleanup-hook Debug Logging | ~177 |
| #23072 | " | ✅ | Simplified SessionEndInput Interface in cleanup-hook.ts | ~236 |
### Dec 10, 2025
@@ -97,4 +96,10 @@
| #38173 | 7:25 PM | 🔵 | Standard Hook Response Pattern for Non-SessionStart Hooks | ~343 |
| #38172 | 7:22 PM | 🔵 | Claude Code Hook Output Architecture Clarified - Exit Code Pattern is Correct for User-Only Display | ~523 |
| #38170 | 7:21 PM | 🔵 | User-Message-Hook TypeScript Source Shows Exit Code 1 Strategy for User-Only Display | ~203 |
### Jan 9, 2026
| ID | Time | T | Title | Read |
|----|------|---|-------|------|
| #38783 | 4:59 PM | 🔵 | Standard Hook Response Pattern | ~263 |
</claude-mem-context>
+39 -15
View File
@@ -77,6 +77,30 @@ import { LogsRoutes } from './worker/http/routes/LogsRoutes.js';
// Re-export updateCursorContextForProject for SDK agents
export { updateCursorContextForProject };
/**
* Build JSON status output for hook framework communication.
* This is a pure function extracted for testability.
*
* @param status - 'ready' for successful startup, 'error' for failures
* @param message - Optional error message (only included when provided)
* @returns JSON object with continue, suppressOutput, status, and optionally message
*/
export interface StatusOutput {
continue: true;
suppressOutput: true;
status: 'ready' | 'error';
message?: string;
}
export function buildStatusOutput(status: 'ready' | 'error', message?: string): StatusOutput {
return {
continue: true,
suppressOutput: true,
status,
...(message && { message })
};
}
export class WorkerService {
private server: Server;
private startTime: number = Date.now();
@@ -622,6 +646,14 @@ async function main() {
const command = process.argv[2];
const port = getWorkerPort();
// Helper for JSON status output in 'start' command
// Exit code 0 ensures Windows Terminal doesn't keep tabs open
function exitWithStatus(status: 'ready' | 'error', message?: string): never {
const output = buildStatusOutput(status, message);
console.log(JSON.stringify(output));
process.exit(0);
}
switch (command) {
case 'start': {
if (await waitForHealth(port, 1000)) {
@@ -636,14 +668,12 @@ async function main() {
const freed = await waitForPortFree(port, getPlatformTimeout(15000));
if (!freed) {
logger.error('SYSTEM', 'Port did not free up after shutdown for version mismatch restart', { port });
// Exit gracefully: Windows Terminal won't keep tab open on exit 0
// The wrapper/plugin will handle restart logic if needed
process.exit(0);
exitWithStatus('error', 'Port did not free after version mismatch restart');
}
removePidFile();
} else {
logger.info('SYSTEM', 'Worker already running and healthy');
process.exit(0);
exitWithStatus('ready');
}
}
@@ -653,21 +683,17 @@ async function main() {
const healthy = await waitForHealth(port, getPlatformTimeout(15000));
if (healthy) {
logger.info('SYSTEM', 'Worker is now healthy');
process.exit(0);
exitWithStatus('ready');
}
logger.error('SYSTEM', 'Port in use but worker not responding to health checks');
// Exit gracefully: Windows Terminal won't keep tab open on exit 0
// The wrapper/plugin will handle restart logic if needed
process.exit(0);
exitWithStatus('error', 'Port in use but worker not responding');
}
logger.info('SYSTEM', 'Starting worker daemon');
const pid = spawnDaemon(__filename, port);
if (pid === undefined) {
logger.error('SYSTEM', 'Failed to spawn worker daemon');
// Exit gracefully: Windows Terminal won't keep tab open on exit 0
// The wrapper/plugin will handle restart logic if needed
process.exit(0);
exitWithStatus('error', 'Failed to spawn worker daemon');
}
writePidFile({ pid, port, startedAt: new Date().toISOString() });
@@ -676,13 +702,11 @@ async function main() {
if (!healthy) {
removePidFile();
logger.error('SYSTEM', 'Worker failed to start (health check timeout)');
// Exit gracefully: Windows Terminal won't keep tab open on exit 0
// The wrapper/plugin will handle restart logic if needed
process.exit(0);
exitWithStatus('error', 'Worker failed to start (health check timeout)');
}
logger.info('SYSTEM', 'Worker started successfully');
process.exit(0);
exitWithStatus('ready');
}
case 'stop': {
@@ -0,0 +1,446 @@
/**
* Tests for worker JSON status output structure
*
* Tests the buildStatusOutput pure function extracted from worker-service.ts
* to ensure JSON output matches the hook framework contract.
*
* Also tests CLI output capture for the 'start' command to verify
* actual JSON output matches expected structure.
*
* No mocks needed - tests a pure function directly and captures real CLI output.
*/
import { describe, it, expect } from 'bun:test';
import { spawnSync } from 'child_process';
import { existsSync } from 'fs';
import path from 'path';
import { buildStatusOutput, StatusOutput } from '../../src/services/worker-service.js';
const WORKER_SCRIPT = path.join(__dirname, '../../plugin/scripts/worker-service.cjs');
/**
* Run worker CLI command and return stdout + exit code
* Uses spawnSync for synchronous output capture
*/
function runWorkerStart(): { stdout: string; exitCode: number } {
const result = spawnSync('bun', [WORKER_SCRIPT, 'start'], {
encoding: 'utf-8',
timeout: 60000
});
return { stdout: result.stdout?.trim() || '', exitCode: result.status || 0 };
}
describe('worker-json-status', () => {
describe('buildStatusOutput', () => {
describe('ready status', () => {
it('should return valid JSON with required fields for ready status', () => {
const result = buildStatusOutput('ready');
expect(result.status).toBe('ready');
expect(result.continue).toBe(true);
expect(result.suppressOutput).toBe(true);
});
it('should not include message field when not provided', () => {
const result = buildStatusOutput('ready');
expect(result.message).toBeUndefined();
expect('message' in result).toBe(false);
});
it('should include message field when explicitly provided for ready status', () => {
const result = buildStatusOutput('ready', 'Worker started successfully');
expect(result.status).toBe('ready');
expect(result.message).toBe('Worker started successfully');
});
});
describe('error status', () => {
it('should return valid JSON with required fields for error status', () => {
const result = buildStatusOutput('error');
expect(result.status).toBe('error');
expect(result.continue).toBe(true);
expect(result.suppressOutput).toBe(true);
});
it('should include message field when provided for error status', () => {
const result = buildStatusOutput('error', 'Port in use but worker not responding');
expect(result.status).toBe('error');
expect(result.message).toBe('Port in use but worker not responding');
});
it('should handle various error messages correctly', () => {
const errorMessages = [
'Port did not free after version mismatch restart',
'Failed to spawn worker daemon',
'Worker failed to start (health check timeout)'
];
for (const msg of errorMessages) {
const result = buildStatusOutput('error', msg);
expect(result.message).toBe(msg);
}
});
});
describe('required fields always present', () => {
it('should always include continue: true', () => {
expect(buildStatusOutput('ready').continue).toBe(true);
expect(buildStatusOutput('error').continue).toBe(true);
expect(buildStatusOutput('ready', 'msg').continue).toBe(true);
expect(buildStatusOutput('error', 'msg').continue).toBe(true);
});
it('should always include suppressOutput: true', () => {
expect(buildStatusOutput('ready').suppressOutput).toBe(true);
expect(buildStatusOutput('error').suppressOutput).toBe(true);
expect(buildStatusOutput('ready', 'msg').suppressOutput).toBe(true);
expect(buildStatusOutput('error', 'msg').suppressOutput).toBe(true);
});
});
describe('JSON serialization', () => {
it('should produce valid JSON when stringified', () => {
const readyResult = buildStatusOutput('ready');
const errorResult = buildStatusOutput('error', 'Test error message');
expect(() => JSON.stringify(readyResult)).not.toThrow();
expect(() => JSON.stringify(errorResult)).not.toThrow();
const parsedReady = JSON.parse(JSON.stringify(readyResult));
expect(parsedReady.status).toBe('ready');
expect(parsedReady.continue).toBe(true);
const parsedError = JSON.parse(JSON.stringify(errorResult));
expect(parsedError.status).toBe('error');
expect(parsedError.message).toBe('Test error message');
});
it('should match expected JSON structure for hook framework', () => {
const readyOutput = JSON.stringify(buildStatusOutput('ready'));
const errorOutput = JSON.stringify(buildStatusOutput('error', 'error msg'));
// Verify exact structure (order may vary, but content must match)
const parsedReady = JSON.parse(readyOutput);
expect(parsedReady).toEqual({
continue: true,
suppressOutput: true,
status: 'ready'
});
const parsedError = JSON.parse(errorOutput);
expect(parsedError).toEqual({
continue: true,
suppressOutput: true,
status: 'error',
message: 'error msg'
});
});
});
describe('type safety', () => {
it('should only accept valid status values', () => {
// TypeScript ensures these are the only valid values at compile time
// This runtime test validates the behavior
const readyResult: StatusOutput = buildStatusOutput('ready');
const errorResult: StatusOutput = buildStatusOutput('error');
expect(['ready', 'error']).toContain(readyResult.status);
expect(['ready', 'error']).toContain(errorResult.status);
});
it('should have correct type structure', () => {
const result = buildStatusOutput('ready');
// Verify literal types
expect(result.continue).toBe(true as const);
expect(result.suppressOutput).toBe(true as const);
});
});
describe('edge cases', () => {
it('should handle empty string message', () => {
// Empty string is falsy, so message should NOT be included
const result = buildStatusOutput('error', '');
expect('message' in result).toBe(false);
});
it('should handle message with special characters', () => {
const specialMessage = 'Error: "quoted" & special <chars>';
const result = buildStatusOutput('error', specialMessage);
expect(result.message).toBe(specialMessage);
// Verify it serializes correctly
const parsed = JSON.parse(JSON.stringify(result));
expect(parsed.message).toBe(specialMessage);
});
it('should handle very long message', () => {
const longMessage = 'A'.repeat(10000);
const result = buildStatusOutput('error', longMessage);
expect(result.message).toBe(longMessage);
});
});
});
describe('start command JSON output', () => {
describe('when worker already healthy', () => {
it('should output valid JSON with status: ready', () => {
// Skip if worker script doesn't exist (not built)
if (!existsSync(WORKER_SCRIPT)) {
console.log('Skipping CLI test - worker script not built');
return;
}
const { stdout, exitCode } = runWorkerStart();
// The start command always exits with 0 (Windows Terminal compatibility)
expect(exitCode).toBe(0);
// Should output valid JSON
expect(() => JSON.parse(stdout)).not.toThrow();
const parsed = JSON.parse(stdout);
// Verify required fields per hook framework contract
expect(parsed.continue).toBe(true);
expect(parsed.suppressOutput).toBe(true);
expect(['ready', 'error']).toContain(parsed.status);
});
it('should match expected JSON structure when worker is healthy', () => {
if (!existsSync(WORKER_SCRIPT)) {
console.log('Skipping CLI test - worker script not built');
return;
}
const { stdout } = runWorkerStart();
const parsed = JSON.parse(stdout);
// When worker is already healthy, status should be 'ready'
// (or 'error' if something unexpected happens)
if (parsed.status === 'ready') {
// Ready status should not include message unless explicitly set
expect(parsed.continue).toBe(true);
expect(parsed.suppressOutput).toBe(true);
} else if (parsed.status === 'error') {
// Error status may include a message explaining the failure
expect(typeof parsed.message).toBe('string');
}
});
});
describe('error scenarios', () => {
// These tests require complex setup (mocking ports, killing processes)
// Skipped for now - the pure function tests above cover the JSON structure
it.skip('should output JSON with status: error when port in use but not responding', () => {
// Would require: start a non-worker server on the port, then call start
});
it.skip('should output JSON with status: error on spawn failure', () => {
// Would require: mock spawnDaemon to fail
});
it.skip('should output JSON with status: error on health check timeout', () => {
// Would require: start worker that never becomes healthy
});
});
});
/**
* Claude Code hook framework compatibility tests
*
* These tests verify that the worker 'start' command output conforms to
* Claude Code's hook output contract. Key requirements:
*
* 1. Exit code 0 - Required for Windows Terminal compatibility (prevents
* tab accumulation from spawned processes)
*
* 2. JSON on stdout - Claude Code parses stdout as JSON. Logs must go to
* stderr to avoid breaking JSON parsing.
*
* 3. `continue: true` - CRITICAL: This field tells Claude Code to continue
* processing. If missing or false, Claude Code stops after the hook.
* Per docs: "If continue is false, Claude stops processing after the
* hooks run."
*
* 4. `suppressOutput: true` - Hides output from transcript mode (Ctrl-R).
* Optional but recommended for non-user-facing status.
*
* Reference: private/context/claude-code/hooks.md
*/
describe('Claude Code hook framework compatibility', () => {
/**
* Windows Terminal compatibility requirement
*
* When hooks run in Windows Terminal, each spawned process can open a
* new tab. Exit code 0 tells the terminal the process completed
* successfully and prevents tab accumulation.
*
* Even for error states (worker failed to start), we exit 0 and
* communicate the error via JSON { status: 'error', message: '...' }
*/
it('should always exit with code 0', () => {
if (!existsSync(WORKER_SCRIPT)) {
console.log('Skipping CLI test - worker script not built');
return;
}
const { exitCode } = runWorkerStart();
// Per Windows Terminal compatibility requirement, exit code is always 0
// Error states are communicated via JSON status field, not exit codes
expect(exitCode).toBe(0);
});
/**
* JSON must go to stdout, not stderr
*
* Claude Code parses stdout as JSON for hook output. Any non-JSON on
* stdout breaks parsing. Logs, warnings, and debug info must go to
* stderr.
*
* Structure: { status, continue, suppressOutput, message? }
*/
it('should output JSON on stdout (not stderr)', () => {
if (!existsSync(WORKER_SCRIPT)) {
console.log('Skipping CLI test - worker script not built');
return;
}
const result = spawnSync('bun', [WORKER_SCRIPT, 'start'], {
encoding: 'utf-8',
timeout: 60000
});
const stdout = result.stdout?.trim() || '';
const stderr = result.stderr?.trim() || '';
// stdout should contain valid JSON
expect(() => JSON.parse(stdout)).not.toThrow();
// stderr should NOT contain the JSON output (it may have logs)
// The JSON structure should only appear in stdout
const parsed = JSON.parse(stdout);
expect(parsed).toHaveProperty('status');
expect(parsed).toHaveProperty('continue');
// Verify stderr doesn't accidentally contain the JSON output
if (stderr) {
try {
const stderrParsed = JSON.parse(stderr);
// If stderr parses as JSON with our structure, that's wrong
expect(stderrParsed).not.toHaveProperty('suppressOutput');
} catch {
// stderr is not JSON, which is expected (logs, etc.)
}
}
});
/**
* JSON must be parseable as valid JSON
*
* This seems obvious but is critical - any extraneous output (console.log
* statements, warnings, etc.) will break JSON parsing and cause Claude
* Code to fail processing the hook output.
*/
it('should be parseable as valid JSON', () => {
if (!existsSync(WORKER_SCRIPT)) {
console.log('Skipping CLI test - worker script not built');
return;
}
const { stdout } = runWorkerStart();
// Should not throw on parse
let parsed: unknown;
expect(() => {
parsed = JSON.parse(stdout);
}).not.toThrow();
// Should be an object, not a string, array, etc.
expect(typeof parsed).toBe('object');
expect(parsed).not.toBeNull();
expect(Array.isArray(parsed)).toBe(false);
});
/**
* `continue: true` is CRITICAL
*
* From Claude Code docs: "If continue is false, Claude stops processing
* after the hooks run."
*
* For SessionStart hooks (which start the worker), we MUST return
* continue: true so Claude Code continues to process the user's prompt.
* If we returned continue: false, Claude would stop immediately after
* starting the worker and never respond to the user.
*
* This is why continue: true is a required literal in our StatusOutput
* type - it can never be false.
*/
it('should always include continue: true (required for Claude Code to proceed)', () => {
if (!existsSync(WORKER_SCRIPT)) {
console.log('Skipping CLI test - worker script not built');
return;
}
const { stdout } = runWorkerStart();
const parsed = JSON.parse(stdout);
// continue: true is CRITICAL - without it, Claude Code stops processing
// This is not optional; it must always be true for our hooks
expect(parsed.continue).toBe(true);
// Also verify it's the literal `true`, not a truthy value
expect(parsed.continue).toStrictEqual(true);
});
/**
* suppressOutput hides from transcript mode
*
* When suppressOutput: true, the hook output doesn't appear in transcript
* mode (Ctrl-R). This is useful for status messages that aren't relevant
* to the user's conversation history.
*
* For the worker start command, we suppress output since "worker started"
* is infrastructure noise, not conversation content.
*/
it('should include suppressOutput: true to hide from transcript mode', () => {
if (!existsSync(WORKER_SCRIPT)) {
console.log('Skipping CLI test - worker script not built');
return;
}
const { stdout } = runWorkerStart();
const parsed = JSON.parse(stdout);
// suppressOutput prevents infrastructure noise from polluting transcript
expect(parsed.suppressOutput).toBe(true);
});
/**
* status field communicates outcome
*
* The status field tells Claude Code (and debugging tools) whether the
* hook succeeded. Valid values: 'ready' | 'error'
*
* Unlike exit codes (which are always 0), status can indicate failure.
* This allows Claude Code to potentially take remedial action or log
* the issue.
*/
it('should include a valid status field', () => {
if (!existsSync(WORKER_SCRIPT)) {
console.log('Skipping CLI test - worker script not built');
return;
}
const { stdout } = runWorkerStart();
const parsed = JSON.parse(stdout);
expect(parsed).toHaveProperty('status');
expect(['ready', 'error']).toContain(parsed.status);
});
});
});
+1 -100
View File
@@ -5,106 +5,7 @@
### Dec 5, 2025
**full-lifecycle.test.ts**
| ID | Time | T | Title | Read |
|----|------|---|-------|------|
| #20670 | 8:48 PM | 🔵 | Full Lifecycle Integration Test Analysis | ~428 |
| #20664 | 8:46 PM | 🔵 | Test Suite Verification Complete | ~238 |
| #20651 | 8:43 PM | 🟣 | Comprehensive Test Suite Merged | ~312 |
| #20447 | 7:39 PM | 🟣 | Full Lifecycle Integration Test Suite Created | ~665 |
### Dec 7, 2025
**full-lifecycle.test.ts**
| ID | Time | T | Title | Read |
|----|------|---|-------|------|
| #21829 | 11:05 PM | 🔄 | Massive refactor adds 8,671 lines and removes 5,585 lines across 60 files | ~619 |
### Dec 8, 2025
**full-lifecycle.test.ts**
| ID | Time | T | Title | Read |
|----|------|---|-------|------|
| #22081 | 6:28 PM | ✅ | Clean Test Suite Execution Without Integration Tests | ~399 |
| #22080 | 6:27 PM | ✅ | Full Test Suite Execution Results | ~456 |
| #22039 | 6:01 PM | 🔵 | Discovered comprehensive TypeScript test suite with 11 test files | ~355 |
### Dec 9, 2025
**full-lifecycle.test.ts**
| ID | Time | T | Title | Read |
|----|------|---|-------|------|
| #22606 | 11:33 AM | 🔵 | Hardcoded port 37777 found across multiple codebase locations | ~371 |
### Dec 11, 2025
**full-lifecycle.test.ts**
| ID | Time | T | Title | Read |
|----|------|---|-------|------|
| #24076 | 3:16 PM | 🔵 | 45 files modified with nearly equal additions and deletions during Bun migration | ~443 |
| #23951 | 1:45 PM | 🔄 | Integration Test Updated to Use Dynamic Port Configuration | ~272 |
| #23933 | 1:36 PM | 🔵 | Comprehensive Port 37777 References Across Documentation and Code | ~427 |
### Dec 12, 2025
**full-lifecycle.test.ts**
| ID | Time | T | Title | Read |
|----|------|---|-------|------|
| #24318 | 5:48 PM | 🟣 | Phase 6 Complete: Comprehensive Bun Worker Testing Passed | ~486 |
| #24317 | 5:47 PM | 🔵 | Test Suite Passes with 42 Tests Across 7 Files | ~326 |
| #24126 | 12:27 AM | 🟣 | Comprehensive Bun Runtime Migration Statistics | ~287 |
### Dec 13, 2025
**hook-execution-environments.test.ts**
| ID | Time | T | Title | Read |
|----|------|---|-------|------|
| #25551 | 11:32 PM | 🟣 | Enhanced error handling system merged into main branch | ~471 |
| #25521 | 11:05 PM | 🟣 | Hook Execution Environment Tests Created | ~529 |
**full-lifecycle.test.ts**
| ID | Time | T | Title | Read |
|----|------|---|-------|------|
| #25518 | 10:37 PM | 🔵 | Integration Test Coverage Analyzed | ~502 |
| #25499 | 10:30 PM | 🔵 | Full Test Suite Passes with 52 Tests | ~350 |
### Dec 14, 2025
**context-inject-early.test.ts**
| ID | Time | T | Title | Read |
|----|------|---|-------|------|
| #25595 | 2:33 PM | ✅ | PR #310 merged into main branch | ~292 |
### Dec 18, 2025
**hook-execution-environments.test.ts**
| ID | Time | T | Title | Read |
|----|------|---|-------|------|
| #29603 | 5:37 PM | 🔵 | Full Test Suite Results - 120/121 Tests Passing | ~424 |
### Dec 20, 2025
**hook-execution-environments.test.ts**
| ID | Time | T | Title | Read |
|----|------|---|-------|------|
| #30494 | 4:43 PM | 🔵 | Test Suite Status with Bun Path Resolution Failures | ~330 |
### Dec 21, 2025
**hook-execution-environments.test.ts**
| ID | Time | T | Title | Read |
|----|------|---|-------|------|
| #31371 | 6:08 PM | ✅ | Removed Five Incomplete Test Files | ~180 |
**full-lifecycle.test.ts**
| ID | Time | T | Title | Read |
|----|------|---|-------|------|
| #31370 | 6:07 PM | ✅ | Removed 9 Mock-Based Test Files | ~286 |
### Dec 22, 2025
**context-inject-early.test.ts**
| ID | Time | T | Title | Read |
|----|------|---|-------|------|
| #31855 | 6:53 PM | ✅ | テストスイートの大規模削除とテスト分析レポートの追加 | ~197 |
| #20721 | 9:02 PM | 🔵 | Full Lifecycle Integration Test Suite | ~563 |
</claude-mem-context>
+1 -38
View File
@@ -3,42 +3,5 @@
<!-- This section is auto-generated by claude-mem. Edit content outside the tags. -->
### Jan 3, 2026
**server.test.ts**
| ID | Time | T | Title | Read |
|----|------|---|-------|------|
| #36583 | 9:57 PM | 🟣 | Server Test Suite Created | ~485 |
**error-handler.test.ts**
| ID | Time | T | Title | Read |
|----|------|---|-------|------|
| #36581 | 9:57 PM | 🟣 | ErrorHandler Test Suite Created for Phase 6 | ~444 |
### Jan 4, 2026
**error-handler.test.ts**
| ID | Time | T | Title | Read |
|----|------|---|-------|------|
| #36841 | 1:43 AM | 🔵 | Error Handler Testing with Custom Error Classes | ~445 |
### Jan 5, 2026
**CLAUDE.md**
| ID | Time | T | Title | Read |
|----|------|---|-------|------|
| #38078 | 9:54 PM | ✅ | CLAUDE.md Documentation Cleanup - 1,233 Lines Removed Across 18 Files | ~590 |
**server.test.ts**
| ID | Time | T | Title | Read |
|----|------|---|-------|------|
| #38018 | 9:14 PM | 🟣 | Added comprehensive test coverage for worktree detection and projectRoot path resolution | ~450 |
| #37758 | 6:25 PM | ⚖️ | Integration Test Design for Four Critical Testing Gaps | ~729 |
| #37710 | 6:11 PM | 🔵 | Test Audit: server.test.ts Integration Tests with Minimal Mocking for HTTP Server | ~582 |
**error-handler.test.ts**
| ID | Time | T | Title | Read |
|----|------|---|-------|------|
| #37629 | 5:36 PM | 🔵 | Comprehensive Testing Patterns Documentation Generated | ~629 |
| #37625 | 5:35 PM | 🔵 | Bun Test Pattern for Error Classes and Mock Restoration | ~573 |
*No recent activity*
</claude-mem-context>