ai-agents knowledge-persistence.instructions.md

ai-agents knowledge-persistence.instructions.md is an instructions file for GitHub Copilot from rjmurillo/ai-agents. It costs 1,482 tokens per session, scanned A, original, MIT.

Repository instructions for deciding where durable engineering knowledge belongs, including rule files, generated mirrors, and Serena memories.

In plain words
What is it for?
Adding or changing shared rules, regenerating instruction mirrors, and deciding whether new information belongs in a rule or a memory.
Why use it?
They prevent important rules from being stored in only one tool's memory or from leaving generated instruction copies out of date.

Instructions file for GitHub Copilot

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.

agentmods
npx agentmods add instructions/rjmurillo/ai-agents/knowledge-persistence
Clone the repo
git clone --depth 1 https://github.com/rjmurillo/ai-agents

Made for: GitHub Copilot.

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 ai-agents knowledge-persistence.instructions.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/rjmurillo/ai-agents/knowledge-persistence.svg)](https://agentmods.dev/instructions/rjmurillo/ai-agents/knowledge-persistence)
Your own site
<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>
Per session 1,482 This file is loaded in full into every session.
When invoked 1,482 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
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 $0.01482 $0.01482
Opus 5 $0.00741 $0.00741
Sonnet 5 $0.00296 $0.00296
Haiku 4.5 $0.00148 $0.00148

Measured yesterday against content hash 6ea237578f81, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

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.

.github/instructions/knowledge-persistence.instructions.md · 74 lines

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

  1. 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.md directs every harness to read .claude/rules/*.md first, so Claude (reads the tree directly) and Codex (reads AGENTS.md) both resolve to it, and Copilot reads the generated mirror.
  2. Regenerate the mirrors in the same change. Adding or editing a .claude/rules/*.md file MUST regenerate .github/instructions/<name>.instructions.md and src/copilot-cli/instructions/<name>.instructions.md with build/scripts/generate_rules.py, committed in the same change. A stale mirror is torn state (see .claude/rules/generated-artifacts.md).
  3. Leave the plugin manifests alone. .claude/ and src/copilot-cli/ ship in the project-toolkit plugin, but the manifests carry no version field: Claude Code resolves freshness from the commit SHA instead, so a rule change needs no manifest edit. Adding a version back fails build/scripts/validate_plugin_version_bump.py (see .claude/rules/plugin-version-bump.md and ADR-092).
  4. Scope by paths:. Set paths: to the narrowest glob that fires where the convention applies (tests/**, **/*.ps1). A universally-binding convention sets paths: ["**"].
  5. Index a new Serena memory by hand. A memory under .serena/memories/ MUST get a keyword line in memory-index.md in the same change, or keyword retrieval cannot reach it. memory_index.py --ci checks only that index rows resolve to files, never the reverse, so nothing catches the omission. Write (0) as the token placeholder; the memory-token-update pre-commit job rewrites it to the real count.
  6. Repair token counts by hand when the autofix is skipped. memory-token-update carries skip: [merge, "test $SKIP_AUTOFIX = 1"], so a memory edited inside a merge commit, or committed with SKIP_AUTOFIX=1, keeps a stale count. Pre-push memory-index-token-ratchet then fails and names every stale entry. Fix it by running uv run --frozen python scripts/update_memory_index_tokens.py, not by editing the number by hand. Measured on pristine main before the ratchet existed: skills-git-index recorded 287 against an actual 324, a 13% undercount that merged (Issue #4441).

Read the full file on GitHub · 74 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. yesterday First seen · 74 lines · 1,482 tokens per session scan A 6ea237578f81

Subscribe to this mod's changes

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.