loopx-self-repair

loopx-self-repair is a skill for Claude Code, Codex from huangruiteng/loopx. It costs 102 tokens per session (1,831 once invoked), scanned A, original, Apache-2.0.

A troubleshooting and repair process for LoopX, a system that coordinates tasks and agents, when its control state or agent behavior drifts from the intended plan.

In plain words
What is it for?
Use it to collect LoopX diagnostics, classify the failure against known repair patterns, and apply a lasting fix.
Why use it?
It helps explain unexpectedly small progress, stale instructions, skipped blocked work, unclear ownership, or missing task status before more work is attempted.

Skill for Claude CodeCodex

About the project

LoopX is a provider-neutral control plane that gives long-running AI-agent work persistent state, decisions, governance, recovery, and handoffs across different agent harnesses. It is for managing and reviewing durable work performed by Codex, Claude Code, Cursor, dsh, or custom agent systems.

huangruiteng/loopx · 5,609 stars · on GitHub

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/huangruiteng/loopx/loopx-self-repair
Any agent
npx skills add huangruiteng/loopx --skill loopx-self-repair
Clone the repo
git clone --depth 1 https://github.com/huangruiteng/loopx

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 loopx-self-repair

README.md
[![agentmods](https://agentmods.dev/badge/skills/huangruiteng/loopx/loopx-self-repair.svg)](https://agentmods.dev/skills/huangruiteng/loopx/loopx-self-repair)
Your own site
<a href="https://agentmods.dev/skills/huangruiteng/loopx/loopx-self-repair"><img src="https://agentmods.dev/badge/skills/huangruiteng/loopx/loopx-self-repair.svg" alt="Measured on agentmods" height="20"></a>
Per session 102 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,831 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.00102 $0.01831
Opus 5 $0.00051 $0.00915
Sonnet 5 $0.00020 $0.00366
Haiku 4.5 $0.00010 $0.00183

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

Security

Grade A, and why

loopx-self-repair 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 5d 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.

skills/loopx-self-repair/SKILL.md · 158 lines

How it starts

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

LoopX Self Repair

Use this skill to turn a surprising LoopX behavior into a durable fix, not only an apology or a one-off explanation.

Repair Loop

  1. Pause delivery selection. Do not spend quota or continue adapter work until the control-plane facts explain why that work is valid.

  2. Build a compact evidence packet. Prefer structured surfaces:

    git status --short --branch
    loopx --format json diagnose --goal-id <goal-id>
    loopx --format json status --goal-id <goal-id> --limit 20
    loopx --format json quota should-run --goal-id <goal-id> [--agent-id <agent-id>]
    loopx --format json history --goal-id <goal-id> --limit 5
    

    status defaults to the registry/dashboard view, but accepts --goal-id when the repair needs one goal-focused projection. Use diagnose --goal-id for the richer goal-specific agent reasoning packet. Also inspect the project-local registry and the registry-declared active state file when relevant. Use the shared global registry for heartbeat/quota truth.

  3. Classify the failure. Read references/repair-patterns.md and match the symptoms to a known pattern. If no pattern fits, add one after the fix.

  4. Assign the responsible layer. Separate:

    • agent behavior mistake;
    • state projection or quota payload bug;
    • active-state authoring gap;
    • benchmark harness mismatch;
    • docs/process hygiene gap.
  5. Repair at the lowest durable layer.

    • If it is a one-off agent mistake, write back the correct state/todo and continue with a larger bounded batch.
    • If the machine projection misled the agent, fix CLI/status/quota projection and add a focused smoke.
    • If the user correction changes the goal acceptance, says the agent missed the intended loop, or exposes a product bottleneck that is not visible in quota/status, write a bounded goal_vision_replan_contract_v0 packet with replan_trigger_summary through normal loopx refresh-state --vision-* fields, using the same --agent-id as the current lane, or --agent-vision-json for generated multi-field patches, before returning to delivery. If the next executable step is already known, also add or link the concrete successor todo; do not leave the correction only in chat or an incident note.
    • If a design rule is missing, update the interaction model or todo list before implementing broad behavior.
    • If benchmark evidence is not attributable, add posthoc trace/parity checks before claiming uplift or regression.
  6. Validate before resuming. Run the smallest smoke or CLI check that would have caught the issue, plus loopx check on changed public surfaces when docs/contracts changed.

  7. Write back the lesson. Update active goal state, docs, contributor tasks, or this skill so the same failure mode is visible next time.

Read the full file on GitHub · 158 lines

Files

What ships with it

3 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. 5d ago First seen · 158 lines · 102 tokens per session scan A 57c1f7f03695

Subscribe to this mod's changes

loopx-self-repair is a skill published in the GitHub repository huangruiteng/loopx (5,609 stars, last pushed today), licensed Apache-2.0. It adds 102 tokens to every session and 1,831 once invoked, about $0.0005 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

Autonomous multi-step deep research engine implementing an iterative Think → Search → Extract → Synthesize → Stop loop. The LLM drives every decision: what to search, what's relevant, what's missing, and when to stop. Produces a cited, magazine-quality report with inline citations, category- specific formatting, and…

moonlight-lupin/agent-skills · 147 tokens

image-studio

Generate, edit and upscale AI images via fal.ai through a three-stage studio workflow — brainstorm a strong prompt with the user, prototype cheaply and iterate on feedback, then produce a finalised image. Use when the user wants image generation or editing through the local fal.ai helper workflow, including requests…

moonlight-lupin/agent-skills · 214 tokens

skill-maintainer

Track upstream drift and sync adapted skill libraries.

moonlight-lupin/agent-skills · 12 tokens

website-scraping

Generic playbook for extracting structured data from any website — hotel prices, flight fares, e-commerce listings, real estate, jobs, competitor product catalogues, anything where the goal is to turn one or more URLs into clean records on disk. Use this skill whenever the user mentions scraping, harvesting…

moonlight-lupin/agent-skills · 210 tokens

library-rag

Semantic search over a personal library using Nemotron-3-Embed-1B embeddings + sqlite-vec. Index books, documents, any text corpus; query by meaning. Includes EPUB→Markdown conversion and MCP server for auto-available search tools.

moonlight-lupin/agent-skills · 54 tokens

news-monitoring

Recurring topic/news monitoring with web search, multi-language sources, digest formatting, and automated delivery via Hermes cron jobs. Covers search strategy, source selection, Chinese-language platforms, and digest templates.

moonlight-lupin/agent-skills · 42 tokens