Files
claude-mem/docs/i18n/README.vi.md
Alex Newman 3ea0b60b9f feat: Mode system with inheritance and multilingual support (#412)
* feat: add domain management system with support for multiple domain profiles

- Introduced DomainManager class for loading and managing domain profiles.
- Added support for a default domain ('code') and fallback mechanisms.
- Implemented domain configuration validation and error handling.
- Created types for domain configuration, observation types, and concepts.
- Added new directory for domain profiles and ensured its existence.
- Updated SettingsDefaultsManager to include CLAUDE_MEM_DOMAIN setting.

* Refactor domain management to mode management

- Removed DomainManager class and replaced it with ModeManager for better clarity and functionality.
- Updated types from DomainConfig to ModeConfig and DomainPrompts to ModePrompts.
- Changed references from domains to modes in the settings and paths.
- Ensured backward compatibility by maintaining the fallback mechanism to the 'code' mode.

* feat: add migration 008 to support mode-agnostic observations and refactor service layer references in documentation

* feat: add new modes for code development and email investigation with detailed observation types and concepts

* Refactor observation parsing and prompt generation to incorporate mode-specific configurations

- Updated `parseObservations` function to use 'observation' as a universal fallback type instead of 'change', utilizing active mode's valid observation types.
- Modified `buildInitPrompt` and `buildContinuationPrompt` functions to accept a `ModeConfig` parameter, allowing for dynamic prompt content based on the active mode.
- Enhanced `ModePrompts` interface to include additional guidance for observers, such as recording focus and skip guidance.
- Adjusted the SDKAgent to load the active mode and pass it to prompt generation functions, ensuring prompts are tailored to the current mode's context.

* fix: correct mode prompt injection to preserve exact wording and type list visibility

- Add script to extract prompts from main branch prompts.ts into code.yaml
- Fix prompts.ts to show type list in XML template (e.g., "[ bugfix | feature | ... ]")
- Keep 'change' as fallback type in parser.ts (maintain backwards compatibility)
- Regenerate code.yaml with exact wording from original hardcoded prompts
- Build succeeds with no TypeScript errors

* fix: update ModeManager to load JSON mode files and improve validation

- Changed ModeManager to load mode configurations from JSON files instead of YAML.
- Removed the requirement for an "observation" type and updated validation to require at least one observation type.
- Updated fallback behavior in the parser to use the first type from the active mode's type list.
- Added comprehensive tests for mode loading, prompt injection, and parser integration, ensuring correct behavior across different modes.
- Introduced new mode JSON files for "Code Development" and "Email Investigation" with detailed observation types and prompts.

* Add mode configuration loading and update licensing information for Ragtime

- Implemented loading of mode configuration in WorkerService before database initialization.
- Added PolyForm Noncommercial License 1.0.0 to Ragtime directory.
- Created README.md for Ragtime with licensing details and usage guidelines.

* fix: add datasets directory to .gitignore to prevent accidental commits

* refactor: remove unused plugin package.json file

* chore: add package.json for claude-mem plugin with version 7.4.5

* refactor: remove outdated tests and improve error handling

- Deleted tests for ChromaSync error handling, smart install, strip memory tags, and user prompt tag stripping due to redundancy or outdated logic.
- Removed vitest configuration as it is no longer needed.
- Added a comprehensive implementation plan for fixing the modes system, addressing critical issues and improving functionality.
- Created a detailed test analysis report highlighting the quality and effectiveness of the current test suite, identifying areas for improvement.
- Introduced a new plugin package.json for runtime dependencies related to claude-mem hooks.

* refactor: remove parser regression tests to streamline codebase

* docs: update CLAUDE.md to clarify test management and changelog generation

* refactor: remove migration008 for mode-agnostic observations

* Refactor observation type handling to use ModeManager for icons and emojis

- Removed direct mappings of observation types to icons and work emojis in context-generator, FormattingService, SearchManager, and TimelineService.
- Integrated ModeManager to dynamically retrieve icons and emojis based on the active mode.
- Improved maintainability by centralizing the logic for observation type representation.

* Refactor observation metadata constants and update context generator

- Removed the explicit declaration of OBSERVATION_TYPES and OBSERVATION_CONCEPTS from observation-metadata.ts.
- Introduced fallback default strings for DEFAULT_OBSERVATION_TYPES_STRING and DEFAULT_OBSERVATION_CONCEPTS_STRING.
- Updated context-generator.ts to utilize observation types and concepts from ModeManager instead of constants.

* refactor: remove intermediate error handling from hooks (Phase 1)

Apply "fail fast" error handling strategy - errors propagate and crash loud
instead of being caught, wrapped, and re-thrown at intermediate layers.

Changes:
- Remove try/catch around fetch calls in all hooks - let errors throw
- Add try/catch ONLY around JSON.parse at entry points
- Delete error-handler.ts and hook-error-handler.ts (no longer needed)
- Update worker-utils.ts: functions now throw instead of returning null
- Update transcript-parser.ts: throw on missing path, empty file, malformed JSON
- Remove all handleWorkerError, handleFetchError imports

Philosophy: If something breaks, we KNOW it broke. No silent failures.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

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

* refactor: remove intermediate error handling from worker service (Phase 2)

Apply "fail fast" error handling strategy to worker service layer.

Changes:
- worker-service.ts: Remove try/catch from version endpoint, cleanup,
  MCP close, process enumeration, force kill, and isAlive check
- SessionRoutes.ts: Remove try/catch from JSON.stringify calls, remove
  .catch() from Chroma sync and SDK agent calls
- SettingsRoutes.ts: Remove try/catch from toggleMcp()
- DatabaseManager.ts: Remove .catch() from backfill and close operations
- SDKAgent.ts: Keep outer try/catch (top-level), remove .catch() from
  Chroma sync operations
- SSEBroadcaster.ts: Remove try/catch from broadcast and sendToClient

Philosophy: Errors propagate and crash loud. BaseRouteHandler.wrapHandler
provides top-level catching for HTTP routes.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

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

* refactor: remove error swallowing from SQLite services (Phase 3)

Apply "fail fast" error handling strategy to database layer.

SessionStore.ts migrations:
- ensureWorkerPortColumn(): Remove outer try/catch, let it throw
- ensurePromptTrackingColumns(): Remove outer try/catch, let it throw
- removeSessionSummariesUniqueConstraint(): Keep inner transaction
  rollback, remove outer catch
- addObservationHierarchicalFields(): Remove outer try/catch
- makeObservationsTextNullable(): Keep inner transaction rollback,
  remove outer catch
- createUserPromptsTable(): Keep inner transaction rollback, remove
  outer catch
- getFilesForSession(): Remove try/catch around JSON.parse

SessionSearch.ts:
- ensureFTSTables(): Remove try/catch, let it throw

Philosophy: Migration errors that are swallowed mean we think the
database is fine when it's not. Keep only inner transaction rollback
try/catch blocks.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

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

* refactor: remove error hiding from utilities (Phase 4)

Apply "fail fast" error handling strategy to utility layer.

logger.ts:
- formatTool(): Remove try/catch, let JSON.parse throw on malformed input

context-generator.ts:
- loadContextConfig(): Remove try/catch, let parseInt throw on invalid settings
- Transcript extraction: Remove try/catch, let file read errors propagate

ChromaSync.ts:
- close(): Remove nested try/catch blocks, let close errors propagate

Philosophy: No silent fallbacks or hidden defaults. If something breaks,
we know it broke immediately.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

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

* feat: serve static UI assets and update package root path

- Added middleware to serve static UI assets (JS, CSS, fonts, etc.) in ViewerRoutes.
- Updated getPackageRoot function to correctly return the package root directory as one level up from the current directory.

* feat: Enhance mode loading with inheritance support

- Introduced parseInheritance method to handle parent--override mode IDs.
- Added deepMerge method for recursively merging mode configurations.
- Updated loadMode method to support inheritance, loading parent modes and applying overrides.
- Improved error handling for missing mode files and logging for better traceability.

* fix(modes): correct inheritance file resolution and path handling

* Refactor code structure for improved readability and maintainability

* feat: Add mode configuration documentation and examples

* fix: Improve concurrency handling in translateReadme function

* Refactor SDK prompts to enhance clarity and structure

- Updated the `buildInitPrompt` and `buildContinuationPrompt` functions in `prompts.ts` to improve the organization of prompt components, including the addition of language instructions and footer messages.
- Removed redundant instructions and emphasized the importance of recording observations.
- Modified the `ModePrompts` interface in `types.ts` to include new properties for system identity, language instructions, and output format header, ensuring better flexibility and clarity in prompt generation.

* Enhance prompts with language instructions and XML formatting

- Updated `buildInitPrompt`, `buildSummaryPrompt`, and `buildContinuationPrompt` functions to include detailed language instructions in XML comments.
- Ensured that language instructions guide users to keep XML tags in English while writing content in the specified language.
- Modified the `buildSummaryPrompt` function to accept `mode` as a parameter for consistency.
- Adjusted the call to `buildSummaryPrompt` in `SDKAgent` to pass the `mode` argument.

* Refactor XML prompt generation in SDK

- Updated the buildInitPrompt, buildSummaryPrompt, and buildContinuationPrompt functions to use new placeholders for XML elements, improving maintainability and readability.
- Removed redundant language instructions in comments for clarity.
- Added new properties to ModePrompts interface for better structure and organization of XML placeholders and section headers.

* feat: Update observation prompts and structure across multiple languages

* chore: Remove planning docs and update Ragtime README

Remove ephemeral development artifacts:
- .claude/plans/modes-system-fixes.md
- .claude/test-analysis-report.md
- PROMPT_INJECTION_ANALYSIS.md

Update ragtime/README.md to explain:
- Feature is not yet implemented
- Dependency on modes system (now complete in PR #412)
- Ready to be scripted out in future release

🤖 Generated with [Claude Code](https://claude.com/claude-code)

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

* fix: Move summary prompts to mode files for multilingual support

Summary prompts were hardcoded in English in prompts.ts, breaking
multilingual support. Now properly mode-based:

- Added summary_instruction, summary_context_label,
  summary_format_instruction, summary_footer to code.json
- Updated buildSummaryPrompt() to use mode fields instead of hardcoded text
- Added summary_footer with language instructions to all 10 language modes
- Language modes keep English prompts + language requirement footer

This fixes the gaslighting where we claimed full multilingual support
but summaries were still generated in English.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

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

* chore: Clean up README by removing local preview instructions and streamlining beta features section

* Add translated README files for Ukrainian, Vietnamese, and Chinese languages

* Add new language modes for code development in multiple languages

- Introduced JSON configurations for Code Development in Greek, Finnish, Hebrew, Hindi, Hungarian, Indonesian, Italian, Dutch, Norwegian, Polish, Brazilian Portuguese, Romanian, Swedish, Turkish, and Ukrainian.
- Each configuration includes prompts for observations, summaries, and instructions tailored to the respective language.
- Ensured that all prompts emphasize the importance of generating observations without referencing the agent's actions.

* Add multilingual support links to README files in various languages

- Updated README.id.md, README.it.md, README.ja.md, README.ko.md, README.nl.md, README.no.md, README.pl.md, README.pt-br.md, README.ro.md, README.ru.md, README.sv.md, README.th.md, README.tr.md, README.uk.md, README.vi.md, and README.zh.md to include links to other language versions.
- Each README now features a centered paragraph with flags and links for easy navigation between different language documents.

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-22 20:14:18 -05:00

14 KiB

🌐 Đây là bản dịch tự động. Chúng tôi hoan nghênh các đóng góp từ cộng đồng!



Claude-Mem

🇨🇳 中文🇯🇵 日本語🇧🇷 Português🇰🇷 한국어🇪🇸 Español🇩🇪 Deutsch🇫🇷 Français 🇮🇱 עברית🇸🇦 العربية🇷🇺 Русский🇵🇱 Polski🇨🇿 Čeština🇳🇱 Nederlands🇹🇷 Türkçe🇺🇦 Українська🇻🇳 Tiếng Việt🇮🇩 Indonesia🇹🇭 ไทย🇮🇳 हिन्दी🇧🇩 বাংলা🇷🇴 Română🇸🇪 Svenska🇮🇹 Italiano🇬🇷 Ελληνικά🇭🇺 Magyar🇫🇮 Suomi🇩🇰 Dansk🇳🇴 Norsk

Hệ thống nén bộ nhớ liên tục được xây dựng cho Claude Code.

License Version Node Mentioned in Awesome Claude Code

thedotmack/claude-mem | Trendshift


Claude-Mem Preview

Bắt Đầu NhanhCách Hoạt ĐộngCông Cụ Tìm KiếmTài LiệuCấu HìnhKhắc Phục Sự CốGiấy Phép

Claude-Mem duy trì ngữ cảnh liền mạch qua các phiên làm việc bằng cách tự động ghi lại các quan sát về việc sử dụng công cụ, tạo tóm tắt ngữ nghĩa và cung cấp chúng cho các phiên làm việc trong tương lai. Điều này giúp Claude duy trì tính liên tục của kiến thức về các dự án ngay cả sau khi phiên làm việc kết thúc hoặc kết nối lại.


Bắt Đầu Nhanh

Bắt đầu một phiên Claude Code mới trong terminal và nhập các lệnh sau:

> /plugin marketplace add thedotmack/claude-mem

> /plugin install claude-mem

Khởi động lại Claude Code. Ngữ cảnh từ các phiên trước sẽ tự động xuất hiện trong các phiên mới.

Tính Năng Chính:

  • 🧠 Bộ Nhớ Liên Tục - Ngữ cảnh được lưu giữ qua các phiên làm việc
  • 📊 Tiết Lộ Tuần Tự - Truy xuất bộ nhớ theo lớp với khả năng hiển thị chi phí token
  • 🔍 Tìm Kiếm Theo Kỹ Năng - Truy vấn lịch sử dự án với kỹ năng mem-search
  • 🖥️ Giao Diện Web Viewer - Luồng bộ nhớ thời gian thực tại http://localhost:37777
  • 💻 Kỹ Năng Claude Desktop - Tìm kiếm bộ nhớ từ các cuộc trò chuyện Claude Desktop
  • 🔒 Kiểm Soát Quyền Riêng Tư - Sử dụng thẻ <private> để loại trừ nội dung nhạy cảm khỏi lưu trữ
  • ⚙️ Cấu Hình Ngữ Cảnh - Kiểm soát chi tiết về ngữ cảnh được chèn vào
  • 🤖 Hoạt Động Tự Động - Không cần can thiệp thủ công
  • 🔗 Trích Dẫn - Tham chiếu các quan sát trong quá khứ với ID (truy cập qua http://localhost:37777/api/observation/{id} hoặc xem tất cả trong web viewer tại http://localhost:37777)
  • 🧪 Kênh Beta - Dùng thử các tính năng thử nghiệm như Endless Mode thông qua chuyển đổi phiên bản

Tài Liệu

📚 Xem Tài Liệu Đầy Đủ - Duyệt tài liệu markdown trên GitHub

Bắt Đầu

Thực Hành Tốt Nhất

Kiến Trúc

Cấu Hình & Phát Triển


Cách Hoạt Động

Các Thành Phần Cốt Lõi:

  1. 5 Lifecycle Hooks - SessionStart, UserPromptSubmit, PostToolUse, Stop, SessionEnd (6 hook scripts)
  2. Smart Install - Công cụ kiểm tra phụ thuộc được cache (pre-hook script, không phải lifecycle hook)
  3. Worker Service - HTTP API trên cổng 37777 với giao diện web viewer và 10 điểm cuối tìm kiếm, được quản lý bởi Bun
  4. SQLite Database - Lưu trữ các phiên, quan sát, tóm tắt
  5. mem-search Skill - Truy vấn ngôn ngữ tự nhiên với tiết lộ tuần tự
  6. Chroma Vector Database - Tìm kiếm kết hợp ngữ nghĩa + từ khóa để truy xuất ngữ cảnh thông minh

Xem Tổng Quan Kiến Trúc để biết chi tiết.


mem-search Skill

Claude-Mem cung cấp tìm kiếm thông minh thông qua kỹ năng mem-search tự động kích hoạt khi bạn hỏi về công việc trước đây:

Cách Hoạt Động:

  • Chỉ cần hỏi một cách tự nhiên: "Chúng ta đã làm gì trong phiên trước?" hoặc "Chúng ta đã sửa lỗi này trước đây chưa?"
  • Claude tự động gọi kỹ năng mem-search để tìm ngữ cảnh liên quan

Các Thao Tác Tìm Kiếm Có Sẵn:

  1. Search Observations - Tìm kiếm toàn văn trên các quan sát
  2. Search Sessions - Tìm kiếm toàn văn trên các tóm tắt phiên
  3. Search Prompts - Tìm kiếm các yêu cầu người dùng thô
  4. By Concept - Tìm theo thẻ khái niệm (discovery, problem-solution, pattern, v.v.)
  5. By File - Tìm các quan sát tham chiếu đến các tệp cụ thể
  6. By Type - Tìm theo loại (decision, bugfix, feature, refactor, discovery, change)
  7. Recent Context - Lấy ngữ cảnh phiên gần đây cho một dự án
  8. Timeline - Lấy dòng thời gian thống nhất của ngữ cảnh xung quanh một thời điểm cụ thể
  9. Timeline by Query - Tìm kiếm các quan sát và lấy ngữ cảnh dòng thời gian xung quanh kết quả khớp tốt nhất
  10. API Help - Lấy tài liệu API tìm kiếm

Ví Dụ Truy Vấn Ngôn Ngữ Tự Nhiên:

"What bugs did we fix last session?"
"How did we implement authentication?"
"What changes were made to worker-service.ts?"
"Show me recent work on this project"
"What was happening when we added the viewer UI?"

Xem Hướng Dẫn Công Cụ Tìm Kiếm để biết các ví dụ chi tiết.


Tính Năng Beta

Claude-Mem cung cấp kênh beta với các tính năng thử nghiệm như Endless Mode (kiến trúc bộ nhớ sinh học mô phỏng cho các phiên mở rộng). Chuyển đổi giữa các phiên bản ổn định và beta từ giao diện web viewer tại http://localhost:37777 → Settings.

Xem Tài Liệu Tính Năng Beta để biết chi tiết về Endless Mode và cách dùng thử.


Yêu Cầu Hệ Thống

  • Node.js: 18.0.0 hoặc cao hơn
  • Claude Code: Phiên bản mới nhất với hỗ trợ plugin
  • Bun: JavaScript runtime và trình quản lý tiến trình (tự động cài đặt nếu thiếu)
  • uv: Trình quản lý gói Python cho tìm kiếm vector (tự động cài đặt nếu thiếu)
  • SQLite 3: Cho lưu trữ liên tục (đi kèm)

Cấu Hình

Cài đặt được quản lý trong ~/.claude-mem/settings.json (tự động tạo với giá trị mặc định khi chạy lần đầu). Cấu hình mô hình AI, cổng worker, thư mục dữ liệu, mức độ log và cài đặt chèn ngữ cảnh.

Xem Hướng Dẫn Cấu Hình để biết tất cả các cài đặt và ví dụ có sẵn.


Phát Triển

Xem Hướng Dẫn Phát Triển để biết hướng dẫn xây dựng, kiểm thử và quy trình đóng góp.


Khắc Phục Sự Cố

Nếu gặp sự cố, hãy mô tả vấn đề cho Claude và kỹ năng troubleshoot sẽ tự động chẩn đoán và cung cấp các bản sửa lỗi.

Xem Hướng Dẫn Khắc Phục Sự Cố để biết các vấn đề thường gặp và giải pháp.


Báo Cáo Lỗi

Tạo báo cáo lỗi toàn diện với trình tạo tự động:

cd ~/.claude/plugins/marketplaces/thedotmack
npm run bug-report

Đóng Góp

Chúng tôi hoan nghênh các đóng góp! Vui lòng:

  1. Fork repository
  2. Tạo nhánh tính năng
  3. Thực hiện thay đổi của bạn kèm kiểm thử
  4. Cập nhật tài liệu
  5. Gửi Pull Request

Xem Hướng Dẫn Phát Triển để biết quy trình đóng góp.


Giấy Phép

Dự án này được cấp phép theo GNU Affero General Public License v3.0 (AGPL-3.0).

Copyright (C) 2025 Alex Newman (@thedotmack). Bảo lưu mọi quyền.

Xem tệp LICENSE để biết chi tiết đầy đủ.

Điều Này Có Nghĩa Là:

  • Bạn có thể sử dụng, sửa đổi và phân phối phần mềm này tự do
  • Nếu bạn sửa đổi và triển khai trên máy chủ mạng, bạn phải cung cấp mã nguồn của mình
  • Các tác phẩm phái sinh cũng phải được cấp phép theo AGPL-3.0
  • KHÔNG CÓ BẢO HÀNH cho phần mềm này

Lưu Ý Về Ragtime: Thư mục ragtime/ được cấp phép riêng theo PolyForm Noncommercial License 1.0.0. Xem ragtime/LICENSE để biết chi tiết.


Hỗ Trợ


Được Xây Dựng với Claude Agent SDK | Được Hỗ Trợ bởi Claude Code | Được Tạo với TypeScript