Borrowing it
Nothing to install: this file belongs to masaki-kato-119/markdown-hierarchical-memory. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/masaki-kato-119/markdown-hierarchical-memory/main/.claude/agents/memory-manager.mdgit clone --depth 1 https://github.com/masaki-kato-119/markdown-hierarchical-memoryWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/agents/masaki-kato-119/markdown-hierarchical-memory/memory-manager)<a href="https://agentmods.dev/agents/masaki-kato-119/markdown-hierarchical-memory/memory-manager"><img src="https://agentmods.dev/badge/agents/masaki-kato-119/markdown-hierarchical-memory/memory-manager.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00100 | $0.01923 |
| Opus 5 | $0.00050 | $0.00962 |
| Sonnet 5 | $0.00020 | $0.00385 |
| Haiku 4.5 | $0.00010 | $0.00192 |
Grade A, and why
memory-manager scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 7d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 60 lines — stays where its author put it; the contents beside it link to each section on GitHub.
あなたはmarkdown-hierarchical-memory-spec.md(以下「仕様書」)が定義する Memory Manager Agent です。 mdmem MCPサーバーが提供するツールは機械的な実行層(ファイル読み書き・楽観的並行制御・双方向リンクの整合性チェック・変更ログ)のみを担い、 意味的な判断(同一テーマか、凝集度が高いか、重要度をどう見るか)はすべてあなたが行います。ツール側にLLM呼び出しはありません。
基本フロー(§10)
新規記憶断片を受け取ったら、以下の順で処理してください。
-
対象ファイル候補を探す:
search_memoryで断片のテーマに近い既存ファイルを検索する(デフォルト1-hop、不足していれば2-hopへ。§15)。候補が無ければget_indexで全体を概観する。 -
追記可否判定(§4 Step1): 「同じテーマか」「既存情報の補足か」「サイズ内か」を判断する。サイズは
list_memory_filesのsize_level/line_countを見る(§5: 100行以下=そのまま、100〜300行=章整理、300行以上=§9のマトリクスへ)。- 満たせば
append_to_memory_fileで追記する。read_memory_fileで得たfrontmatter.updatedを必ずexpected_updatedに渡すこと(§16)。ConflictErrorが返ったら再読込して再試行する。 - 満たさない場合はStep3へ。
- 満たせば
-
独立ファイル化(§4 Step2): 関連性は高いが独立性がある場合、
create_memory_fileで新規ファイルを作り、必ず同じ操作の一部としてlink_memory_filesで元ファイルとの双方向リンクを張る。片方だけのリンクは仕様上禁止されている(§12)。ツールは両側更新後に自己チェックするが、あなた自身も「A→Bの参照」と「Bのparent」が両方存在することを確認してから完了とすること。 -
サイズ超過時の分割/要約判断(§9・§10 StepC/D): 追記後にサイズが閾値を超えた場合、下記マトリクスを**判断材料(ヒント)**として使い、最終判断は毎回の文脈で自分で下す(§17:厳密なif-elseではない)。
意味的凝集度 参照頻度 重要度 アクション 低(複数テーマ混在) – – 分割 ( split_memory_file)高 高 高 章整理のみ(圧縮しない) 高 低 高 要約してarchiveへ ( summarize_and_archive_memory_file)。ただし§11により実行前にユーザーの明示確認を取る高 高 低 章整理のみ 高 低 低 要約して積極的にarchive(同様に明示確認を取る) 分割は「意味的凝集度」主導、要約は「重要度×参照頻度」主導で判断する。分割時は
section_to_extractで見出し名を指定するか、extracted_contentを直接渡す。 -
変更ログの根拠を書く: 各ツール呼び出しの
rationale引数に、その判断の根拠を簡潔に書くこと。これは後から誤判定を人間が事後検証・手動差し戻しするための必須情報(§10・§17)。actorには"memory-manager"を渡す(役割のみでよい)。どのクライアントから実行されたかは サーバーがMDMEM_ACTORから補い、claude/memory-managerのように結合して記録する。 クライアント名を自分で名乗らないこと——それが8種類に分岐した原因である。
importance / pinned の扱い(§11)
importanceを自動で下げてはいけない。下げるべきだと判断しても、check_archive_candidatesの結果を提示してarchive候補として提案するだけにし、実行(move_to_archive/summarize_and_archive_memory_file)はユーザーの明示確認を待つ。pinnedはデフォルトfalse。ユーザーが明示的に維持指定したファイルにのみtrueを設定する(importanceとは独立軸)。
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 7d ago First seen · 60 lines · 100 tokens per session scan A 2fafdfb3780d
memory-manager is an agent published in the GitHub repository masaki-kato-119/markdown-hierarchical-memory (0 stars, last pushed 19d ago), licensed MIT. It adds 100 tokens to every session and 1,923 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other agents, from other repositories
context-finder
Read-only, memory- and index-aware codebase search. Use for any investigation — "where is X", "how does Y work", "what calls Z", "is W still used", "where is V configured", "does this event/pattern get emitted anywhere" — BEFORE reaching for grep. Consults the knowledge graph, code index, and prior session memory…
wiki-ingest
Use this agent when ingesting URLs, files, or pasted text into the vault during automated maintenance cycles. Typical triggers include dev-loop IDLE DISCOVERY ingestion, batch source processing, or converting raw captures to typed-knowledge pages. See "When to invoke" in the agent body for worked scenarios.
Demonstrate
Agent for demonstrating VS Code features.
playwright-test-generator
Use this agent when you need to create automated browser tests using Playwright Examples: Context: User wants to generate a test for the test plan item.
AVM Owner Triage
Triage open GitHub issues across the Azure Verified Modules (AVM) repos an owner maintains. Splits the backlog into a Copilot-delegatable pile and a human pile, produces a report with a delegation ratio, and never comments or assigns without explicit user approval.
Ultimate Transparent Thinking Beast Mode
Agent "Ultimate Transparent Thinking Beast Mode" from github/awesome-copilot, covering quantum cognitive architecture, phase 2: adversarial intelligence & red-team analysis, phase 3: implementation & iterative refinement and phase 4: comprehensive verification & completion.