fix: Claude Code 2.1.1 compatibility + log-level audit + path validation fixes (#614)
* Refactor CLAUDE.md and related files for December 2025 updates - Updated CLAUDE.md in src/services/worker with new entries for December 2025, including changes to Search.ts, GeminiAgent.ts, SDKAgent.ts, and SessionManager.ts. - Revised CLAUDE.md in src/shared to reflect updates and new entries for December 2025, including paths.ts and worker-utils.ts. - Modified hook-constants.ts to clarify exit codes and their behaviors. - Added comprehensive hooks reference documentation for Claude Code, detailing usage, events, and examples. - Created initial CLAUDE.md files in various directories to track recent activity. * fix: Merge user-message-hook output into context-hook hookSpecificOutput - Add footer message to additionalContext in context-hook.ts - Remove user-message-hook from SessionStart hooks array - Fixes issue where stderr+exit(1) approach was silently discarded Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Update logs and documentation for recent plugin and worker service changes - Added detailed logs for worker service activities from Dec 10, 2025 to Jan 7, 2026, including initialization patterns, cleanup confirmations, and diagnostic logging. - Updated plugin documentation with recent activities, including plugin synchronization and configuration changes from Dec 3, 2025 to Jan 7, 2026. - Enhanced the context hook and worker service logs to reflect improvements and fixes in the plugin architecture. - Documented the migration and verification processes for the Claude memory system and its integration with the marketplace. * Refactor hooks architecture and remove deprecated user-message-hook - Updated hook configurations in CLAUDE.md and hooks.json to reflect changes in session start behavior. - Removed user-message-hook functionality as it is no longer utilized in Claude Code 2.1.0; context is now injected silently. - Enhanced context-hook to handle session context injection without user-visible messages. - Cleaned up documentation across multiple files to align with the new hook structure and removed references to obsolete hooks. - Adjusted timing and command execution for hooks to improve performance and reliability. * fix: Address PR #610 review issues - Replace USER_MESSAGE_ONLY test with BLOCKING_ERROR test in hook-constants.test.ts - Standardize Claude Code 2.1.0 note wording across all three documentation files - Exclude deprecated user-message-hook.ts from logger-usage-standards test Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix: Remove hardcoded fake token counts from context injection Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Address PR #610 review issues by fixing test files, standardizing documentation notes, and verifying code quality improvements. * fix: Add path validation to CLAUDE.md distribution to prevent invalid directory creation - Add isValidPathForClaudeMd() function to reject invalid paths: - Tilde paths (~) that Node.js doesn't expand - URLs (http://, https://) - Paths with spaces (likely command text or PR references) - Paths with # (GitHub issue/PR references) - Relative paths that escape project boundary - Integrate validation in updateFolderClaudeMdFiles loop - Add 6 unit tests for path validation - Update .gitignore to prevent accidental commit of malformed directories - Clean up existing invalid directories (~/, PR #610..., git diff..., https:) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * fix: Implement path validation in CLAUDE.md generation to prevent invalid directory creation - Added `isValidPathForClaudeMd()` function to validate file paths in `src/utils/claude-md-utils.ts`. - Integrated path validation in `updateFolderClaudeMdFiles` to skip invalid paths. - Added 6 new unit tests in `tests/utils/claude-md-utils.test.ts` to cover various rejection cases. - Updated `.gitignore` to prevent tracking of invalid directories. - Cleaned up existing invalid directories in the repository. * feat: Promote critical WARN logs to ERROR level across codebase Comprehensive log-level audit promoting 38+ WARN messages to ERROR for improved debugging and incident response: - Parser: observation type errors, data contamination - SDK/Agents: empty init responses (Gemini, OpenRouter) - Worker/Queue: session recovery, auto-recovery failures - Chroma: sync failures, search failures (now treated as critical) - SQLite: search failures (primary data store) - Session/Generator: failures, missing context - Infrastructure: shutdown, process management failures - File Operations: CLAUDE.md updates, config reads - Branch Management: recovery checkout failures Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * fix: Address PR #614 review issues - Remove incorrectly tracked tilde-prefixed files from git - Fix absolute path validation to check projectRoot boundaries - Add test coverage for absolute path validation edge cases Closes review issues: - Issue 1: ~/ prefixed files removed from tracking - Issue 3: Absolute paths now validated against projectRoot - Issue 4: Added 3 new test cases for absolute path scenarios Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * build assets and context --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
+10
-88
@@ -3,107 +3,29 @@
|
||||
|
||||
<!-- This section is auto-generated by claude-mem. Edit content outside the tags. -->
|
||||
|
||||
### Dec 27, 2025
|
||||
### Oct 25, 2025
|
||||
|
||||
**hooks.json**
|
||||
| ID | Time | T | Title | Read |
|
||||
|----|------|---|-------|------|
|
||||
| #33090 | 7:05 PM | 🔵 | Claude-mem hook configuration reviewed for session disconnect investigation | ~331 |
|
||||
| #33038 | 5:14 PM | 🔵 | PR 462 Code Review Identifies Critical Endpoint Mismatch and Worker Restart Issues | ~475 |
|
||||
| #33025 | 5:00 PM | 🟣 | Automated worker restart on plugin updates | ~391 |
|
||||
| #33017 | 4:57 PM | ✅ | Auto-Restart Feature Deployed to Production Version 8.2.2 | ~367 |
|
||||
| #33014 | 4:56 PM | 🔄 | SessionStart Hook Reordered for Immediate Worker Restart | ~380 |
|
||||
| #33012 | " | 🔵 | Plugin Hook Chain Orchestrates Worker Lifecycle | ~412 |
|
||||
| #33007 | 4:54 PM | 🔵 | Worker Service Lifecycle and Version Mismatch Detection Analysis | ~530 |
|
||||
| #33006 | 4:47 PM | 🔴 | Changed SessionStart hook from restart to start command | ~311 |
|
||||
| #33001 | 4:44 PM | ⚖️ | Lockfile-Based Concurrency Control for Windows Multi-Session Fix | ~513 |
|
||||
| #32996 | 4:42 PM | ⚖️ | Implementation Plan: Atomic Lockfile Strategy for Windows Concurrency Fix | ~639 |
|
||||
| #32995 | 4:40 PM | 🔵 | Critical Finding: Windows Managed Mode Not Activated in Hooks | ~657 |
|
||||
| #2518 | 11:47 PM | 🔴 | Removed Invalid 'matcher' Field from SessionStart Hook | ~228 |
|
||||
| #2517 | " | 🔵 | Project hooks.json Template Also Empty | ~222 |
|
||||
| #2501 | 11:11 PM | 🔵 | Context Hook Fails Due to Missing @anthropic-ai/sdk Dependency | ~245 |
|
||||
|
||||
### Dec 28, 2025
|
||||
### Oct 27, 2025
|
||||
|
||||
**hooks.json**
|
||||
| ID | Time | T | Title | Read |
|
||||
|----|------|---|-------|------|
|
||||
| #33323 | 3:09 PM | 🔴 | Fixed Windows multi-session worker race condition causing hangs | ~513 |
|
||||
| #33318 | " | 🔴 | Fixed Worker Auto-Restart Shutdown Endpoint and Port Configuration | ~411 |
|
||||
| #33284 | 3:07 PM | 🔄 | Consolidated Worker Lifecycle Management (-580 Lines) | ~327 |
|
||||
| #33271 | 2:59 PM | ⚖️ | Plan Created to Fix Worker Lifecycle in 8 Phases | ~399 |
|
||||
| #33269 | " | 🔵 | PR #456 Broke Worker Background Execution | ~365 |
|
||||
| #33266 | 2:58 PM | 🟣 | Test coverage for self-spawn worker pattern | ~391 |
|
||||
| #33263 | " | 🔴 | Increased timeout limits across system for slow systems compatibility | ~463 |
|
||||
| #2718 | 12:00 AM | 🔴 | Removed incorrect failOnError configuration from hook | ~165 |
|
||||
|
||||
### Dec 29, 2025
|
||||
### Nov 18, 2025
|
||||
|
||||
**hooks.json**
|
||||
| ID | Time | T | Title | Read |
|
||||
|----|------|---|-------|------|
|
||||
| #33960 | 7:00 PM | 🔵 | Hook Chain Architecture in hooks.json | ~389 |
|
||||
| #33905 | 5:18 PM | 🟣 | Platform-Native Worker Executable Compilation | ~498 |
|
||||
| #33895 | 5:13 PM | 🟣 | Implemented install-time worker executable compilation | ~423 |
|
||||
| #33888 | 5:12 PM | ✅ | Worker Service Command Simplified in Plugin Hooks | ~251 |
|
||||
| #33869 | 4:47 PM | 🔵 | Claude Code Hook System Integration for Memory Lifecycle Management | ~477 |
|
||||
| #33868 | " | ⚖️ | Windows standalone executable implementation plan designed | ~590 |
|
||||
| #33858 | 4:34 PM | 🔵 | Hook execution configuration uses mixed node and bun commands | ~402 |
|
||||
| #33854 | 4:33 PM | 🔵 | Worker service build and execution architecture mapped | ~509 |
|
||||
| #11518 | 8:22 PM | 🔵 | Smart Contextualization Switched from Skill to HTTP API | ~498 |
|
||||
|
||||
### Dec 30, 2025
|
||||
### Dec 24, 2025
|
||||
|
||||
**hooks.json**
|
||||
| ID | Time | T | Title | Read |
|
||||
|----|------|---|-------|------|
|
||||
| #34392 | 1:41 PM | 🔵 | Plugin Hooks Architecture Shows No Cleanup Hook for Session Termination | ~396 |
|
||||
|
||||
### Dec 31, 2025
|
||||
|
||||
**hooks.json**
|
||||
| ID | Time | T | Title | Read |
|
||||
|----|------|---|-------|------|
|
||||
| #34687 | 3:39 PM | 🔵 | Hook Configuration Uses CLAUDE_PLUGIN_ROOT Environment Variable | ~387 |
|
||||
|
||||
### Jan 2, 2026
|
||||
|
||||
**hooks.json**
|
||||
| ID | Time | T | Title | Read |
|
||||
|----|------|---|-------|------|
|
||||
| #35911 | 2:51 PM | 🔵 | Hooks.json Defines Timeout Values For Hook Execution | ~361 |
|
||||
|
||||
### Jan 4, 2026
|
||||
|
||||
**hooks.json**
|
||||
| ID | Time | T | Title | Read |
|
||||
|----|------|---|-------|------|
|
||||
| #36937 | 2:36 AM | 🔵 | Matcher Line History - Added November 2025 | ~203 |
|
||||
| #36936 | 2:34 AM | 🔵 | Current SessionStart Hook Configuration Analysis | ~338 |
|
||||
| #36935 | " | 🔵 | PR #541 Changes - Matcher Removal in SessionStart Hook | ~263 |
|
||||
|
||||
### Jan 5, 2026
|
||||
|
||||
**hooks.json**
|
||||
| ID | Time | T | Title | Read |
|
||||
|----|------|---|-------|------|
|
||||
| #38100 | 10:46 PM | 🔵 | Legacy hooks.json still references Bun runtime | ~393 |
|
||||
| #38057 | 9:48 PM | ✅ | Live Context Branch Changes Hook Runtime from Bun Back to Node | ~449 |
|
||||
| #38048 | 9:45 PM | 🔴 | PR #558 - Comprehensive Bug Fix and Test Quality Improvement | ~585 |
|
||||
| #37617 | 5:32 PM | ⚖️ | PR #558 Review Requirements Categorized by Priority | ~637 |
|
||||
| #37613 | 5:31 PM | 🔵 | PR #558 Review Feedback Analysis | ~544 |
|
||||
| #37604 | 4:59 PM | 🔴 | Phase 4 Committed - Hook Runtime Mismatch Fixed | ~377 |
|
||||
| #37603 | " | ✅ | Phase 4 Corrected - smart-install.js Restored to node Runtime | ~385 |
|
||||
| #37602 | 4:58 PM | ✅ | Reverted smart-install.js to node Runtime | ~301 |
|
||||
| #37597 | 4:57 PM | 🔴 | Phase 4 Complete - All Hooks Now Use bun Runtime | ~386 |
|
||||
| #37596 | " | ✅ | Phase 4 Verification - All Commands Now Use bun Runtime | ~325 |
|
||||
| #37595 | 4:56 PM | 🔴 | Fixed All Hook Commands to Use bun Runtime | ~364 |
|
||||
| #37594 | " | 🔵 | hooks.json Contains Mixed node and bun Runtime Commands | ~377 |
|
||||
| #37558 | 4:49 PM | 🔵 | Issue #555 Windows Hook Execution Patterns and Fix Strategy Documented | ~510 |
|
||||
| #37548 | 4:48 PM | ✅ | Issue #543 Analysis Report Created for Slash Command Availability | ~540 |
|
||||
| #37547 | 4:47 PM | ✅ | Issue #557 Analysis Report Created for Plugin Startup Failure | ~491 |
|
||||
| #37531 | 4:43 PM | 🔵 | Plugin Hook Configuration and Lifecycle Definition | ~424 |
|
||||
|
||||
### Jan 6, 2026
|
||||
|
||||
**hooks.json**
|
||||
| ID | Time | T | Title | Read |
|
||||
|----|------|---|-------|------|
|
||||
| #38108 | 12:15 AM | 🔵 | Complete Windows Zombie Port Bug Technical Deep Dive | ~935 |
|
||||
| #38104 | 12:14 AM | 🔵 | Windows Compatibility Issues Documented Across 56 Memory Entries | ~509 |
|
||||
| #32309 | 3:09 PM | 🔵 | Claude-mem hooks system configuration structure | ~435 |
|
||||
</claude-mem-context>
|
||||
@@ -19,11 +19,6 @@
|
||||
"type": "command",
|
||||
"command": "bun \"${CLAUDE_PLUGIN_ROOT}/scripts/context-hook.js\"",
|
||||
"timeout": 60
|
||||
},
|
||||
{
|
||||
"type": "command",
|
||||
"command": "bun \"${CLAUDE_PLUGIN_ROOT}/scripts/user-message-hook.js\"",
|
||||
"timeout": 60
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user