memai-distill

memai-distill is a skill for Claude Code, Codex from Filipe-Soares-de-Almeida/MemAI. It costs 141 tokens per session (2,419 once invoked), scanned A, original, MIT.

Instructions for moving durable knowledge between MemAI memory types, such as notes, reasoning, anti-patterns, and checkpoints.

In plain words
What is it for?
Use it to distill checkpoints into notes, preserve reasoning, record pitfalls, or merge near-duplicate memories.
Why use it?
It separates lasting facts from temporary session context and can merge related memories while keeping the source records recoverable.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to distill checkpoints into notes, preserve reasoning, record pitfalls, or merge near-duplicate memories.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/filipe-soares-de-almeida/memai/memai-distill
Install

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.

Any agent
npx skills add Filipe-Soares-de-Almeida/MemAI --skill memai-distill
Clone the repo
git clone --depth 1 https://github.com/Filipe-Soares-de-Almeida/MemAI

Made for: Claude Code, Codex.

Wrote 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.

agentmods badge for memai-distill

README.md
[![agentmods](https://agentmods.dev/badge/skills/filipe-soares-de-almeida/memai/memai-distill/github.svg)](https://agentmods.dev/skills/filipe-soares-de-almeida/memai/memai-distill)
Your own site
<a href="https://agentmods.dev/skills/filipe-soares-de-almeida/memai/memai-distill"><img src="https://agentmods.dev/badge/skills/filipe-soares-de-almeida/memai/memai-distill/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.

agentmods 80×15 button for memai-distill

Your own site · 80×15
<a href="https://agentmods.dev/skills/filipe-soares-de-almeida/memai/memai-distill"><img src="https://agentmods.dev/badge/skills/filipe-soares-de-almeida/memai/memai-distill.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 141 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,419 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00141 $0.02419
Opus 5 $0.00071 $0.01210
Sonnet 5 $0.00028 $0.00484
Haiku 4.5 $0.00014 $0.00242

Measured 11d ago against content hash b6073293e618, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

memai-distill 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 11d 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.

src/memai/skills/memai-distill/SKILL.md · 180 lines

How it starts

The opening of the file, as written. The whole thing — 180 lines — stays where its author put it; the contents beside it link to each section on GitHub.

memai-distill — distill / move type / merge

Saves the durable knowledge that is stuck in the wrong type, or held in a checkpoint that is about to be archived, without losing any of it.

The type boundary ([[memai-memory]] §1): note = a timeless fact; reasoning = an analysis trace; anti_pattern = a trap; checkpoint = transient bearing. When a checkpoint (or a reasoning) carries a fact that outlives the session, that fact wants to be a note.


1. distill — extract the durable (ARCHIVES the sources)

optimize_stage kind distill, payload {source_uids:[...], new_type:"note|reasoning|anti_pattern", new_content, title, tags?, domain?}: creates the new memory, links supersedes from it to every source and archives every source. The dashboard's undo purges the created memory and restores each source, so the whole thing is reversible. Two uses:

  • retiring the checkpoints of finished work while keeping what they taught;
  • n-ary merge: folding N near-duplicates into one, with synthesized content.

verified is required — the kind archives its sources. Say what the live-facts check was and where the durable content landed.

Payload details:

  • new_type accepts only note / reasoning / anti_pattern. checkpoint/handoff are not targets, and neither is diagram: a flow is written by diagram() + diagram_node/diagram_edge, never from prose.
  • reasoning and anti_pattern are made of FIELDS, so a new_content for either has to read back as those fields — each label opening its own line, in order, none empty: HYPOTHESIS: … / REASONING: … / RESULT: … / REVISED BELIEF: … / NEXT TIME: … and TEMPTATION: … / WHY WRONG: … / INSTEAD: …. A body that does not is refused at staging and comes back in errors, naming the field. Distilling into note has no such shape.
  • domain is a path (acme/x100/p200). The new memory inherits nothing from its sources, so state where it is filed — omit it and the memory is filed nowhere. A cross-cutting axis does not go here: after the apply, crosslist ({"also": ["omni/x900"]}) or also_domain(uid, 'omni/x900').
  • The payload accepts source_uids, new_type, new_content, title, tags and domain, and nothing else. Any other key is refused at staging and returned in errors, so also, review_after, source_ref and session do not travel with a distill — they are the follow-up in §2.
  • title is required, at most 120 characters. distill is the only suggestion kind that AUTHORS a memory, and nothing names it afterwards: staged without one, the new memory would be listed by the opening line of its body forever. Name it by its subject, in the words someone would look for it by — the same line a note() would have taken.
  • A diagram cannot be a source. Its content is the projection of its graph, and archiving it trades a navigable flow for prose, so staging refuses it. An obsolete diagram is an explicit archive; a wrong one is a fix to the graph. It never arrives as a candidate from dedup_scan either, which excludes diagrams from its pairs.

Read the full file on GitHub · 180 lines

Changes

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.

  1. 11d ago First seen · 180 lines · 141 tokens per session scan A b6073293e618

Subscribe to this mod's changes

memai-distill is a skill published in the GitHub repository Filipe-Soares-de-Almeida/MemAI (0 stars, last pushed yesterday), licensed MIT. It adds 141 tokens to every session and 2,419 once invoked, about $0.0007 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.

Related

Other skills, from other repositories

browserwing-executor

Control browser automation through HTTP API. Supports page navigation, element interaction (click, type, select), data extraction, accessibility snapshot analysis, screenshot, JavaScript execution, and batch operations.

MemTensor/MemOS · 42 tokens

dev-browser

Browser automation with persistent page state. Use when users ask to navigate websites, fill forms, take screenshots, extract web data, test web apps, or automate browser workflows. Trigger phrases include "go to [url]", "click on", "fill out the form", "take a screenshot", "scrape", "automate", "test the website"…

MemTensor/MemOS · 84 tokens

ask-user-question

Ask users questions via the UI. Use when you need clarification, user preferences, or confirmation before proceeding. The user CANNOT see CLI output - this tool is the ONLY way to communicate with them.

MemTensor/MemOS · 44 tokens

memos-memory-guide

Use the MemOS Local memory system to search and use the user's past conversations. Use this skill whenever the user refers to past chats, their own preferences or history, or when you need to answer from prior context. When auto-recall returns nothing (long or unclear user query), generate your own short search query…

MemTensor/MemOS · 131 tokens

memmachine-memory

Use when an agent or model needs durable project, user, or session context from MemMachine, needs to save information to MemMachine memory, has requests involving mem-cli, memmachine, or memmachineclient, has insufficient conversation context, or is tempted to search local files for prior context that should come from…

MemMachine/MemMachine · 96 tokens

browserwing-admin

Manage and operate BrowserWing — an intelligent browser automation platform. Install dependencies, configure LLM, create/manage/execute automation scripts, use AI-driven exploration to generate scripts, browse the script marketplace, and troubleshoot issues.

MemTensor/MemOS · 47 tokens