optimization-loop

The control loop for a ladder-foundry pretraining process that creates labeled research-design examples. It runs repeated batches, evaluates results, attributes failures to model weights, and resumes from saved files.

In plain words
What is it for?
Use it to start runs, generate batch configurations, execute the nested epoch and batch loop, delegate evaluation, trace failed batches to a weight, and continue from saved weights.
Why use it?
It provides a defined way to run training batches, apply evaluation gates, investigate failed batches, and recover after an interruption or context loss. Disk files are treated as the source of truth.

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/yogsoth-ai/de-anthropocentric-research-engine/optimization-loop
Any agent
npx skills add yogsoth-ai/de-anthropocentric-research-engine --skill optimization-loop
Clone the repo
git clone --depth 1 https://github.com/yogsoth-ai/de-anthropocentric-research-engine

Made for: Claude Code, Codex.

Per session 65 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,343 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.00065 $0.02343
Opus 5 $0.00032 $0.01171
Sonnet 5 $0.00013 $0.00469
Haiku 4.5 $0.00006 $0.00234

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

Security

Grade A, and why

optimization-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 1 executable file (scripts/run_codex_loss.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.

ladder-foundry/skills/optimization-loop/SKILL.md · 167 lines

How it starts

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

optimization-loop

You are the optimizer. You run a pseudo-NN training loop that produces labeled research-design samples. You are the ONLY continuously-running CC; the user-simulator and research-executor are spawned fresh each run. Disk is the only source of truth — your memory is not.

§loop — the two-level nested batch loop

LOOP-2 (epochs/batches, runs to convergence) wraps LOOP-1 (one batch = 48 runs = 8 topics × 6 rungs).

Epoch start (once):

  1. python ../../scripts/new_run_id.py --runs-root runs → capture run_id. Emit trace run_start.

Batch start (each batch): 2. batch_id = the highest batch-N in runs/<run_id>/weights/ (cold start = batch-0; do NOT pre-increment). Emit batch_start. 3. Generate configs from the current weights: call ../../generator/gen_configs.py main(out_dir, w) (it is main(out_dir, w), NOT an argparse CLI — invoke via a one-line python -c that imports it and passes the loaded weights/<batch_id>.json). M1 note: gen_configs names configs config_{rung}.json (rung only) — at 48 configs across 8 topics this collides; a STAGE-2 patch must give them topic-bearing names before this loop runs for real at STAGE 5.

Per run (8 topics × 6 rungs = 48): 4. Spawn the user-simulator CC (see §tools). Inject its research_config. 5. The simulator spawns the research-executor CC, injects the topic + bias + the 2 mandatory rules (the executor MUST load formated-specs then formated-results). 6. Simulator ↔ executor talk for the card's turn budget. Emit dialogue_turn per exchange. 7. python ../../scripts/save_transcript.py --logs-dir <REQUIRED> --cwd <exec-cwd> --sample <sample> --out runs/<run_id>/transcripts/<sample>.md. --logs-dir is REQUIRED, no default (privacy red line). 8. python ../../scripts/concat_triple.py --run-dir runs/<run_id> --sample <sample>. 9. python scripts/run_codex_loss.py loss1 --transcript … --config … --skill-md ../injection-fidelity/SKILL.md --out runs/<run_id>/loss/<sample>.loss1.json. Emit rung_done.

Read the full file on GitHub · 167 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 · 167 lines · 65 tokens per session scan A a5f39bd077dc

Subscribe to this mod's changes

optimization-loop is a skill published in the GitHub repository yogsoth-ai/de-anthropocentric-research-engine (405 stars, last pushed 6d ago), licensed Apache-2.0. It adds 65 tokens to every session and 2,343 once invoked, about $0.0003 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-30.

Related

Other skills, from other repositories

Deep Research

Produce a deep, structured research report on a topic: decompose into key dimensions, analyze each with evidence and reasoning, synthesize cross-cutting insights, and surface open questions. Use for deep research, analysis, and literature/landscape reviews.

AgentEra/Agently · 53 tokens

omnisci

Run OmniScientist end to end in the OmniScientist CLI using DeepSeek V4 Flash. Turn raw research data (images, signals, audio, video, 3-D, tables, or graphs) and an open direction into perceived evidence, a falsifiable hypothesis, recorded analysis, real citations, a gated candidate paper, PDF, and Overleaf bundle.…

Omni-Scientist/OmniScientist · 145 tokens

literature-reviewer-skill

根据用户提供的论文主题,进行系统性中英文文献回顾(Literature Survey)。 采用8阶段工作流,支持CNKI、Web of Science、ScienceDirect等主流数据库, 无需API配置,通过浏览器自动化获取文献信息。 输出包含GB/T 7714-2015引文、标题、摘要的Markdown文档。 当用户提到"文献回顾"、"文献综述"、"帮我找文献"、"中英文文献搜索"、"写综述"等关键词时触发。 NOTE: The 'examples/' folder contains sample outputs and is not included in skill installation.

stephenlzc/AI-Powered-Literature-Review-Skills · 147 tokens

academic-research-suite

ARS-Codex workflows for research, academic writing, manuscript review, research-to-paper pipelines, and experiment planning. Use when the user asks for deep research, literature review, systematic review, meta-analysis, research question refinement, academic paper drafting, paper revision, citation or integrity…

Imbad0202/academic-research-skills-codex · 242 tokens

paper-fetch

Add academic papers to Zotero via MCP (DOI/PMID/title); fetch full-text PDFs through a publisher-aware route ladder (Unpaywall → Elsevier/Wiley/Springer TDM → institutional proxy → SFX); PDFs land in a linked-files folder (ZotMoov), never uploaded to Zotero cloud. Also verifies that a downloaded PDF really is that…

drpwchen/paper-fetch · 146 tokens

lit-review-assistant

Search, summarize, and synthesize economics literature.

brycewang-stanford/Auto-Empirical-Research-Skills · 14 tokens