mk:loop

mk:loop is a skill for Claude Code, Codex from ngocsangyem/MeowKit. It costs 95 tokens per session (2,422 once invoked), scanned A, original, MIT.

An automated optimization loop that makes bounded code changes to improve one measurable number, such as test coverage, bundle size, lint errors, or latency.

In plain words
What is it for?
Use it for tracked, limited iterations on a known set of files when a fast verification command produces one objective metric.
Why use it?
It provides a repeatable way to keep changes that improve the chosen metric and undo changes that make it worse.

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/ngocsangyem/meowkit/loop
Any agent
npx skills add ngocsangyem/MeowKit --skill loop
Clone the repo
git clone --depth 1 https://github.com/ngocsangyem/MeowKit

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 mk:loop

README.md
[![agentmods](https://agentmods.dev/badge/skills/ngocsangyem/meowkit/loop.svg)](https://agentmods.dev/skills/ngocsangyem/meowkit/loop)
Your own site
<a href="https://agentmods.dev/skills/ngocsangyem/meowkit/loop"><img src="https://agentmods.dev/badge/skills/ngocsangyem/meowkit/loop.svg" alt="Measured on agentmods" height="20"></a>
Per session 95 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,422 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.00095 $0.02422
Opus 5 $0.00048 $0.01211
Sonnet 5 $0.00019 $0.00484
Haiku 4.5 $0.00010 $0.00242

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

Security

Grade A, and why

mk:loop 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 yesterday.

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.

.claude/skills/loop/SKILL.md · 208 lines

How it starts

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

mk:loop — Bounded Optimization Loop

Scope + mechanical metric + fast verify = bounded, git-tracked, boundary-gated improvement.

What This Skill Does

Improves ONE scalar metric (coverage %, bundle KB, lint-error count, latency ms, …) by running bounded autonomous iterations: pick one atomic change → commit → verify → keep if the number improved, otherwise git revert. Git history is the loop's memory; a TSV log and summary are the artifacts. Autonomy is boundary-gated — one human approval before the loop, then hands-off iteration up to a hard cap, with hard re-gates on cap-reached, stuck/plateau, and scope-expansion. It never plans, never grades behavior, never ships.

When to Use

  • An objective, fast (<30s) Verify command prints a single number.
  • A Scope of editable file globs is known.
  • You want N git-tracked trials with automatic keep-on-improve, revert-on-regress.

When NOT to Use

Situation Better tool
Subjective goal ("make it cleaner", "make it nicer") mk:cook
Known root-cause bug to fix once mk:fix / mk:investigate
Grade a running build against behavior/rubric mk:evaluate
Green-field product build (generator⇄evaluator) mk:autobuild
Structural review of a diff mk:review
Open a PR / ship mk:ship
No mechanical metric exists mk:cook --interactive

Configuration

Parsed from the user message. Missing required fields trigger ONE batched AskUserQuestion — no command runs before they are supplied.

Required: Goal, Scope (globs), Metric (name + unit), Direction (higher|lower), Verify (shell command → one number). Optional: Guard, Iterations (default 10), Noise (low|medium|high, default medium), Min-Delta (default derived from Noise), Stop-At.

Full contract, the batched-question template, the Verify/Metric pattern library, and Noise/Min-Delta semantics live in references/config-and-metrics.md.

Read the full file on GitHub · 208 lines

Files

What ships with it

5 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. yesterday First seen · 208 lines · 95 tokens per session scan A b3a0a5eb1df2

Subscribe to this mod's changes

mk:loop is a skill published in the GitHub repository ngocsangyem/MeowKit (14 stars, last pushed 1mo ago), licensed MIT. It adds 95 tokens to every session and 2,422 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-09-03.

Related

Other skills, from other repositories

cf:loop

Run an explicit, bounded optimization loop against a numeric metric while a separate correctness guard protects the result.

haposoft/cafekit · 24 tokens

notion

Notion API for creating and managing pages, databases, and blocks. Use when the user wants to create a Notion page, query a Notion database, update Notion properties, search Notion, add content to Notion, manage Notion blocks, or interact with Notion data sources and workspaces via the API.

elizaOS/eliza · 69 tokens

tmux

Remote-control tmux sessions for interactive CLIs by sending keystrokes, capturing pane output, and managing terminal multiplexer windows. Enables parallel coding-agent orchestration, background process management, and REPL interaction via sockets. Use when the agent needs to launch, monitor, or coordinate…

elizaOS/eliza · 87 tokens

slack

Use when the agent needs to send, edit, delete, or read Slack messages, add or list emoji reactions, pin or unpin messages, fetch member info, or list custom emoji in Slack channels and DMs. Handles all Slack workspace interactions including message management, reaction workflows, pinned-item management, and user…

elizaOS/eliza · 73 tokens

apple-reminders

Manage Apple Reminders via the remindctl CLI on macOS (list, add, edit, complete, delete). Supports lists, date filters, and JSON/plain output. Use when the user asks about reminders, todos, tasks, to-do lists, "remind me", scheduling tasks, checking what is due today, completing or deleting reminders, or managing…

elizaOS/eliza · 84 tokens

obsidian

Work with Obsidian vaults (plain Markdown notes) and automate via obsidian-cli. Use when the user asks about notes, vault management, PKM, knowledge base organization, wikilinks, or personal knowledge management in Obsidian.

elizaOS/eliza · 53 tokens