midmem-dev

midmem-dev is a skill for Claude Code, Codex from U4CSolutions/MidMem. It costs 136 tokens per session (1,554 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 (878/878 as of 2026-10-19).

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,554 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.01554
Opus 5.5 $0.00054 $0.00622
Sonnet 5.5 $0.00027 $0.00311
Haiku 4.5 $0.00014 $0.00155

Measured 2d ago against content hash 35fc6cc800c8, 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 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-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. 2d ago Changed 35fc6cc800c8
  2. 8d ago Changed 5c42cd021710
  3. 13d ago Changed fb94fe84d565
  4. 14d ago Changed 12b50161fcb6
  5. 26d ago Changed 25ac04b33807
  6. 27d ago Changed d4a4a37b9a4c
  7. 1mo ago Changed c066321bc6ec
  8. 1mo ago Changed 9d7666a18972
  9. 1mo ago First seen · 88 lines · 136 tokens per session scan A 66e10ce02b61

Subscribe to this mod's changes

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

Other skills, from other repositories

pinecone-research

Agent RAG and long-term memory with Pinecone.

NousResearch/hermes-agent · 16 tokens

browserwing-admin

Manage and operate BrowserWing — an intelligent browser automation platform. Install dependencies, configure LLM, create/manage/execute automation scripts, use AI-driven exploration to generate scripts, browse the script marketplace, and troubleshoot issues.

MemTensor/MemOS · 47 tokens

karpathy-llm-wiki

Use when building or maintaining a personal LLM-powered knowledge base. Triggers: ingesting sources into a wiki, querying wiki knowledge, linting wiki quality, 'add to wiki', 'what do I know about', or any mention of 'LLM wiki' or 'Karpathy wiki'.

Astro-Han/karpathy-llm-wiki · 67 tokens

local-embedding

Run embedding on-device with ONNX Runtime. Build from source, model selection, offline mode. Use when setting up local embedding without an API key.

matrixorigin/memoria · 34 tokens

dify

Use when building LLM applications with visual workflow — RAG knowledge bases, AI agents, chatbots with drag-and-drop orchestration. Dify: open-source LLM app platform supporting 30+ models (OpenAI, Claude, DeepSeek, Ollama, Qwen, GLM) with Docker deployment.

znlgis/opengis-skills · 66 tokens

ai-skills

Use when building LLM applications, RAG knowledge bases, AI agents, terminal coding agents, multi-model orchestration, plugin-based agent harnesses, or file translation. Index of 14 skills: Dify, LangChain, LlamaIndex, Ollama, Transformers, Hermes Agent, OpenClaw, OpenCode, Pi, DocuTranslate, DeepSeek Harness and more.

znlgis/opengis-skills · 81 tokens