ml-retain

ml-retain is a command for Claude Code from jpavley/meta-loop-ios. It costs 14 tokens per session (1,553 once invoked), scanned A, original, MIT.

A command for recording useful lessons from a completed coding session in project documentation. It reviews changes, decisions, workarounds, and gaps in existing guidance.

In plain words
What is it for?
Use it after a successful implementation pass to capture patterns, decisions, newly found rules, and documentation improvements.
Why use it?
It helps prevent the same discoveries and mistakes from being lost after the work is finished. The provided information does not specify the exact documentation files it updates.

Command for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: mentions CLAUDE.md; mentions Claude Code.

Part of the meta-loop-ios plugin — 4 skills, 5 commands shipped together

Good fit Use it after a successful implementation pass to capture patterns, decisions, newly found rules, and documentation improvements.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/jpavley/meta-loop-ios/ml-retain
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.

Clone the repo
git clone --depth 1 https://github.com/jpavley/meta-loop-ios

Made for: Claude Code.

Or install meta-loop-ios, the plugin that ships this one along with the rest of its 4 skills, 5 commands.

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 ml-retain

README.md
[![agentmods](https://agentmods.dev/badge/commands/jpavley/meta-loop-ios/ml-retain/github.svg)](https://agentmods.dev/commands/jpavley/meta-loop-ios/ml-retain)
Your own site
<a href="https://agentmods.dev/commands/jpavley/meta-loop-ios/ml-retain"><img src="https://agentmods.dev/badge/commands/jpavley/meta-loop-ios/ml-retain/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 ml-retain

Your own site · 80×15
<a href="https://agentmods.dev/commands/jpavley/meta-loop-ios/ml-retain"><img src="https://agentmods.dev/badge/commands/jpavley/meta-loop-ios/ml-retain.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 14 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,553 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.00014 $0.01553
Opus 5.5 $0.00006 $0.00621
Sonnet 5.5 $0.00003 $0.00311
Haiku 4.5 $0.00001 $0.00155

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

Security

Grade A, and why

ml-retain 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 2mo 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.

commands/ml-retain.md · 270 lines

How it starts

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

Meta-Loop: Learning Retention

Capture session learnings in documentation before clearing context.

Modes: Plan Mode → Agent Mode

Prerequisites

This skill implements Step 4 of the Meta-Loop process defined in skills/meta-loop-methodology/SKILL.md.

Use this after a successful implementation pass (/ml-impl review passed).


Phase 1: Plan (Plan Mode)

Enter plan mode and create a plan for documentation updates.

1.1 Review Session Changes

Analyze what happened in this session:

  1. Check git status and diff:

    • What files were created?
    • What files were modified?
    • What's the scope of changes?
  2. Read the feature's notes.md (if this session followed the Meta-Loop):

    • Located in the spec directory (e.g., specs/views/{name}/notes.md)
    • Contains decisions from wireframe, spec, and implementation phases
    • Review for learnings that should be promoted to CLAUDE.md or doc/
  3. Identify learnings:

    • What patterns emerged?
    • What decisions were made?
    • What documentation gaps were discovered?
    • What issues required workarounds?
  4. Check current documentation state:

    • Read TODO.md for task tracking
    • Read CLAUDE.md for current context
    • Note any outdated information

1.2 Create Documentation Plan

Plan updates to these files:

TODO.md Updates:

  • Tasks completed this session
  • New tasks discovered
  • Phase/milestone status changes

CLAUDE.md Updates (keep concise!):

  • New patterns that should be quick-reference
  • Updated file references if structure changed
  • Removed outdated content
  • ⚠️ Keep under 40k characters total

New doc/ Files (if detailed knowledge needed):

  • Complex patterns that need explanation
  • Architectural decisions with rationale
  • Anti-patterns with examples
  • Guides that would bloat CLAUDE.md

1.3 Present Plan to Developer

## Learning Retention Plan

### Session Summary
[1-2 sentence summary of what was accomplished]

### TODO.md Updates
**Move to Completed:**
- [ ] [Task that was completed]

**Add to Next Up:**
- [ ] [New task discovered]

**Milestone Update:**
- [Any phase/milestone status change]

### CLAUDE.md Updates
**Add:**
- [New section or entry]

**Update:**
- [Section to modify]

**Remove:**
- [Outdated content to delete]

### New Documentation Files
| File | Purpose |
|------|---------|
| `doc/[name].md` | [What it documents] |

### Git Commit
**Suggested message:**
> [Descriptive commit message]

Ready to proceed?

Read the full file on GitHub · 270 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. 2mo ago First seen · 270 lines · 14 tokens per session scan A 1bba8b7fa8b5

Subscribe to this mod's changes

ml-retain is a command published in the GitHub repository jpavley/meta-loop-ios (3 stars, last pushed 8mo ago), licensed MIT. It adds 14 tokens to every session and 1,553 once invoked, about $0.0001 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

ml-retain compared with commands from other repositories

ml-retain next to 6 commands from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
ml-retainjpavley/meta-loop-iosCommand38mo agoMITA14Claude Code
run-testsKasempiternal/axiom-v2Command48mo agoMITA21Claude Code
dendanilods/matilha-skillsCommand26mo agoMITA12Claude Code
auditKasempiternal/axiom-v2Command48mo agoMITA11Claude Code
profileKasempiternal/axiom-v2Command48mo agoMITA19Claude Code
test-simulatorKasempiternal/axiom-v2Command48mo agoMITA14Claude Code
fix-buildKasempiternal/axiom-v2Command48mo agoMITA19Claude Code