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 instructions/rjmurillo/ai-agents/knowledge-persistencegit clone --depth 1 https://github.com/rjmurillo/ai-agentsWrote 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/instructions/rjmurillo/ai-agents/knowledge-persistence)<a href="https://agentmods.dev/instructions/rjmurillo/ai-agents/knowledge-persistence"><img src="https://agentmods.dev/badge/instructions/rjmurillo/ai-agents/knowledge-persistence.svg" alt="Measured on agentmods" 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 | $0.01482 | $0.01482 |
| Opus 5 | $0.00741 | $0.00741 |
| Sonnet 5 | $0.00296 | $0.00296 |
| Haiku 4.5 | $0.00148 | $0.00148 |
Grade A, and why
ai-agents knowledge-persistence.instructions.md 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 — 74 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Knowledge Persistence Rule
This rule covers the mechanics of writing to a persistence surface: rule files, the mirrors generated from them, and Serena memories. It fires when you edit one of those trees.
Choosing which surface a fact belongs on binds earlier, before you know which tree you will open, so that decision procedure lives in the always-on Universal Rules under "Choosing a persistence surface".
MUST
- Canonical rule lives in
.claude/rules/. A convention that must bind across Claude, Codex, and Copilot MUST be written to.claude/rules/<name>.md, not only to Serena memory or Copilot Memory.AGENTS.mddirects every harness to read.claude/rules/*.mdfirst, so Claude (reads the tree directly) and Codex (readsAGENTS.md) both resolve to it, and Copilot reads the generated mirror. - Regenerate the mirrors in the same change. Adding or editing a
.claude/rules/*.mdfile MUST regenerate.github/instructions/<name>.instructions.mdandsrc/copilot-cli/instructions/<name>.instructions.mdwithbuild/scripts/generate_rules.py, committed in the same change. A stale mirror is torn state (see.claude/rules/generated-artifacts.md). - Leave the plugin manifests alone.
.claude/andsrc/copilot-cli/ship in the project-toolkit plugin, but the manifests carry noversionfield: Claude Code resolves freshness from the commit SHA instead, so a rule change needs no manifest edit. Adding aversionback failsbuild/scripts/validate_plugin_version_bump.py(see.claude/rules/plugin-version-bump.mdand ADR-092). - Scope by
paths:. Setpaths:to the narrowest glob that fires where the convention applies (tests/**,**/*.ps1). A universally-binding convention setspaths: ["**"]. - Index a new Serena memory by hand. A memory under
.serena/memories/MUST get a keyword line inmemory-index.mdin the same change, or keyword retrieval cannot reach it.memory_index.py --cichecks only that index rows resolve to files, never the reverse, so nothing catches the omission. Write(0)as the token placeholder; thememory-token-updatepre-commit job rewrites it to the real count. - Repair token counts by hand when the autofix is skipped.
memory-token-updatecarriesskip: [merge, "test $SKIP_AUTOFIX = 1"], so a memory edited inside a merge commit, or committed withSKIP_AUTOFIX=1, keeps a stale count. Pre-pushmemory-index-token-ratchetthen fails and names every stale entry. Fix it by runninguv run --frozen python scripts/update_memory_index_tokens.py, not by editing the number by hand. Measured on pristinemainbefore the ratchet existed:skills-git-indexrecorded 287 against an actual 324, a 13% undercount that merged (Issue #4441).
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 · 74 lines · 1,482 tokens per session scan A 6ea237578f81
ai-agents knowledge-persistence.instructions.md is an instructions file published in the GitHub repository rjmurillo/ai-agents (45 stars, last pushed today), licensed MIT. It adds 1,482 tokens to every session, about $0.0074 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-09-03.
Other instructions, from other repositories
claude-capsule-kit CLAUDE.md
Instructions for arpitnath/claude-capsule-kit, covering capsule kit v4.0, rules, context system (capsule), wikilink layer and docs.
vant AGENTS.md
AGENTS.md instructions for dhaupin/vant, covering agents.md — vant agent guide, what is vant?, your job, brain router interface and middleware chain.
claude-workspace-snapshot CLAUDE.md
Instructions for REMvisual/claude-workspace-snapshot, covering claude-workspace-snapshot, openviking memory, how it works, session workflow and files (not committed to git).
mnemo-agent CLAUDE.md
Claude Code instructions for oyekamal/mnemo-agent, covering mnemo — operating manual, rules, session connection and notes.
next.js AGENTS.md
AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.
codex AGENTS.md
AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.