* Add server beta runtime foundation * Address server beta review findings * Resolve server beta review comments * Tighten server beta review follow-ups * Harden server beta auth and search * Avoid unnecessary FTS rebuilds * Block scoped keys from creating projects * Release BullMQ claims best effort on close * Address server beta review blockers * Reset BullMQ claims best effort * Add Postgres observation storage foundation * feat(server-beta): add independent runtime service Introduce src/server/runtime/ as a self-contained server-beta runtime that owns its lifecycle, Postgres bootstrap, and HTTP boundary without depending on WorkerService. ServerBetaService wraps the existing Server class, exposes /healthz and /v1/info with runtime="server-beta", and persists state to dedicated paths (.server-beta.pid|.port|.runtime.json). The four boundary managers (queue, generation worker, provider registry, event broadcaster) are intentionally disabled in this phase and report their status through /v1/info; later phases activate them. Adds plans/2026-05-07-finish-bullmq-branch-ship-plan.md to track the remaining work for this branch. Phase 2 of plans/2026-05-07-server-beta-independent-bullmq-observation-runtime.md. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * feat(server-beta): route CLI lifecycle and bundle separate runtime scripts/build-hooks.js now produces plugin/scripts/server-beta-service.cjs as a separate Node CJS bundle, alongside the existing worker-service bundle. The server-beta runtime is now installable independently. src/npx-cli/commands/server.ts routes start|stop|restart|status to the server-beta lifecycle instead of the legacy worker. The worker keeps its own start|stop|restart|status under the worker namespace; the two runtimes can be operated independently. src/services/worker-service.ts adds a server-* command parser branch that delegates to the sibling server-beta-service.cjs bundle so direct worker-service invocations still route to the right runtime. tests/npx-cli-server-namespace.test.ts updated to expect server-beta lifecycle routing. Includes rebuilt plugin/scripts/*.cjs bundles produced by build-and-sync. Phase 2 of plans/2026-05-07-server-beta-independent-bullmq-observation-runtime.md. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * feat(server-beta): add BullMQ job queue primitives Introduce src/server/jobs/ as the queue-side primitives that Phase 3 of the server-beta runtime needs to operate. types.ts defines a discriminated union over the four job kinds (event, event-batch, summary, reindex) and maps each to a per-kind BullMQ queue name and deterministic-ID prefix. job-id.ts builds deterministic, colon-free BullMQ jobIds from (kind, team, project, source). The colon ban exists because BullMQ uses ':' as a Redis key separator internally; embedding ':' in jobIds breaks scan and state lookups. ServerJobQueue.ts is a thin wrapper over BullMQ Queue + Worker that enforces autorun:false, default concurrency 1, and an attached error listener — all per BullMQ docs requirements. Test seams accept queue and worker factories so unit tests do not need Redis. outbox.ts publishes through the Postgres ObservationGenerationJob repository as canonical history. enqueueOutbox writes the row first, then publishes to BullMQ; if BullMQ throws, the row is transitioned to failed and a failed event is appended. reconcileOnStartup re-enqueues queued + processing rows after a restart, replacing terminal BullMQ jobs that may still be holding the deterministic ID slot. markCompleted and markFailed wrap transitionStatus and append the matching event row. Includes 20 unit tests covering deterministic ID stability, colon-free output, queue lifecycle, error-listener attachment, double-start refusal, idempotent enqueue, BullMQ failure rollback, startup reconciliation, max-attempts skipping, and completion / failure / retry transitions. Phase 3 commit 1 of plans/2026-05-07-server-beta-independent-bullmq-observation-runtime.md. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * feat(server-beta): activate queue boundary in runtime service Wire ActiveServerBetaQueueManager into the server-beta runtime graph. The active manager owns one ServerJobQueue per generation kind (event, event-batch, summary, reindex) and surfaces lane metadata through boundary health. Selection is opt-in and fail-fast: if CLAUDE_MEM_QUEUE_ENGINE is set to bullmq the active manager is constructed (and any Redis/config error throws — no silent fallback to SQLite, per Phase 3 anti-pattern guard). For any other engine the disabled boundary remains so worker-era and test setups stay compatible. Widens ServerBetaBoundaryHealth.status to a discriminated union ('disabled' | 'active' | 'errored') with optional details. The disabled adapter still emits status='disabled', which keeps the existing server-beta-service test green. ServerBetaService receives the manager through a new optional queueManager field on CreateServerBetaServiceOptions so test graphs and Phase 4 wiring can inject custom managers. Adds tests/server/runtime/active-queue-manager.test.ts covering bullmq guard, active health shape, per-kind queue access, close behavior, and post-close errored health. Phase 3 commit 2 of plans/2026-05-07-server-beta-independent-bullmq-observation-runtime.md. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * fix(server-beta): cap /v1/events/batch at 500 events Prevents unbounded array DoS surface flagged in PR review. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
14 KiB
🌐 これは自動翻訳です。コミュニティによる修正を歓迎します!
🇨🇳 中文 • 🇹🇼 繁體中文 • 🇯🇵 日本語 • 🇧🇷 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
Claude Code向けに構築された永続的メモリ圧縮システム
クイックスタート • 仕組み • 検索ツール • ドキュメント • 設定 • トラブルシューティング • ライセンス
Claude-Memは、ツール使用の観察を自動的にキャプチャし、セマンティックサマリーを生成して将来のセッションで利用可能にすることで、セッション間のコンテキストをシームレスに保持します。これにより、Claudeはセッションが終了または再接続された後でも、プロジェクトに関する知識の連続性を維持できます。
クイックスタート
ターミナルで新しいClaude Codeセッションを開始し、次のコマンドを入力します:
> /plugin marketplace add thedotmack/claude-mem
> /plugin install claude-mem
Claude Codeを再起動します。以前のセッションからのコンテキストが新しいセッションに自動的に表示されます。
主な機能:
- 🧠 永続的メモリ - セッション間でコンテキストが保持される
- 📊 プログレッシブディスクロージャー - トークンコストの可視性を持つ階層的メモリ取得
- 🔍 スキルベース検索 - mem-searchスキルでプロジェクト履歴をクエリ
- 🖥️ Webビューア UI - http://localhost:37777 でリアルタイムメモリストリームを表示
- 💻 Claude Desktopスキル - Claude Desktopの会話からメモリを検索
- 🔒 プライバシー制御 -
<private>タグを使用して機密コンテンツをストレージから除外 - ⚙️ コンテキスト設定 - どのコンテキストが注入されるかを細かく制御
- 🤖 自動動作 - 手動介入不要
- 🔗 引用 - IDで過去の観察を参照(http://localhost:37777/api/observation/{id} でアクセス、またはhttp://localhost:37777 のWebビューアですべて表示)
- 🧪 ベータチャネル - バージョン切り替えでEndless Modeなどの実験的機能を試す
ドキュメント
📚 完全なドキュメントを見る - 公式ウェブサイトで閲覧
はじめに
- インストールガイド - クイックスタートと高度なインストール
- 使用ガイド - Claude-Memが自動的に動作する仕組み
- 検索ツール - 自然言語でプロジェクト履歴をクエリ
- ベータ機能 - Endless Modeなどの実験的機能を試す
ベストプラクティス
- コンテキストエンジニアリング - AIエージェントのコンテキスト最適化原則
- プログレッシブディスクロージャー - Claude-Memのコンテキストプライミング戦略の背後にある哲学
アーキテクチャ
- 概要 - システムコンポーネントとデータフロー
- アーキテクチャの進化 - v3からv5への道のり
- フックアーキテクチャ - Claude-Memがライフサイクルフックを使用する方法
- フックリファレンス - 7つのフックスクリプトの説明
- ワーカーサービス - HTTP APIとBun管理
- データベース - SQLiteスキーマとFTS5検索
- 検索アーキテクチャ - Chromaベクトルデータベースを使用したハイブリッド検索
設定と開発
- 設定 - 環境変数と設定
- 開発 - ビルド、テスト、コントリビューション
- トラブルシューティング - よくある問題と解決策
仕組み
コアコンポーネント:
- 5つのライフサイクルフック - SessionStart、UserPromptSubmit、PostToolUse、Stop、SessionEnd(6つのフックスクリプト)
- スマートインストール - キャッシュされた依存関係チェッカー(プレフックスクリプト、ライフサイクルフックではない)
- ワーカーサービス - ポート37777上のHTTP API、WebビューアUIと10の検索エンドポイント、Bunで管理
- SQLiteデータベース - セッション、観察、サマリーを保存
- mem-searchスキル - プログレッシブディスクロージャーを備えた自然言語クエリ
- Chromaベクトルデータベース - インテリジェントなコンテキスト取得のためのハイブリッドセマンティック+キーワード検索
詳細はアーキテクチャ概要を参照してください。
mem-searchスキル
Claude-Memは、過去の作業について尋ねると自動的に呼び出されるmem-searchスキルを通じてインテリジェント検索を提供します:
仕組み:
- 自然に質問するだけ: 「前回のセッションで何をしましたか?」 または 「以前このバグを修正しましたか?」
- Claudeは自動的にmem-searchスキルを呼び出して関連するコンテキストを検索します
利用可能な検索操作:
- 観察の検索 - 観察全体にわたる全文検索
- セッションの検索 - セッションサマリー全体にわたる全文検索
- プロンプトの検索 - 生のユーザーリクエストを検索
- コンセプト別 - コンセプトタグで検索(discovery、problem-solution、patternなど)
- ファイル別 - 特定のファイルを参照している観察を検索
- タイプ別 - タイプ別に検索(decision、bugfix、feature、refactor、discovery、change)
- 最近のコンテキスト - プロジェクトの最近のセッションコンテキストを取得
- タイムライン - 特定の時点周辺のコンテキストの統一タイムラインを取得
- クエリ別タイムライン - 観察を検索し、最適な一致周辺のタイムラインコンテキストを取得
- APIヘルプ - 検索APIドキュメントを取得
自然言語クエリの例:
"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?"
詳細な例は検索ツールガイドを参照してください。
ベータ機能
Claude-Memは、Endless Mode(拡張セッション用の生体模倣メモリアーキテクチャ)などの実験的機能を備えたベータチャネルを提供します。http://localhost:37777 → SettingsのWebビューアUIから安定版とベータ版を切り替えます。
Endless Modeと試用方法の詳細については、ベータ機能ドキュメント を参照してください。
システム要件
- Node.js: 18.0.0以上
- Claude Code: プラグインサポートを備えた最新バージョン
- Bun: JavaScriptランタイムおよびプロセスマネージャー(不足している場合は自動インストール)
- uv: ベクトル検索用のPythonパッケージマネージャー(不足している場合は自動インストール)
- SQLite 3: 永続ストレージ用(バンドル済み)
設定
設定は~/.claude-mem/settings.jsonで管理されます(初回実行時にデフォルト値で自動作成)。AIモデル、ワーカーポート、データディレクトリ、ログレベル、コンテキスト注入設定を構成します。
利用可能なすべての設定と例については、設定ガイド を参照してください。
開発
ビルド手順、テスト、コントリビューションワークフローについては、開発ガイド を参照してください。
トラブルシューティング
問題が発生した場合は、Claudeに問題を説明すると、troubleshootスキルが自動的に診断して修正を提供します。
よくある問題と解決策については、トラブルシューティングガイド を参照してください。
バグレポート
自動ジェネレーターで包括的なバグレポートを作成します:
cd ~/.claude/plugins/marketplaces/thedotmack
npm run bug-report
コントリビューション
コントリビューションを歓迎します! 以下の手順に従ってください:
- リポジトリをフォーク
- 機能ブランチを作成
- テストと共に変更を加える
- ドキュメントを更新
- プルリクエストを提出
コントリビューションワークフローについては開発ガイドを参照してください。
License
This project is licensed under the Apache License 2.0 (Apache-2.0).
Copyright (C) 2025 Alex Newman (@thedotmack). All rights reserved.
See the LICENSE file for full details.
Apache-2.0 allows broad use, modification, distribution, and commercial use, subject to its terms.
Ragtime note: The ragtime/ directory is licensed under the Apache License 2.0. See ragtime/LICENSE for details.
サポート
- ドキュメント: docs/
- Issues: GitHub Issues
- リポジトリ: github.com/thedotmack/claude-mem
- 作者: Alex Newman (@thedotmack)
Claude Agent SDKで構築 | Claude Codeで動作 | TypeScriptで作成