Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add skills/lee-w/maigo/memory-loadingnpx skills add Lee-W/maigo --skill memory-loadinggit clone --depth 1 https://github.com/Lee-W/maigoWhat 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 | $0.00068 | $0.01617 |
| Opus 5 | $0.00034 | $0.00809 |
| Sonnet 5 | $0.00014 | $0.00323 |
| Haiku 4.5 | $0.00007 | $0.00162 |
Grade B, and why
memory-loading scanned grade B with 1 finding 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 2d 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.
Reads agent configuration directoriesmediumAgent snooping
.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.
- **Per-project**:`cat ~/.claude/projects/<current-project>/memory/MEMORY.md`(若存在) How it starts
The opening of the file, as written. The whole thing — 90 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Memory Loading
Owner: all agents
Consumers: agents/Raana.md、agents/Tomori.md、agents/Soyo.md、orchestrator 本身
為什麼這個 skill 存在
三個 agent 在啟動時都要做相同的「讀記憶 → schema 自檢 → fallback」流程,但過去各自在 agent prompt 裡重複寫。這個 skill 是三者共通行為的 single source of truth。
orchestrator 自己也是 consumer:orchestrator 開始跑任何 /maigo:* 流程前,也要主動查一次
memory,不能只靠 delegate 給 Raana/Tomori/Soyo 時才觸發這個 skill——曾經因為只有 delegate 對象
會查記憶,orchestrator 自己重複違反同一條「背景 agent 不用 ScheduleWakeup 輪詢」的教訓,兩次都
沒查過記憶就重犯(見 skills/failure-handling「等待自己開的背景 agent」段)。
標準 5 步流程
啟動後、正式開始工作之前,先載入記憶(兩層):
-
依序讀兩個 index:
- Cross-project:
cat ~/.config/maigo/memory/MEMORY.md - Per-project:
cat ~/.claude/projects/<current-project>/memory/MEMORY.md(若存在)
<current-project>是當前專案路徑 slug 化的結果(與validate_memory.py相同的枚舉方式——即~/.claude/projects/下對應的目錄名,例如-Users-weilee-Programming-personal-maigo)。 - Cross-project:
-
讀 index 每行
- [Title](file.md) — description(兩層 index 合併),判斷哪些 description 跟當前 task 的 keyword / 主題有 overlap -
相關性排序:把兩層合併後的候選 entry 依匹配度排序
-
限量載入:若相關條目過多,僅 Read 最相關的前 10 筆 entry 全文——10 筆是兩層合計上限,不是每層各 10;當作這次工作的 context
-
在輸出開頭印
## Loaded memory entries段,列出用了哪些 entry
Schema 自檢(lazy)
對每個讀進來的 entry frontmatter 做最小檢查:
- 缺
name/description/type任一欄位 type值不在{user, feedback, project, reference}
遇到問題不 abort,繼續使用該 entry(lenient),但在 ## Loaded memory entries 段該行末尾加 [schema warn: <缺什麼或 type 不合法>]。
完整檢查可手動跑 python3 scripts/validate_memory.py。
Fallback 規則(不報錯、不抱怨、繼續做事)
兩層各自獨立 fallback,任一層不影響另一層:
- 某一層目錄不存在 → 該層當「沒記憶」,另一層照常讀
- 某一層
MEMORY.md不存在或是空的 → 該層當「沒記憶」,另一層照常讀 - 某一層 index 裡完全沒有跟當前 task 相關的 entry → 該層當「沒記憶」,另一層照常讀
- 兩層皆無相關記憶才整體當「沒記憶」處理
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.
- 2d ago First seen · 90 lines · 68 tokens per session scan B 182d2125e895
memory-loading is a skill published in the GitHub repository Lee-W/maigo (14 stars, last pushed 9d ago), licensed MIT. It adds 68 tokens to every session and 1,617 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
systematic-debugging
Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.
brainstorming
You MUST use this before any creative work - creating features, building components, adding functionality, or modifying behavior. Explores user intent, requirements and design before implementation.
auto-perf-optimize
Run agent-driven VS Code performance or memory investigations. Use when asked to launch Code OSS, automate a VS Code scenario, run the Chat memory smoke runner, capture renderer heap snapshots, take workflow screenshots, compare run summaries, or drive a repeatable scenario before heap-snapshot analysis.
chat-perf
Run chat perf benchmarks and memory leak checks against the local dev build or any published VS Code version. Use when investigating chat rendering regressions, validating perf-sensitive changes to chat UI, or checking for memory leaks in the chat response pipeline.
chat-pet-sprite-creation
Use when creating or changing VS Code chat pet sprite art, sprite sheets, state animations, eye treatments, Stable/Insiders variants, or pet transitions under src/vs/workbench/contrib/chat/browser/widget/media/chatPet.
cpu-profile-analysis
Analyze V8/Chrome CPU profiles (.cpuprofile) and DevTools trace files (Trace-.json). Use when: profiling performance, investigating slow functions, comparing code paths, finding bottlenecks, analyzing timeToRequest, understanding call trees from sampling profiler data, analyzing layout/paint/rendering, investigating…