pi-autoresearch-loop

pi-autoresearch-loop is a skill for Claude Code, Codex from twaldin/flt. It costs 0 tokens per session (2,628 once invoked), scanned A, original, MIT.

An automated experiment loop for the pi coding agent. It repeatedly proposes a change, measures a chosen result, keeps improvements, and discards changes that perform worse.

In plain words
What is it for?
Use it to improve measurable targets such as test speed, bundle size, build time, training loss, or Lighthouse scores.
Why use it?
It reduces the need to run and compare optimization experiments by hand when success can be measured.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to improve measurable targets such as test speed, bundle size, build time, training loss, or Lighthouse scores.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/twaldin/flt/pi-autoresearch-loop
View source ↗ twaldin/flt
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 twaldin/flt --skill pi-autoresearch-loop
Clone the repo
git clone --depth 1 https://github.com/twaldin/flt

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 pi-autoresearch-loop

README.md
[![agentmods](https://agentmods.dev/badge/skills/twaldin/flt/pi-autoresearch-loop.svg)](https://agentmods.dev/skills/twaldin/flt/pi-autoresearch-loop)
Your own site
<a href="https://agentmods.dev/skills/twaldin/flt/pi-autoresearch-loop"><img src="https://agentmods.dev/badge/skills/twaldin/flt/pi-autoresearch-loop.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,628 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.00000 $0.02628
Opus 5 $0.00000 $0.01314
Sonnet 5 $0.00000 $0.00526
Haiku 4.5 $0.00000 $0.00263

Measured 7d ago against content hash 9adcd8680c4b, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

pi-autoresearch-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 7d 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.

templates/skills/pi-autoresearch-loop/SKILL.md · 398 lines

How it starts

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

---
name: pi-autoresearch-loop
cli-support: [all]
description: Autonomous experiment loop for pi that continuously tries optimizations, measures results, and keeps what works
triggers:
  - autoresearch
  - autonomous experiment loop
  - optimize automatically
  - run experiment loop
  - continuous optimization
  - benchmark and improve
  - start autoresearch session
  - keep what works discard what doesnt
---

# pi-autoresearch — Autonomous Experiment Loop

> Skill by [ara.so](https://ara.so) — Daily 2026 Skills collection

Autonomous experiment loop extension for [pi](https://github.com/antiwork/pi). Continuously proposes changes, benchmarks them, commits wins, reverts losses, and repeats — forever. Works for any measurable target: test speed, bundle size, build time, LLM training loss, Lighthouse scores.

---

## Installation

```bash
pi install https://github.com/davebcn87/pi-autoresearch

Manual install:

cp -r extensions/pi-autoresearch ~/.pi/agent/extensions/
cp -r skills/autoresearch-create ~/.pi/agent/skills/

Then /reload in pi.


Quick Start

/skill:autoresearch-create

The agent will:

  1. Ask about your goal, command, metric, and files in scope (or infer from context)
  2. Create a branch
  3. Write autoresearch.md and autoresearch.sh
  4. Run the baseline
  5. Start looping immediately — no further input needed

Core Concepts

Two-file persistence model

Every session is fully recoverable from two files:

File Purpose
autoresearch.jsonl Append-only log — one JSON line per run (metric, status, commit, description)
autoresearch.md Living document — objective, what's been tried, dead ends, key wins

A fresh agent with zero memory can read these two files and continue exactly where the previous session left off.

Session files written by the skill

File Purpose
autoresearch.md Session document — objective, metrics, files in scope, experiment history
autoresearch.sh Benchmark script — pre-checks, runs the workload, outputs METRIC name=number lines
autoresearch.checks.sh (optional) Backpressure checks — tests, types, lint. Failures block keep

Extension Tools

init_experiment

One-time session configuration. Call once at session start.

await init_experiment({
  name: "vitest-speed",
  metric: "seconds",
  unit: "s",
  direction: "lower", // "lower" | "higher"
});

run_experiment

Runs any shell command, times wall-clock duration, captures stdout/stderr.

const result = await run_experiment({
  command: "pnpm test --run",
  timeout_seconds: 120,           // optional, default 300
  checks_timeout_seconds: 300,    // optional, for checks script
});
// result: { exit_code, duration_seconds, stdout, stderr }

log_experiment

Records result, auto-commits on keep, updates the status widget and dashboard.

await log_experiment({
  metric_value: 42.3,
  status: "keep",          // "keep" | "discard" | "crash" | "checks_failed"
  description: "Enable parallel test workers in vitest config",
  commit_message: "perf: parallel vitest workers → 42.3s (-18%)",
});

The Autonomous Loop

Once started, the agent runs this cycle indefinitely:

propose change → edit files → run_experiment → measure metric
       ↓
  metric improved?
    YES → log_experiment(keep) → auto-commit → update autoresearch.md
    NO  → log_experiment(discard) → git revert → try next idea
       ↓
  repeat forever (until interrupted)

Interrupt anytime with Escape, then ask for a summary of what was tried.


Benchmark Script Format

autoresearch.sh must output at least one METRIC line:

#!/bin/bash
set -euo pipefail

# Pre-checks
[ -f package.json ] || { echo "No package.json"; exit 1; }

Read the full file on GitHub · 398 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. 7d ago First seen · 398 lines · 0 tokens per session scan A 9adcd8680c4b

Subscribe to this mod's changes

pi-autoresearch-loop is a skill published in the GitHub repository twaldin/flt (5 stars, last pushed 1mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 2,628 tokens. 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

Science

The scientific method as a universal problem-solving algorithm — goal-first, plural falsifiable hypotheses, designed experiments, and honest measurement, scaling from TDD to feature validation to MVP launch. USE WHEN think about, figure out, experiment, iterate, optimize, hypothesis, science, full cycle, quick…

DorShaer/Husk · 85 tokens

ArXiv

Search and retrieve arXiv academic papers by topic, category, or paper ID — with AlphaXiv-enriched AI-generated overviews. Uses arXiv Atom API across cs.AI/cs.LG/cs.CL/cs.CR/cs.MA/cs.SE/cs.IR. Three workflows: Latest, Search, Paper. USE WHEN arxiv, papers, latest papers, research papers, recent ML papers, paper…

DorShaer/Husk · 132 tokens

adaptyv

Cloud laboratory platform for automated protein testing and validation. Use when designing proteins and needing experimental validation including binding assays, expression testing, thermostability measurements, enzyme activity assays, or protein sequence optimization. Also use for submitting experiments via API…

agent-skills-hub/agent-skills-hub · 95 tokens

harness-init-runner

Initialize a lightweight repo-local Node.js harness (harness/ + .harness/) WITHOUT AIOS dependency. Use ONLY when you need a standalone, portable harness. If AIOS is installed, use aios-long-running-harness instead — it has rex Command hosting, ContextDB integration, and checkpoint recovery.

rexleimo/aios · 70 tokens

claude-ally-health

A health assistant skill for medical information analysis, symptom tracking, and wellness guidance.

agent-skills-hub/agent-skills-hub · 22 tokens

openevidence

Query OpenEvidence (clinical evidence assistant) without an MCP server. Closely mirrors the openevidence-mcp tool surface - check auth, list question history, fetch an article, or ask a new question (with optional follow-up thread). Use when the user asks medical / evidence-based clinical questions, references…

htlin222/openevidence-mcp · 111 tokens