os-lab-loop

os-lab-loop is a skill for Claude Code from richfrem/agent-plugins-skills. It costs 233 tokens per session (1,364 once invoked), scanned A, original, MIT.

An improvement loop for an agent skill or agent, using a ledger, evaluation results, references, and known unfinished work to guide each change. It sends every change to a separate scorer and records the session when finished.

In plain words
What is it for?
Use it to run repeated, evidence-based improvements to a skill or agent while tracking accepted and rejected changes and updating the project record.
Why use it?
It provides a controlled alternative to making many unmeasured edits. One change is tested at a time, with limits and a strategy review after repeated failures.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Part of the agent-agentic-os plugin — 14 skills, 2 agents, 3 hooks shipped together

Good fit Use it to run repeated, evidence-based improvements to a skill or agent while tracking accepted and rejected changes and updating the project record.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/richfrem/agent-plugins-skills/os-lab-loop
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 richfrem/agent-plugins-skills --skill os-lab-loop
Clone the repo
git clone --depth 1 https://github.com/richfrem/agent-plugins-skills

Made for: Claude Code.

Or install agent-agentic-os, the plugin that ships this one along with the rest of its 14 skills, 2 agents, 3 hooks.

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 os-lab-loop

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/richfrem/agent-plugins-skills/os-lab-loop"><img src="https://agentmods.dev/badge/skills/richfrem/agent-plugins-skills/os-lab-loop.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 233 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,364 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.00233 $0.01364
Opus 5.5 $0.00093 $0.00546
Sonnet 5.5 $0.00047 $0.00273
Haiku 4.5 $0.00023 $0.00136

Measured yesterday against content hash 9fb28618295a, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

os-lab-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.

The scan reads SKILL.md. This mod also ships 3 executable files (scripts/generate_report.py, scripts/kernel.py, scripts/post_run_metrics.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

plugins/agent-agentic-os/skills/os-lab-loop/SKILL.md · 81 lines

How it starts

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

Lab Loop (os-lab-loop)

The single loop that improves a target skill or agent in the lab. It owns orientation, mutation and close. It never scores: each change goes to os-lab-scorer.

Contents

Critical constraints

  1. Every change is scored: call os-lab-scorer for each mutation; no manual rollback and no self-assessed KEEP.
  2. Locked evaluator: only the target SKILL.md (and, as a second-order move, the proposer prompt or references/program.md) is mutated; never evaluate.py or evals/evals.json.
  3. One variable per iteration, and a documented hypothesis before the first mutation.
  4. Session close is mandatory: surveys, ledger, metrics, registry and memory run even when the target score is not reached.
  5. Budget guard: 10 iterations per session, 3 consecutive DISCARDs trigger a strategy review (see lab-limits).
  6. Do not skip orientation: no agent starts cold.

Quick start

From a lab prepared by os-lab-setup, with a baseline already recorded in <path/to/target-skill>/evals/results.tsv:

Run the improvement loop on <path/to/target-skill> for 5 iterations.

Each iteration: classify the failure, propose one change, invoke os-lab-scorer on <path/to/target-skill>, act on KEEP or DISCARD. If no baseline exists, have os-lab-scorer record it first.

Workflow

  1. Orient (Stage 0): read context/memory/improvement-ledger.md, the target's evals/results.tsv, references/program.md, the test registry, context/memory.md, recent surveys, the last 100 lines of context/events.jsonl, and open map debt (Repeat: YES first). Write the hypothesis and register the cycle. See stage-0-orientation.md.
  2. Mutate (Stage 1): classify the failure, propose one change, log friction events as they occur. See mutation-protocol.md and stage-1-execution.md.
  3. Score (Stage 2): invoke os-lab-scorer. With a PEER_AGENT, the peer scores independently from its own session. See stage-2-verification.md.
  4. Decide (Stage 3): KEEP is applied and committed; DISCARD writes a correction packet and re-signals the inner agent. See stage-3-decision.md.
  5. Repeat from step 2 until the cap, the target score or the budget guard.
  6. Close (Stage 4): friction gate, surveys, post-run metrics, session log, loop report, test registry, improvement ledger, then os-lab-memory for L3 promotion, auto-memory, Triple-Loop trigger check and lock release. See stage-4-close.md.

Read the full file on GitHub · 81 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. yesterday First seen · 81 lines · 233 tokens per session scan A 9fb28618295a

Subscribe to this mod's changes

os-lab-loop is a skill published in the GitHub repository richfrem/agent-plugins-skills (7 stars, last pushed 2d ago), licensed MIT. It adds 233 tokens to every session and 1,364 once invoked, about $0.0009 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-10-16.