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/sauliusdev/glyph/codebase-memory-distillnpx skills add SauliusDev/glyph --skill codebase-memory-distillgit clone --depth 1 https://github.com/SauliusDev/glyphWhat 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.00031 | $0.01436 |
| Opus 5 | $0.00015 | $0.00718 |
| Sonnet 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 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 — 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.
- yesterday First seen · 157 lines · 31 tokens per session scan A b9c62fce8ea4
codebase-memory-distill is a skill published in the GitHub repository SauliusDev/glyph (2 stars, last pushed 29d ago), licensed MIT. It adds 31 tokens to every session and 1,436 once invoked, about $0.0002 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
docs-writer
Draft or rewrite Strands Agents documentation pages. Use when writing new doc pages, rewriting pages that failed audit, drafting sections for existing pages, or writing blog posts and release notes about Strands. Also triggers on "write a doc", "draft a page", "rewrite the quickstart", "add a tutorial for X"…
docs-reviewer
Review documentation drafts for voice consistency, structure, and terminology before PR submission. Use after completing a draft, when checking if docs are ready to ship, or automatically after docs-writer produces output. Also triggers on "review this draft", "check my docs", "is this ready to ship", "review before…
docs-planner
Identify documentation gaps and prioritize the docs backlog. Use when planning a docs improvement sprint, after signals surface repeated friction, when new SDK features ship without docs, or for periodic health assessment. Also triggers on "plan docs work", "what docs need writing", "prioritize the backlog", "docs…
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.
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.
case-study
Craft a portfolio case study with narrative arc, process evidence, and outcomes. Use when telling a project's story to an external audience. For an internal stakeholder deck, use presentation-deck.