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 U4CSolutions/MidMem --skill midmem-recordgit clone --depth 1 https://github.com/U4CSolutions/MidMemWrote 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/u4csolutions/midmem/midmem-record)<a href="https://agentmods.dev/skills/u4csolutions/midmem/midmem-record"><img src="https://agentmods.dev/badge/skills/u4csolutions/midmem/midmem-record/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/u4csolutions/midmem/midmem-record"><img src="https://agentmods.dev/badge/skills/u4csolutions/midmem/midmem-record.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.00105 | $0.00846 |
| Opus 5.5 | $0.00042 | $0.00338 |
| Sonnet 5.5 | $0.00021 | $0.00169 |
| Haiku 4.5 | $0.00011 | $0.00085 |
Grade A, and why
midmem-record 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 3mo 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 — 51 lines — stays where its author put it; the contents beside it link to each section on GitHub.
MidMem Record — durable lessons + commit, done right
The point: durable knowledge must land in state.db, not just the chat transcript, so it survives
context compaction and is recallable by every agent on the shared store.
Steps
- Lesson → midmem (the load-bearing step). Store each lesson atomically:
midmem remember "<the lesson, one sentence>" --tier wisdom --curated --scope shared- ⚠️ Escaping gotcha: the text must not contain backticks,
$(...), or unescaped<> |— the shell runs them as substitution and mangles/blanks the entry. Plain prose, no backticks; replace code refs with words ("call query with a token budget", not the backticked form). One per lesson.
- ⚠️ Escaping gotcha: the text must not contain backticks,
- Changelog (if your project keeps one). Add under today's dated
## YYYY-MM-DDsection (newest at top), grouped: Added · Changed · Fixed · Reverted · Removed · Failed Attempts · Lessons (omit empty groups). Be specific with values/paths ("rrfK 60→45", not "tuned retrieval").- ⚠️ One dated section per day, one of each group per day — append to today's existing groups;
don't create a second
## <date>or a second### Lessons.grep -nE '^## |^### ' CHANGELOG.mdshould show no duplicate date/group headers for one day.
- ⚠️ One dated section per day, one of each group per day — append to today's existing groups;
don't create a second
- Vault projection.
midmem projectrefreshes the LLM Wiki (or let lifecycle maintenance auto-project); only force if you need it visible immediately. Never hand-edit the projection — it is regenerated fromstate.db. - Commit. Stage the changed files (+ changelog if touched). End the message with the active
model's
Co-Authored-By:line. Verify the staged diff carries no secrets —state.db,*.pem,.env, and service-account JSON should be gitignored; check before committing.
Harness-guaranteed recording (the reliable pattern)
Instruction-following alone loses records — a session ends, the lesson evaporates. Make it
deterministic: wire a Claude Code Stop hook (via .claude/settings.json) that blocks a turn
from ending while a recordable change is unrecorded, clearing when midmem remember / midmem ingest runs. A companion PostToolUse hook flags the session "dirty" when a mutating command runs.
This turns "please remember to record" into a gate the session cannot skip. Make it fail open on
error and yield after a few blocks so it never wedges a session. (This is the model behind an
operator's host record skill; this repo copy keeps the portable pattern without the host-specific
changelog/vault plumbing.)
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.
- 3mo ago First seen · 51 lines · 105 tokens per session scan A b04f069938e7
midmem-record is a skill published in the GitHub repository U4CSolutions/MidMem (2 stars, last pushed 4d ago), licensed Apache-2.0. It adds 105 tokens to every session and 846 once invoked, about $0.0004 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-31.
midmem-record compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| midmem-recordU4CSolutions/MidMem | Skill | 2 | 4d ago | Apache-2.0 | A | 105 | Claude Code |
| memory-informed-longitudinal-workmajor7apps/pensyve | Skill | 101 | 2d ago | Apache-2.0 | A | 52 | Claude Code |
| mention-workflowmajor7apps/pensyve | Skill | 101 | 2d ago | Apache-2.0 | A | 45 | Claude Code, Codex |
| remnic-memory-workflowjoshuaswarren/remnic | Skill | 245 | today | MIT | A | 55 | Claude Code |
| remnic-rememberjoshuaswarren/remnic | Skill | 245 | today | MIT | A | 39 | Claude Code |
| remnic-searchjoshuaswarren/remnic | Skill | 245 | today | MIT | A | 36 | Claude Code |
| remnic-recalljoshuaswarren/remnic | Skill | 245 | today | MIT | A | 35 | Claude Code |