By AtsushiShimo
Local-first persistent memory for Claude Code agents — per-persona Cozo (HNSW embedding + graph) store with Ollama-driven write LLM (fact extraction + supersedes + discussion-graph nodes) and recall LLM (keyword-intercept + vector + FTS + graph). Survives /clear and session restarts.
旧 episode の topic_id を主題ベース cluster に振り直す (Cross-Session Topic Merge backfill). session_id を topic 代用していた legacy データを救済.
過去 episode から discussion_nodes を遡及生成 (0.6.17 以前ログの救済). 重いので明示実行・限定実行対応.
過去 episode から topic_tags を遡及生成 (0.6.24 以前ログの救済). 重いので明示実行・限定実行対応.
Change Ollama models used by the active persona (light = write-side, heavy = read-side compression)
ペルソナの体調 (DB / 設定 / Ollama / 直近 ingest 健全性) を包括チェックして JSON で返す
Admin access level
Server config contains admin-level keywords
Executes bash commands
Hook triggers when Bash tool is used
Own this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimOwn this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimBased on adoption, maintenance, documentation, and repository signals. Not a security audit or endorsement.
Modifies files
Hook triggers on file write and edit operations
Modifies files
Hook triggers on file write and edit operations
Local-first persistent memory for Claude Code agents.
.persona-memory/ をプロジェクトディレクトリ内に持つ/clear をまたいで会話の連続性を維持| 層 | やること | コスト |
|---|---|---|
| 書き込み (Stop / PreCompact / SessionEnd) | ユーザー発話 / アシスタント応答 / tool_use / tool_result を 無条件で生保存 + 軽量 LLM が補助的に fact 抽出 | 高頻度発火・低レイテンシ |
| 読み出し (UserPromptSubmit) | 発話を埋め込み → sqlite-vec で recall → episode 量が大きい時のみ重量 LLM で圧縮してメインエージェントの context に注入 | 必要な時だけ高品質要約 |
詳細設計は CLAUDE.md を参照。
gemma3:4b + gemma3:12b + nomic-embed-text)このリポジトリは Claude Code plugin として配布されています。private repo なので、install には repo の collaborator 権限 + git 認証 (SSH key / gh auth login) が必要です。
# Claude Code 内で
/plugin marketplace add AtsushiShimo/persona-memory
/plugin install persona-memory@persona-memory
install 後、Claude Code を完全終了 → 再起動して plugin の hooks と MCP server をロードします。
サードパーティ plugin は デフォルトで auto-update が OFF です。ON にしておくと、起動時に最新コミットが自動で取り込まれて以降の更新が楽になります:
/plugin marketplace # marketplace 一覧を出して
# (UI 操作で persona-memory の auto-update を有効化)
または手動で ~/.claude/plugin-marketplaces.json 等の設定を編集 (Claude Code のバージョンによって場所が違うので、/plugin の subcommand で確認するのが確実)。
/plugin marketplace update persona-memory # 最新コミット fetch
/plugin uninstall persona-memory@persona-memory
/plugin install persona-memory@persona-memory
/reload-plugins
注意: 単一の /plugin update コマンドは現時点で存在しません (Claude Code 仕様)。/plugin marketplace update だけだと metadata 更新で止まり、install ツリーが空になる現象を確認済み。確実なのは uninstall → install のサイクルです。
plugin install しただけでは「空のペルソナ」状態です。性格を seed する 7 質問を回します:
/persona-memory:init
Claude が AskUserQuestion ツールでクリック式の選択肢を出します (各問とも自由入力可):
Ollama モデルは推奨デフォルト (gemma3:4b / gemma3:12b / nomic-embed-text) を使います。
低スペック機で軽量化したい / 大型 GPU で品質を上げたい場合はセットアップ後に
/persona-memory:configure-models で変更できます。
完了したら Claude Code を完全終了 → 再起動。次回起動から persona facts が SessionStart で自動注入されます。
/persona-memory:list # 登録済みペルソナ一覧 (active 印 + facts/episodes 数)
/persona-memory:status # 現在のペルソナ状態 + DB stats + Ollama ヘルスチェック
/persona-memory:configure-models # 軽量/重量モデルを後から変更 (低スペック機向け軽量化など)
ペルソナ切替の slash command は意図的に提供していません (セッション中の人格切替は context 混在を起こすため)。複数ペルソナを使い分けたい場合は別ディレクトリに別 install してください。
git clone [email protected]:AtsushiShimo/persona-memory.git
cd persona-memory
scripts/init.sh # 9 質問の対話セットアップ
init.sh が以下を全部やります:
.venv 作成 + Python 依存 installdata/<persona>.db 初期化.mcp.json 生成 (このディレクトリ専用)data/<persona>.config.env 書き出し (hooks が読む環境変数)data/active-persona に persona 名を書く完了後、このディレクトリで claude を起動すれば動きます。
scripts/new-persona.sh <persona-name> <target-dir>
# 例: scripts/new-persona.sh code-reviewer ~/Desktop/code-reviewer-persona
別ディレクトリに独立した DB / 性格 / venv のペルソナが切り出されます。
/clear してもセッション再起動しても、過去の話は記憶から呼び戻るエージェントは会話で現れた preference / rule / profile / skill / context / persona 情報を確認なしで自動保存します。write_fact を意識する必要はありません。
| 用途 | 既定 | 理由 |
|---|---|---|
| 書き込み (write LLM, Stop hook 等) | 軽量 (gemma3:4b) | 全 assistant ターンで発火するので低レイテンシが効く。生ターンが救命網なので質はそこそこで OK |
| 読み出し圧縮 (recall summarize / discussion 抽出) | 重量 (gemma3:12b) | recall 量が多い時だけ発火、出力はメインエージェントの context に直接注入されるので品質重視 |
両方とも環境変数 (PERSONA_LIGHT_MODEL / PERSONA_HEAVY_MODEL) で上書き可能。init.sh の質問 1〜2 でも変更できます。
.persona-memory/<persona>.cozo.db (Cozo) の ローカルファイルのみscripts/secrets/detect.py + on-user-prompt hook で シークレット検出 (sk-... / GitHub PAT / AWS key 等の正規表現 + 高エントロピートークン)、検出した場合はプロンプトを Anthropic に送る前にブロック → ユーザーへ警告.mcp.json も per-host のため commit 対象外npx claudepluginhub atsushishimo/persona-memory --plugin persona-memoryMemory compression system for Claude Code - persist context across sessions
Standalone image generation plugin using Nano Banana MCP server. Generates and edits images, icons, diagrams, patterns, and visual assets via Gemini image models. No Gemini CLI dependency required.
Multi-model consensus engine integrating OpenAI Codex CLI, Gemini CLI, and Claude CLI for collaborative code review and problem-solving.
Write feature specs, plan roadmaps, and synthesize user research faster. Keep stakeholders updated and stay ahead of the competitive landscape.