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 SauliusDev/glyph --skill codebase-memory-distillgit clone --depth 1 https://github.com/SauliusDev/glyphWrote 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/sauliusdev/glyph/codebase-memory-distill)<a href="https://agentmods.dev/skills/sauliusdev/glyph/codebase-memory-distill"><img src="https://agentmods.dev/badge/skills/sauliusdev/glyph/codebase-memory-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.
<a href="https://agentmods.dev/skills/sauliusdev/glyph/codebase-memory-distill"><img src="https://agentmods.dev/badge/skills/sauliusdev/glyph/codebase-memory-distill.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.00031 | $0.01436 |
| Opus 5.5 | $0.00012 | $0.00574 |
| Sonnet 5.5 | $0.00006 | $0.00287 |
| Haiku 4.5 | $0.00003 | $0.00144 |
Grade A, and why
codebase-memory-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 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 — 157 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Codebase Memory — Distill
Harvest the inline @agent: notes a project accumulated (lessons, decisions,
invariants, gotchas), find the ones that recur or generalize beyond this
codebase, and distill them into reusable rules for the next project.
Inline notes are the raw feed; distilled rules are the compounding payoff. Run this at project close, or periodically on a long-lived codebase.
Applies the "deterministic collection + LLM judgment" principle: a script harvests every note exhaustively, then an LLM cross-reads them and proposes which deserve promotion to rules.
Distillation (end of project)
At project close, harvest the memory with the paired codebase-memory-distill skill, or directly:
grep -rn "@agent:" --include='*.*' .
Cluster recurring lesson/invariant/decision notes and promote the durable
ones into reusable rules for the next project. Inline notes are the raw feed;
the distilled rules are the compounding payoff.
When to Use
- End of a project — capture what was learned before it scatters.
- Periodically on a long-running codebase (e.g. quarterly).
- Before starting a sibling project that shares stack/domain.
How It Works
Three phases.
Phase 1: Harvest (Deterministic Collection)
bash {skill-dir}/scripts/scan-agent-notes.sh {project-root}
Outputs JSON: every @agent: note with path, line, tag, date,
revisit_if, text, plus a by_tag count.
Present a one-screen summary:
Codebase Memory Distill — Phase 1: Harvest
──────────────────────────────────────────
Notes found: {N} (lesson {a}, decision {b}, invariant {c}, gotcha {d})
Root: {project-root}
Proceeding to distillation...
If 0 notes: stop and say so — nothing to distill.
Phase 2: Distill (LLM Judgment)
Feed the harvested notes to a subagent. The job: separate durable, generalizable knowledge from project-local knowledge, and draft rules for the former.
Cluster notes by theme first (e.g. "time/timezone", "numeric precision", "concurrency/ordering", "data leakage"). A theme hit by 2+ notes — even across different files — is a strong promotion signal.
What ships with it
1 file 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.
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 · 157 lines · 31 tokens per session scan A b9c62fce8ea4
codebase-memory-distill is a skill published in the GitHub repository SauliusDev/glyph (1 stars, last pushed 2mo ago), licensed MIT. It adds 31 tokens to every session and 1,436 once invoked, about $0.0001 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
kb-builder
Build an Obsidian-compatible knowledge base from public web sources using the TinyFish CLI. Use this skill when a user wants a builder-grade markdown knowledge base on a technical topic, asks for a structured research vault, or wants a topic compiled from live public sources into interlinked markdown files. Supports…
self-improve-with-tinyfish
Enables Hermes to create new reusable skills for itself by researching live web sources with TinyFish Search and Fetch, analyzing source coverage, writing SKILL.md files, and installing them into Hermes memory. Use when the user asks Hermes to learn, teach itself, upgrade itself, or save a reusable capability.
weknora-shared
Use when driving a WeKnora RAG server through the weknora CLI as an agent — authenticating, managing knowledge bases / documents / sessions / agents, running search or chat, or interpreting the CLI's JSON envelopes and exit codes. Read this before any other weknora- skill.
weknora-rag-search
Use when retrieving from or asking questions against a WeKnora knowledge base via the weknora CLI — and especially when unsure whether to use chat, session ask, or search chunks for a given goal.
powercontext-project-context
A project-memory guide for searching, saving, correcting, and transferring durable context through the PowerContext service. It distinguishes ordinary conversation from information that should persist between sessions.
02-project-memory
Build the project's memory of its architecture, conventions, and decisions, and wire it into your AI tools. Use when the user wants to set up or refresh project memory, or rewire it into a tool. Not for editing one existing memory file.