tune-loop

tune-loop is a skill for Claude Code, Codex from rchaz/tunelab. It costs 151 tokens per session (1,731 once invoked), scanned A, original, MIT.

A system for repeatedly testing and improving a deployed AI model, agent, or workflow using logged results and user feedback. It compares a current “champion” with new “challenger” versions and promotes changes only when evaluations show they are better.

In plain words
What is it for?
Use it to build an improvement cycle: serve predictions, record outcomes, curate evaluation data, test alternative designs, and promote proven versions.
Why use it?
It replaces guesswork about model updates with a repeatable process for collecting feedback, running experiments, and checking whether a change actually helps.

Skill for Claude CodeCodex

Part of the tunelab plugin — 5 skills shipped together

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

Made for: Claude Code, Codex.

Or install tunelab, the plugin that ships this one along with the rest of its 5 skills.

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 tune-loop

README.md
[![agentmods](https://agentmods.dev/badge/skills/rchaz/tunelab/tune-loop.svg)](https://agentmods.dev/skills/rchaz/tunelab/tune-loop)
Your own site
<a href="https://agentmods.dev/skills/rchaz/tunelab/tune-loop"><img src="https://agentmods.dev/badge/skills/rchaz/tunelab/tune-loop.svg" alt="Measured on agentmods" height="20"></a>
Per session 151 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,731 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.00151 $0.01731
Opus 5 $0.00076 $0.00865
Sonnet 5 $0.00030 $0.00346
Haiku 4.5 $0.00015 $0.00173

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

Security

Grade A, and why

tune-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 4d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/promote.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.

skills/tune-loop/SKILL.md · 113 lines

How it starts

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

tune-loop — the self-improving system

The other four skills build one model. tune-loop closes the loop: serve → log → collect feedback → curate → experiment across architectures × methods → promote only what measurably beats the champion → repeat. The "AI system" stops being a model and becomes the loop; what sits inside (a single model, a cascade, an agent, a deterministic workflow) is just the current champion, which the loop is free to replace when evidence says so.

This is champion/challenger from classical MLOps, generalized to compound-AI architecture search, driven by a Monitor–Analyze–Plan–Execute (MAPE) control loop. It deliberately reverses tunelab's v1 "no autonomous hill-climbing" non-goal — and the disciplines below are what make the reversal teaching-grade rather than AutoML slop.

Step 0 — read the system state before anything

On invocation, read the project's system/ dir:

  • descriptor.json — the current champion architecture (see schema below).
  • predictions.jsonl — the append-only flywheel log (tune-data's flywheel.py schema).
  • EXPERIMENT-LOG.md + rounds/*/ — prior rounds, promotions, and the eval slices each consumed. Never reuse a consumed slice.

The system descriptor (architectures as data)

A small versioned JSON makes architectures enumerable, comparable, reproducible:

{ "version": 3, "kind": "cascade",
  "components": [
    {"id": "t1", "model": "lr", "train": "embeddings+logreg", "calibrate": "isotonic"},
    {"id": "t2", "model": "qwen3-4b", "train": "qlora-sft", "conf": "token-margin"},
    {"id": "t3", "model": "frontier", "prompt": "knn-fewshot"}],
  "routing": "t1 ->[cal_conf<0.43] t2 ->[cal_conf<0.60] t3",
  "thresholds": {"t1": 0.43, "t2": 0.60} }

kind ∈ {single, cascade, workflow}. Examples: single: FT-SLM(qwen3-4b, sft) · workflow: injection-gate → router → {cheap, frontier}. The descriptor is the unit the loop mutates and the eval adjudicates.

The MAPE round (the crank)

Read the full file on GitHub · 113 lines

Files

What ships with it

1 file 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. 4d ago First seen · 113 lines · 151 tokens per session scan A 4b5ae69c4805

Subscribe to this mod's changes

tune-loop is a skill published in the GitHub repository rchaz/tunelab (6 stars, last pushed 1mo ago), licensed MIT. It adds 151 tokens to every session and 1,731 once invoked, about $0.0008 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-08-31.

Related

Other skills, from other repositories

implementing-llms-litgpt

Implements and trains LLMs using Lightning AI's LitGPT with 20+ pretrained architectures (Llama, Gemma, Phi, Qwen, Mistral). Use when need clean model implementations, educational understanding of architectures, or production fine-tuning with LoRA/QLoRA. Single-file implementations, no abstraction layers.

Orchestra-Research/AI-Research-SKILLs · 77 tokens

peft-fine-tuning

Parameter-efficient fine-tuning for LLMs using LoRA, QLoRA, and 25+ methods. Use when fine-tuning large models (7B-70B) with limited GPU memory, when you need to train <1% of parameters with minimal accuracy loss, or for multi-adapter serving. HuggingFace's official library integrated with transformers ecosystem.

Orchestra-Research/AI-Research-SKILLs · 82 tokens

axolotl

Expert guidance for fine-tuning LLMs with Axolotl - YAML configs, 100+ models, LoRA/QLoRA, DPO/KTO/ORPO/GRPO, multimodal support.

Orchestra-Research/AI-Research-SKILLs · 47 tokens

llama-factory

Expert guidance for fine-tuning LLMs with LLaMA-Factory - WebUI no-code, 100+ models, 2/3/4/5/6/8-bit QLoRA, multimodal support.

Orchestra-Research/AI-Research-SKILLs · 51 tokens

unsloth

Expert guidance for fast fine-tuning with Unsloth - 2-5x faster training, 50-80% less memory, LoRA/QLoRA optimization.

Orchestra-Research/AI-Research-SKILLs · 39 tokens

data-validation-first

Use this skill before any data analysis, transformation, or modeling. Always inspect and validate the data before drawing conclusions or writing transformations.

aiming-lab/MetaClaw · 30 tokens