midmem-pattern-capture

midmem-pattern-capture is a skill for Claude Code, Codex from U4CSolutions/MidMem. It costs 70 tokens per session (472 once invoked), scanned A, original, Apache-2.0.

A system for saving proven coding patterns, reusable project scaffolding, failed approaches, and recipes in MidMem, a shared memory store.

In plain words
What is it for?
Use it after a build or quality check to record patterns, scaffolds, anti-patterns, or recipes, linked to a repository, commit, or task.
Why use it?
It preserves useful lessons with evidence so teams can repeat successful approaches and avoid documented dead ends.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it after a build or quality check to record patterns, scaffolds, anti-patterns, or recipes, linked to a repository, commit, or task.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/u4csolutions/midmem/midmem-pattern-capture
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.

Any agent
npx skills add U4CSolutions/MidMem --skill midmem-pattern-capture
Clone the repo
git clone --depth 1 https://github.com/U4CSolutions/MidMem

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-pattern-capture

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/u4csolutions/midmem/midmem-pattern-capture"><img src="https://agentmods.dev/badge/skills/u4csolutions/midmem/midmem-pattern-capture.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 70 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 472 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.00070 $0.00472
Opus 5.5 $0.00028 $0.00189
Sonnet 5.5 $0.00014 $0.00094
Haiku 4.5 $0.00007 $0.00047

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

Security

Grade A, and why

midmem-pattern-capture 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.

skills/midmem-pattern-capture/SKILL.md · 37 lines

What it actually says

Pattern capture — record what builds prove

Capture packs make MidMem domain-extensible as data: a pack registers entry types (with a persistence tier + memory function + graph edge), categorizer rules and an edge vocabulary. The shipped coding-patterns pack covers: pattern, scaffold, anti-pattern, recipe (all procedural-function, memory-tier).

When to capture

  • At the moment of proof, not from memory: a card/QA gate just passed using an approach worth reusing → record it NOW with its evidence link (commit hash, repo, card id).
  • A debugging approach failed for a reproducible reason → anti-pattern with the failure as evidence. Dead ends prevent repeats; that is their entire value.
  • The same scaffold got copied into a second project → scaffold, evidence both repos.

How

midmem pattern --type pattern --title "<short name>" \
  --context "<where this applies>" --problem "<what it solves>" \
  --solution "<the approach>" --evidence "<repo@hash;card-id>" [--scope shared]

(MCP: record_pattern; list registered types with midmem packs.)

Rules

  • Evidence is required in spirit: a pattern without a commit/repo/run reference is an opinion. Link the proof.
  • Never hand-promote. Patterns start at memory tier; retrieval renewals during later builds are what earn wisdom. A "best practice" nobody re-uses should decay.
  • Anti-patterns are captures, not shame: record the failure mode plainly; the dead-end demotion in retrieval surfaces them as warnings automatically.
  • New domains = new pack JSON (entry types + rules + edges), registered via MIDMEM_CAPTURE_PACKS — never a core code change. Packs cannot redefine core types.
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. 3mo ago First seen · 37 lines · 70 tokens per session scan A fdf7022d30f3

Subscribe to this mod's changes

midmem-pattern-capture is a skill published in the GitHub repository U4CSolutions/MidMem (2 stars, last pushed 4d ago), licensed Apache-2.0. It adds 70 tokens to every session and 472 once invoked, about $0.0003 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-pattern-capture compared with skills from other repositories

midmem-pattern-capture next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
midmem-pattern-captureU4CSolutions/MidMemSkill24d agoApache-2.0A70Claude Code, Codex
memory-informed-longitudinal-workmajor7apps/pensyveSkill1012d agoApache-2.0A52Claude Code
mention-workflowmajor7apps/pensyveSkill1012d agoApache-2.0A45Claude Code, Codex
remnic-memory-workflowjoshuaswarren/remnicSkill245todayMITA55Claude Code
remnic-rememberjoshuaswarren/remnicSkill245todayMITA39Claude Code
remnic-searchjoshuaswarren/remnicSkill245todayMITA36Claude Code
remnic-recalljoshuaswarren/remnicSkill245todayMITA35Claude Code