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/fernsdavid25/cortex-protocol/using-cortex-memorynpx skills add fernsdavid25/cortex-protocol --skill using-cortex-memorygit clone --depth 1 https://github.com/fernsdavid25/cortex-protocolWhat 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.00082 | $0.01382 |
| Opus 5 | $0.00041 | $0.00691 |
| Sonnet 5 | $0.00016 | $0.00276 |
| Haiku 4.5 | $0.00008 | $0.00138 |
Grade A, and why
using-cortex-memory 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 yesterday.
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 — 94 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Using Cortex Memory — get maximum value from the user's memory
Cortex is the USER'S portable, cross-agent memory — you are one of several AIs reading and writing the same store, with their consent. Write for a reader that isn't you; recall before you assume; the user's memory outlives this session and this agent.
How Cortex works (why the rules below exist)
- Recall is hybrid search with NO LLM: dense embeddings + keyword search fused by rank. Your query text is the entire retrieval signal — names, distinctive words, and paraphrases of meaning all help; no model on the server interprets vague queries. Recall is one embedding call: fast and cheap, so use it liberally.
- Enrichment happens at WRITE time: when you memorize, Cortex extracts entities and relationships into a knowledge graph, resolves dates onto an event timeline, deduplicates near-identical facts, and supersedes contradicted ones (old versions are kept, marked outdated — never silently lost). The quality of all of that depends on how you phrase what you store.
- The tools are specialized reads over one store — routing correctly is most of this skill.
Routing — pick the right tool for the question
| Situation | Tool |
|---|---|
| Specific question ("what stack does she prefer?") | recall — phrase with names + meaning |
| "Tell me everything about X" (person/project/place) | recall_about — exhaustive entity dossier (relations + attached memories); top-k recall structurally can't enumerate |
| "What happened last month / between dates / when did…" | recall_timeline — queries true event time, not storage time |
| "What's recently stored?" / orientation | list_memories |
| User states something durable / corrects a fact | memorize (supersession is automatic) |
| User asks to delete / data is wrong or sensitive | forget — immediately, no debate |
Writing memories that retrieve well (the craft)
- One fact per memorize. Bundled paragraphs dedupe badly, embed vaguely, and can't be individually superseded or forgotten. Split compound facts.
- Self-contained phrasing: resolve every pronoun and implicit reference — "David prefers pnpm over npm for all projects", never "he prefers it". Another agent with zero context is the reader.
- Name the entities explicitly (people, projects, places, orgs): names power the graph extraction, the entity dossiers, AND the keyword half of retrieval. "Swizel (David's girlfriend) likes apples" builds graph edges; "she likes apples" builds nothing.
- Anchor time absolutely: "on 2026-07-05" or "in March 2026". Relative phrases ("yesterday") are resolved against the write date, so they work — but absolute dates are safer and survive re-telling.
- Store the durable, skip the transient: preferences, profile facts, decisions and their reasons, relationships, recurring context, important events. Do NOT store: this-session task state, secrets/credentials/API keys (never — memory is not a vault), huge pasted content (store the fact plus where the content lives), or trivia the user wouldn't expect remembered.
- Updates are new writes: when a fact changes ("I switched to pnpm"), memorize the new
state — Cortex supersedes the old version automatically. Use
forgetonly for deletion requests and wrong/sensitive data, not for routine updates. - Classify with
kind— one ofpreference,fact,project,instruction,event,relationship(unset defaults tofact). It improves organization and the user's dashboard view; addtagswhen a natural grouping exists.
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.
- yesterday First seen · 94 lines · 82 tokens per session scan A 9a11a8496124
using-cortex-memory is a skill published in the GitHub repository fernsdavid25/cortex-protocol (2 stars, last pushed 27d ago), licensed Apache-2.0. It adds 82 tokens to every session and 1,382 once invoked, about $0.0004 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 skills, from other repositories
lesson
Store a lesson learned from the current conversation. Triggered by /lesson command. Use when Master signals that the recent conversation contains a pitfall, fix, or key insight that should be persisted to long-term memory.
memory-audit
记忆审计入口。当我主动决定审视记忆质量时,先读此文件判断应使用哪个子技能。.
memory-audit-belief-duel
信念对决。当父子节点内容冲突、或两条你都认可的记忆逻辑上不能并存时使用。.
memory-audit-discoverability
可发现性审计。当disclosure写法有问题、parent放错、alias缺失、子节点过多时使用。.
memory-audit-node-decomposition
节点分解。当一个节点体积过大、或塞了多个不相关概念导致disclosure无法覆盖时使用。.
memory-audit-pattern-extraction
模式提取与失效解药分析。当发现多条记忆在讲同一个教训,或发现自己在一而再再而三地犯同样的错误时使用。.