midmem-dev

midmem-dev is a skill for Claude Code, Codex from U4CSolutions/MidMem. It costs 136 tokens per session (1,556 once invoked), scanned A, original, Apache-2.0.

A development guide for MidMem, a shared knowledge layer for language models that stores and retrieves project information. It covers the core packages and their command-line, MCP, and hook interfaces.

In plain words
What is it for?
It is for adding or changing retrieval, lifecycle tiers, work-memory events, concept routing, claims, grounding, integrations, and tests in MidMem.
Why use it?
It helps contributors change the knowledge system without breaking its storage model, deterministic behavior, grounding checks, or support for different host environments.

Skill for Claude CodeCodex

Which agent this was written for is unclear — built for openclaw. Also seen: mentions Claude Code; built for openclaw.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is node packages/core/test/smoke.mjs # MUST stay green (1003/1003 as of 2026-11-09).

Good fit It is for adding or changing retrieval, lifecycle tiers, work-memory events, concept routing, claims, grounding, integrations, and tests in MidMem.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/U4CSolutions/MidMem
agentmods
npx agentmods add skills/u4csolutions/midmem/midmem-dev

Made for: Claude Code, Codex.

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 midmem-dev

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/u4csolutions/midmem/midmem-dev"><img src="https://agentmods.dev/badge/skills/u4csolutions/midmem/midmem-dev.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 136 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,556 The whole file, excluding the scripts and references it only reads on demand.
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.00136 $0.01556
Opus 5.5 $0.00054 $0.00622
Sonnet 5.5 $0.00027 $0.00311
Haiku 4.5 $0.00014 $0.00156

Measured 25d ago against content hash b59487f2d2cf, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

midmem-dev 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 25d 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-dev/SKILL.md · 88 lines

How it starts

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

MidMem development loop

Repo: this checkout (own git). Node ESM, node:sqlite, zero external deps. Core: packages/core/. Paths below are repo-relative; <repo> = the midmem-kb-store checkout root.

The architecture you must preserve

  • Pure-core. Everything lives in packages/core/src over one state.db, reached via exactly three surfaces: CLI bin/cli.mjs, MCP bin/mcp-server.mjs, hook seam bin/hook.mjs. No file in the core may reference OpenClaw, Hermes, Claude Code, or any host stack. This is what makes it run in 4 modes (standalone · OpenClaw add-on · Hermes add-on · bridge); see docs/INTEGRATION-MODES.md.
  • state.db = source of truth; the Obsidian LLM Wiki = deterministic projection (regenerable; never canonical, never hand-edited).
  • Determinism + grounding. Categorization, work-events, community detection, contradiction detection are deterministic (no LLM). Ingest runs the DELEGATE-52 grounding check before persisting. Never bypass grounding; never use LLM self-review for grounding/promotion.

Map of the core (where things go)

  • orchestrator.mjs — the coordinator; every public op + governance + #maybeMaintain. Add new public methods here.
  • db.mjs — schema (entries, vectors, nodes, edges, claims, sources, log, audit). Prefer using entries.type + provenance over new tables/columns.
  • memory.mjs tiers/lifecycle · retrieval.mjs hybrid lanes + post-RRF boosts · graph.mjs nodes/edges (extend EDGE_TYPES for new relations) · claims.mjs · workmemory.mjs work events + categorization · concepts.mjs concept embeddings + communities · grounding.mjs · config.mjs (env-tunable knobs) · index.mjs (public exports).

Adding a capability — the checklist

  1. Core logic in the right module (or a new src/<feature>.mjs); keep it deterministic where it can be. Read the module first and match its idiom/comment density.
  2. Wire an Orchestrator method → export in index.mjs → expose via MCP tool (bin/mcp-server.mjs) and CLI command (bin/cli.mjs). Add a config block (env-tunable) in config.mjs if it has knobs.
  3. Boosts go post-RRF in retrieval.mjs, small (≈ trust/graph magnitude, ~0.004–0.01), additive.
  4. Anything that ingests inside maintain() must be re-entrancy-guarded (this._maintaining) — the bridge→ingest→#maybeMaintain→maintain path recurses infinitely on a low intervalMs; the throttle alone is not safe. Heavy work (embedding) runs on forced/daily maintain only.
  5. Test it. Add assertions to packages/core/test/smoke.mjs (offline, hermetic — pass autoIngest:{enabled:false} to test orchestrators so maintain() doesn't bridge real dirs).

Read the full file on GitHub · 88 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. 25d ago Changed b59487f2d2cf
  2. 1mo ago Changed 46c1172d43ab
  3. 1mo ago Changed 35fc6cc800c8
  4. 1mo ago Changed 5c42cd021710
  5. 1mo ago Changed fb94fe84d565
  6. 1mo ago Changed 12b50161fcb6
  7. 2mo ago Changed 25ac04b33807
  8. 2mo ago Changed d4a4a37b9a4c
  9. 2mo ago Changed c066321bc6ec
  10. 2mo ago First seen · 88 lines · 136 tokens per session scan A 9d7666a18972

Subscribe to this mod's changes

midmem-dev is a skill published in the GitHub repository U4CSolutions/MidMem (2 stars, last pushed 4d ago), licensed Apache-2.0. It adds 136 tokens to every session and 1,556 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-08-31.

Related

midmem-dev compared with skills from other repositories

midmem-dev next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
midmem-devU4CSolutions/MidMemSkill24d agoApache-2.0A136Claude Code, Codex
browserwing-adminMemTensor/MemOSSkill13ktodayApache-2.0B47Claude Code, Codex
context-window-engineerroedyrustam/vibes-plugSkill132yesterdayMITA38Cursor
local-embeddingmatrixorigin/memoriaSkill6319d agoApache-2.0B34Claude Code, Codex
karpathy-llm-wikiAstro-Han/karpathy-llm-wikiSkill2.9k4mo agoMITA67Claude Code, Codex
memory-lancedbaaronnat23/disp8chSkill824d agoMITA0Claude Code, Codex
adapter-authoringKromatic-Innovation/athenaeumSkill13todayApache-2.0A86Claude Code, Codex