midmem-record

A procedure for saving a change, decision, or lesson into MidMem as durable shared knowledge, with an optional changelog update. Durable knowledge remains available after the current conversation ends.

In plain words
What is it for?
Use it after capability or configuration changes, or when asked to record a lesson, decision, or checkpoint. It stores a concise wisdom entry, makes a clean commit, and can update the day's changelog.
Why use it?
It prevents important lessons from being lost in chat and records them in a form that other agents can recall.

Skill for Claude CodeCodex

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 skills/u4csolutions/midmem/midmem-record
Any agent
npx skills add U4CSolutions/MidMem --skill midmem-record
Clone the repo
git clone --depth 1 https://github.com/U4CSolutions/MidMem

Made for: Claude Code, Codex.

Per session 105 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 846 The whole file, excluding the scripts and references it only reads on demand.
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.00105 $0.00846
Opus 5 $0.00053 $0.00423
Sonnet 5 $0.00021 $0.00169
Haiku 4.5 $0.00011 $0.00085

Measured 2d ago against content hash b04f069938e7, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

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 2d 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.

skills/midmem-record/SKILL.md · 51 lines

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

  1. 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.
  2. Changelog (if your project keeps one). Add under today's dated ## YYYY-MM-DD section (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.md should show no duplicate date/group headers for one day.
  3. Vault projection. midmem project refreshes 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 from state.db.
  4. 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 secretsstate.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.)

Read the full file on GitHub · 51 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. 2d ago First seen · 51 lines · 105 tokens per session scan A b04f069938e7

Subscribe to this mod's changes

midmem-record is a skill published in the GitHub repository U4CSolutions/MidMem (2 stars, last pushed 8d ago), licensed Apache-2.0. It adds 105 tokens to every session and 846 once invoked, about $0.0005 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-08-31.

Related

Other skills, from other repositories

potpie-source-ingestion

Use when the user explicitly asks to ingest, refresh, or deeply understand a repository, PR, issue, ticket, runbook, incident report, document, or web link into Potpie. The harness performs todo-driven discovery, uses local/GitHub/integration tools and read-only subagents when available, builds evidence-backed…

potpie-ai/potpie · 82 tokens

potpie-repo-baseline

Use when establishing, refreshing, or deeply understanding a repository's baseline memory in Potpie: purpose, application type, features, services/modules, environments, deploy shape, dependencies, API contracts, datastores, integrations, ownership, and explicit preferences. The harness reads authored and…

potpie-ai/potpie · 75 tokens

graph-mutation-plan

Cookbook for composing an applygraphmutations plan — stable entitykey patterns, the canonical label/edge vocabulary, evidence/invalidation/confidence discipline, and a worked example. Load this when building a non-trivial mutation plan.

potpie-ai/potpie · 51 tokens

obsidian-layout-adjustment

Workflow for working with the user on changing how Obsidian looks using CSS snippets. Use this whenever the user asks to restyle Obsidian, tune a vault's visual layout, adjust tabs, sidebars, note surfaces, properties, backlinks, graph panes, file explorer rows, icons, links, shadows, active states, or CSS snippets.…

Ar9av/obsidian-wiki · 115 tokens

alfworld-locate-target-object

Navigates to a suspected location and identifies a target object. Use when your goal requires finding a specific object (e.g., "potato", "plate") and its location is not immediately known. Moves to a relevant receptacle (like a fridge or cabinet), checks its contents, and outputs the object's location or confirms its…

zjunlp/SkillNet · 74 tokens

scienceworld-growth-focuser

Use when you have planted a seed or need to track a plant's growth stage (sprouting, flowering, reproduction). Applies the 'focus on' action to a specific plant or biological entity to signal intent and monitor its development. Trigger after planting or when you need to observe life cycle progression in the…

zjunlp/SkillNet · 71 tokens