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 AdamBien/airails --skill memory-persistencegit clone --depth 1 https://github.com/AdamBien/airailsWrote 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/adambien/airails/memory-persistence)<a href="https://agentmods.dev/skills/adambien/airails/memory-persistence"><img src="https://agentmods.dev/badge/skills/adambien/airails/memory-persistence/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/adambien/airails/memory-persistence"><img src="https://agentmods.dev/badge/skills/adambien/airails/memory-persistence.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.00124 | $0.01579 |
| Opus 5.5 | $0.00050 | $0.00632 |
| Sonnet 5.5 | $0.00025 | $0.00316 |
| Haiku 4.5 | $0.00012 | $0.00158 |
Grade A, and why
memory-persistence 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 3d 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 — 109 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Add in-memory persistence using $ARGUMENTS. Apply all rules below strictly; /bce, /java-conventions, and the stack skill hold wherever this skill is silent.
Principle
The store is a collection of immutable records. No entity lifecycle, no identity map, no change tracking: a write replaces a record, a read returns the record, a query is a stream.
- records only — the stored value is the entity record itself, never a mutable copy or a wrapper
- the control is the sole holder of state; no other class references the collection
- the control's public contract is identical to the
/jdbc-persistencecontrol for the same BC:savereturns the record with its id,findByIdreturnsOptional,alland queries returnList; a BC migrates by swapping the control class and adding@Transactional(or the project's@Boundarystereotype) to the boundary - state lives for the process lifetime and is lost on restart; say so in the BC's
package-info.java, not in the code
Placement (BCE)
entity— the records and sealed interfaces, unchanged from/jdbc-persistencecontrol— classes named after their responsibilities (Customers,OrderReports), never*Repository,*Store,*InMemory*; the storage technology does not appear in the name because the boundary must not know it; a control may hold more than one map when it owns more than one record typeboundary— injects or receives the control; no collection, no stream over stored data
Control
- storage:
Map<Long, Order> orders = new ConcurrentHashMap<>();keyed by id; aSetorListonly when the record has no identity and is never updated - ids:
AtomicLong sequence = new AtomicLong();—saveassignssequence.incrementAndGet()when the id is0, returnsorder.withId(id), and stores the returned record - update:
orders.replace(order.id(), order); a missing id is aNoSuchElementExceptionfrom the control, never a silent insert - delete:
orders.remove(id)returning whether something was removed - queries are pure streams over
orders.values():.filter(...),.sorted(...),.toList(); every predicate and comparator is a named method, never an inline lambda (/java-conventions) allreturnsList.copyOf(orders.values()); no caller sees the live collection or anIteratorover it- constraints the schema would enforce are enforced here explicitly: a uniqueness rule is a
putIfAbsentor a pre-check that throws the stack's integrity exception from the/jdbc-persistencecontract, naming the rule —ClientErrorException(rule, Response.Status.CONFLICT)on/microprofile-server,IllegalArgumentExceptionin a/java-cli-app - concurrency: rely on
ConcurrentHashMapatomics (compute,putIfAbsent,replace); nosynchronized, noCollections.synchronizedMap, no locks - no eviction, no size cap, no TTL unless the spec asks; then prefer the rule in the control over a caching library
/microprofile-server: the control is an@ApplicationScopedCDI bean; the collection is an instance field, so one store per application/java-cli-app: the control is a class instantiated once in the entry point and handed to the boundaries; never a mutablestaticfield (/java-conventions)
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.
- 3d ago Changed · +124 tokens per session a1a05bddceed
- 5d ago Changed · -192 tokens per session 456205870f66
- 7d ago First seen · 109 lines · 192 tokens per session scan A 1c3b81d2c7a2
memory-persistence is a skill published in the GitHub repository AdamBien/airails (62 stars, last pushed yesterday), licensed MIT. It adds 124 tokens to every session and 1,579 once invoked, about $0.0005 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-10-31.
memory-persistence compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| memory-persistenceAdamBien/airails | Skill | 62 | yesterday | MIT | A | 124 | Claude Code |
| jpa-patternsaffaan-m/ECC | Skill | 298k | 4d ago | MIT | A | 33 | Claude Code, Kiro |
| azure-data-tables-javamicrosoft/skills | Skill | 3.2k | yesterday | MIT | A | 47 | Claude Code |
| azure-cosmos-javamicrosoft/skills | Skill | 3.2k | yesterday | MIT | A | 59 | Claude Code |
| authoring-java-sdk-tasksastronomer/agents | Skill | 458 | 4d ago | Apache-2.0 | A | 152 | Claude Code |
| configuring-airflow-language-sdksastronomer/agents | Skill | 458 | 4d ago | Apache-2.0 | A | 155 | Claude Code |
| database-orm-expertroedyrustam/vibes-plug | Skill | 121 | yesterday | MIT | A | 40 | Cursor |