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.
git clone --depth 1 https://github.com/ShaheerKhawaja/ProductionOSWrote 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.
[](https://agentmods.dev/commands/shaheerkhawaja/productionos/autoloop)<a href="https://agentmods.dev/commands/shaheerkhawaja/productionos/autoloop"><img src="https://agentmods.dev/badge/commands/shaheerkhawaja/productionos/autoloop/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.
<a href="https://agentmods.dev/commands/shaheerkhawaja/productionos/autoloop"><img src="https://agentmods.dev/badge/commands/shaheerkhawaja/productionos/autoloop.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00036 | $0.01102 |
| Opus 5 | $0.00018 | $0.00551 |
| Sonnet 5 | $0.00007 | $0.00220 |
| Haiku 4.5 | $0.00004 | $0.00110 |
Grade A, and why
autoloop 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 8d 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.
How it starts
The opening of the file, as written. The whole thing — 118 lines — stays where its author put it; the contents beside it link to each section on GitHub.
/autoloop — Autonomous Recursive Improvement
Step 0: Preamble
Before executing, run the shared ProductionOS preamble (templates/PREAMBLE.md).
You are running the /autoloop command. This is an autonomous recursive improvement loop that takes a target and iteratively improves it until convergence.
Input
The user provides:
- Target: A file path, directory, or description of what to improve
- Goal: What "good" looks like (optional -- defaults to "maximize quality score")
Execution Protocol
Step 1: Understand the Target
- If target is a file path: Read it and assess current state
- If target is a directory: Scan for key files and assess overall quality
- If target is a description: Identify what needs to be created or improved
Step 2: Gap Analysis
- Score current state using the ProductionOS rubric and convergence heuristics already present in this repo
- Scan
~/repos/for reference implementations (per CLAUDE.md Auto-Enrichment Protocol) - Check
~/.productionos/recursive/reference-corpus/for similar high-quality outputs - Identify specific gaps between current state and goal
Step 3: Initialize Recursion
- Create session state at
~/.productionos/recursive/recursion-state.json:{ "session_id": "<generated>", "target": "<target>", "goal": "<goal>", "layer": "L17", "current_iteration": 0, "max_iterations": 10, "best_iteration": 0, "best_score": 0.0, "scores": [], "convergence_verdict": "CONTINUE", "status": "running" } - Select the appropriate layer:
- Complex decomposable task -> L16 RecDecomp
- Quality improvement (default) -> L17 SelfRefine
- Context too large -> L18 RecSumm
- Security/factual claims -> L19 RecVerify
- Plan execution -> L20 PEER
Step 4: Iteration Loop (max 10)
For each iteration:
- Score: Run confidence scorer on current output
- Record: Add score to convergence monitor
- Check Convergence: Run all 5 algorithms from
convergence.py:- Score delta tracking (stalled if < 0.1 for 2+ iterations)
- Spectral contraction (converged if cosine > 0.95)
- Diminishing returns (stalled if DR ratio < 0.15)
- Oscillation detection (oscillating if sign changes > 60%)
- EMA velocity (plateau if |EMA delta| < 0.05)
- If STOP: Return best iteration output
- If CONTINUE: Apply refinement via the selected layer
- Quality Gate: Check for monotonic improvement and stop if the loop regresses materially
- Log: Write metrics to
~/.productionos/recursive/metrics/
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.
- 8d ago First seen · 118 lines · 36 tokens per session scan A 903c3853be02
autoloop is a command published in the GitHub repository ShaheerKhawaja/ProductionOS (8 stars, last pushed 4mo ago), licensed MIT. It adds 36 tokens to every session and 1,102 once invoked, about $0.0002 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.
Other commands, from other repositories
settings
View or edit fellowship configuration (/.claude/fellowship.json). Run /settings to see current settings, change values, or reset to defaults.
guide
Interactive guide to fellowship. Walks you through a real task using the structured research-plan-implement flow, then shows you what's next.
rekindle
Recover a fellowship after a session crash. Scans worktrees and quest state, presents a recovery dashboard, and re-spawns Gandalf with recovered quest context. Use when returning to a crashed or expired fellowship session.
validate-docs
Validate that site and README documentation is current. Report-only — flags issues without modifying anything.
chronicle
One-time codebase onboarding — interactively extracts your team's conventions, identifies reference files, and generates CLAUDE.md sections so Claude codes the way your team does. Run once per project.
scribe
Create a reusable quest template for a specific type of task (e.g., "API endpoint", "migration"). Encodes project-specific rules and conventions into phase guidance that loads automatically during quests.