amfs-memory

amfs-memory is a cursor rule for Cursor from raia-live/amfs. It costs 2,880 tokens per session, scanned A, original, Apache-2.0.

A set of rules for using AMFS, an Agent Memory File System that stores information across coding sessions, agents, and machines. It includes rules for setting the agent's identity and using persistent memory.

In plain words
What is it for?
Use it when working with AMFS memory, including setting or checking the agent identity, saving persistent project knowledge, and following the system's memory and attribution rules.
Why use it?
It helps preserve useful project knowledge between sessions and attribute decisions to a specific agent identity. The identity step is required before other AMFS work can be performed.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Good fit Use it when working with AMFS memory, including setting or checking the agent identity, saving persistent project knowledge, and following the system's memory and attribution rules.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/raia-live/amfs/amfs-memory
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.

Clone the repo
git clone --depth 1 https://github.com/raia-live/amfs

Made for: Cursor.

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 amfs-memory

README.md
[![agentmods](https://agentmods.dev/badge/rules/raia-live/amfs/amfs-memory/github.svg)](https://agentmods.dev/rules/raia-live/amfs/amfs-memory)
Your own site
<a href="https://agentmods.dev/rules/raia-live/amfs/amfs-memory"><img src="https://agentmods.dev/badge/rules/raia-live/amfs/amfs-memory/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 amfs-memory

Your own site · 80×15
<a href="https://agentmods.dev/rules/raia-live/amfs/amfs-memory"><img src="https://agentmods.dev/badge/rules/raia-live/amfs/amfs-memory.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 2,880 This file is loaded in full into every session.
When invoked 2,880 The same file — it is already loaded in full.
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.02880 $0.02880
Opus 5.5 $0.01152 $0.01152
Sonnet 5.5 $0.00576 $0.00576
Haiku 4.5 $0.00288 $0.00288

Measured 1mo ago against content hash 0f53d2068b6a, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

amfs-memory 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.

.cursor/rules/amfs-memory.mdc · 189 lines

How it starts

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

AMFS Memory — Agent Behavioral Rules

You have access to AMFS (Agent Memory File System) through MCP tools. AMFS gives you a persistent brain — memory that survives across sessions, agents, and machines. Use it to build institutional knowledge over time.

MANDATORY FIRST STEP: Set Your Identity

You MUST call amfs_set_identity before doing anything else. Without it, all your work is attributed to a generic default and you won't appear as a distinct agent on the AMFS dashboard.

amfs_set_identity("<role-name>", "<one-line description of current task>", model="<your-model-name>")

Always pass model= with your LLM model name (e.g. "claude-4-opus", "gpt-4o", "claude-3.5-sonnet"). This is recorded in decision traces so we know which model made each decision.

Sticky identity: Once set, the identity is saved to ~/.amfs/.identity and automatically restored in future sessions — even across process restarts (e.g. Claude Desktop). You only need to call amfs_set_identity again to change roles or update the description.

Use amfs_whoami() to check the active identity. Use amfs_reset_identity() to clear it.

Naming rules:

  • Use kebab-case role/domain names that persist across conversations about the same topic.
  • Good: "dashboard-agent", "stripe-agent", "api-agent", "infra-agent", "mcp-agent"
  • Bad: "fix-button-color" (too specific — won't be reused), "agent-1" (meaningless)
  • If you're continuing work a previous agent started, use the same name to build on their knowledge.
  • The description should say what you're doing right now (e.g. "Fixing tag rollback for slashed names").

When to GET BRIEFED (start every session with context)

  • Before starting any work: Get a compiled briefing from the Memory Cortex. This gives you pre-compiled knowledge about the entities you're about to work on — what other agents know, recent risks, external events, and confidence-ranked facts. This is your most important first step.
    amfs_briefing(entity_path="<repo>/<module>")
    
  • Read the evidence sections first. The lead digest carries validated (entries every outcome confirmed — act on these), discredited (entries a failure gated, with replaced_by where known — avoid these) and regime_shift (long-validated entries that recently started failing — something changed; verify before reusing anything in the scope). Each hot_context row has an evidence_status: untested, validated, contested or discredited. compact=True returns just the lead digest with these sections.
  • The briefing also carries tried_here (actions taken on this entity and how each fared) and, under a regime shift, an explore line with the untried action assigned to you. Pass since=<iso timestamp> on a repeat call to get only what changed.
  • Then recall your own specific memories and search for details:
    amfs_recall("<repo>/<module>", "<relevant-key>")
    amfs_search(entity_path="<repo>/<service-or-module>")
    
  • Before choosing among a fixed set of actions (a tool with an enum action, a runbook with numbered fixes): retrieve with the candidates and follow the recommendation.
    amfs_retrieve(query="<the task>", entity_path="<repo>/<module>", include_priors=True,
                  candidate_actions=["resolve:resend_email", "resolve:update_payment_method"], compact=True)
    
    action_priors lists each action's won/lost here on similar tasks; recommendation.mode is act (take suggested_action), explore (everything tried here failed or a regime shift is flagged — try suggested_action first; it is assigned per agent so peers explore different actions), or escalate (every candidate has been tried and failed — escalate on the first attempt). compact=True keeps the first two hits full and the rest as one-liners; priors and recommendation are always complete.
  • Before making architectural decisions: Get a briefing first, then check specific patterns.
    amfs_briefing(entity_path="<repo>/<module>")
    amfs_search(query="<topic>", min_confidence=0.5)
    
  • When encountering errors: Check if the Cortex or another agent already has context.
    amfs_briefing(entity_path="<repo>/<module>")
    amfs_search(query="<error-keyword>")
    

Read the full file on GitHub · 189 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. 1mo ago Changed · +7 lines · +323 tokens per session 0f53d2068b6a
  2. 1mo ago Changed · +11 lines · +302 tokens per session f953b7f8b5ab
  3. 1mo ago Changed · +3 lines · +73 tokens per session cf52ab32ac51
  4. 1mo ago First seen · 168 lines · 2,182 tokens per session scan A eb0a11c59c1b

Subscribe to this mod's changes

amfs-memory is a cursor rule published in the GitHub repository raia-live/amfs (85 stars, last pushed today), licensed Apache-2.0. It adds 2,880 tokens to every session, about $0.0115 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-30.