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 skills add HsuanYuLee/polaris --skill memory-hygienegit clone --depth 1 https://github.com/HsuanYuLee/polarisWrote 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/skills/hsuanyulee/polaris/memory-hygiene)<a href="https://agentmods.dev/skills/hsuanyulee/polaris/memory-hygiene"><img src="https://agentmods.dev/badge/skills/hsuanyulee/polaris/memory-hygiene/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/hsuanyulee/polaris/memory-hygiene"><img src="https://agentmods.dev/badge/skills/hsuanyulee/polaris/memory-hygiene.svg" alt="Reviewed on agentmods" width="80" 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.00164 | $0.01658 |
| Opus 5.5 | $0.00066 | $0.00663 |
| Sonnet 5.5 | $0.00033 | $0.00332 |
| Haiku 4.5 | $0.00016 | $0.00166 |
Grade A, and why
memory-hygiene 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 1mo 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 — 111 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Memory Hygiene
memory-hygiene 是 manual memory tiering:檢查 Hot / Warm / Cold,產生 demotion
candidate,並在使用者確認後搬移 memory files 與更新 index。
Contract
這是 memory maintenance skill,不是一般 task planning。Scan / dry-run 只讀;apply 會寫 workspace memory,因此必須先有本 session 的 dry-run 結果與使用者明確確認。
Mode Routing
| User says | Mode | Reference |
|---|---|---|
/memory-hygiene, memory-hygiene, default |
scan | memory-hygiene-scan-flow.md |
dry-run, full report, 看看所有分類 |
dry-run | memory-hygiene-scan-flow.md |
apply, 搬檔, 執行, migrate |
apply | memory-hygiene-apply-flow.md |
retire, 退休, 清掉做完的, 過期的 memory |
retire | 見〈退休〉 |
退休:記進度的 memory,在它記的工作收斂之後就走
python3 .claude/skills/memory-hygiene/scripts/memory-hygiene-tiering.py retire \
--memory-dir {memory_dir} # 預覽,什麼都不動
python3 .claude/skills/memory-hygiene/scripts/memory-hygiene-tiering.py retire \
--memory-dir {memory_dir} --execute # 真的搬
分層不是退休。 Hot → Warm 只是換一個資料夾躺著,索引還是指得到它。退休問的是另一
個問題:這份東西記的工作還活著嗎。type: project 記的是「現在做到哪」,那件工作收斂之後
它就不再是任何人的下一步了。
判定的依據是那張單自己的狀態({單}/.spine/loop-state.json 的 status),不是誰記得
要來清——這一層已經有兩個手動退休到一半就停下來的資料夾。單號從 snapshot_of 或檔名取,
不掃內文:一份 handoff 會順帶提到十幾張單,拿內文去判會把還在用的錨點記錄,判成某張
早就收斂的單的殘骸。
四件事不退休,而且每一種都會被數出來印在報告上:type 不是 project 的、pinned: true
的(那是人的判斷,機械規則不得蓋過它)、單還在進行的、以及找不到那張單容器的。最後
那一種特別重要:把查不到當成做完了,退休掉的就是還在用的東西。
退休 = 搬進 archive/ 並從索引上拿掉,不刪檔。搬的時候會一併把指向它的連結、以及
它自己的相對連結重新算過——換了目錄,相對路徑的起點就換了,兩邊都會變成死指標。
Reference Loading
| Situation | Load |
|---|---|
| Any run | polaris-project-dir.md, feedback-memory-procedures.md |
| Scan / dry-run | memory-hygiene-scan-flow.md |
| Apply | memory-hygiene-apply-flow.md |
| 要寫一份 memory(不是維護它) | memory-write-contract.md |
memory-write-contract.md 講的是寫入端:檔案放哪個資料夾、指標寫進哪一份索引、Hot 的
軟上限、以及 pinned / topic 兩個分層欄位。它以前住在使用者機器上的常駐指示檔裡,那個
位置沒有任何關卡看得見——規矩要跟著執行它的東西走,而消費那兩個欄位的腳本就在這支 skill 的
scripts/ 底下。
Classification rules live in .claude/skills/memory-hygiene/scripts/memory-hygiene-tiering.py and
_template/rule-examples/feedback-and-memory.md Memory Tiering.
What ships with it
9 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
- references/feedback-memory-procedures.md 14 KB
- references/memory-hygiene-apply-flow.md 2.1 KB
- references/memory-hygiene-scan-flow.md 1.3 KB
- references/memory-write-contract.md 3.9 KB
- references/polaris-project-dir.md 1.3 KB
- scripts/lib/validate_memory_hygiene_plan_1.py 8.4 KB runs code
- scripts/memory-hygiene-tiering.py 76 KB runs code
- scripts/skill-sanitizer.py 23 KB runs code
- scripts/validate-memory-hygiene-plan.sh 1.6 KB runs code
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.
- 1mo ago First seen · 111 lines · 164 tokens per session scan A 24a36fd11684
memory-hygiene is a skill published in the GitHub repository HsuanYuLee/polaris (5 stars, last pushed 2d ago), licensed MIT. It adds 164 tokens to every session and 1,658 once invoked, about $0.0007 per session on Opus 5.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 skills, from other repositories
project-context-steward
A project-documentation skill that scans a new project or several related code repositories and records their shared context in a PROJECT_CONTEXT.md file. It captures the product, users, workflows, architecture, repository boundaries, terminology, entry points, and known pitfalls.
remember
Save what matters at the end of a session so the next session picks up exactly where you left off. Or restore context at the start of a new session so nothing is lost between them — and never trust this conversation's own memory over what's actually on disk.
moor
After building any UI component or resolving a notable engineering outcome, extract what matters and save it to the correct project file — the UI registry for UI patterns, the session-state file for everything else. So every future session builds on what's already established instead of drifting from it.
q-claude-setup
Use this skill when the user wants to configure Claude to know them deeply and improve itself over time. Activate when setting up projects, context files, or self-improving instructions, or when the user wants Claude to compound across sessions instead of starting from zero each time.
adapto-project-learn
Consolidate what the agent has learned while working — distill the dated notes in .adapto/project/learnings.md into the structured brain facets and close items in open-questions.md — so the project brain gets sharper over time. Reviews a diff before writing; local only (no CMS writes).
ai-agents-architect
Expert in designing and building autonomous AI agents. Masters tool use, memory systems, planning strategies, and multi-agent orchestration.