goal-loop

goal-loop is a skill for Claude Code, Codex from JairoTorregrosa/jaiskills. It costs 27 tokens per session (3,253 once invoked), scanned A, original, MIT.

A guided loop for improving software work through repeated implementation, testing, diagnosis, and revision. It uses separate agents for building, checking, finding causes of failure, and judging the result.

In plain words
What is it for?
Use it for tasks that need iterative code changes, visible validation, failure diagnosis, recurring-error tracking, and separate held-out checks.
Why use it?
It provides a repeatable way to continue after a failed check instead of stopping at the first attempt. Independent checks help assess whether the goal was actually met.

Skill for Claude CodeCodex

Written for Claude Code and Codex: disable-model-invocation in frontmatter, but also agents/openai.yaml present. Also seen: mentions subagents; names the AskUserQuestion tool; mentions Codex.

Part of the jaiskills plugin — 12 skills, 4 agents, 2 hooks shipped together

Good fit Use it for tasks that need iterative code changes, visible validation, failure diagnosis, recurring-error tracking, and separate held-out checks.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/jairotorregrosa/jaiskills/goal-loop
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 JairoTorregrosa/jaiskills --skill goal-loop
Clone the repo
git clone --depth 1 https://github.com/JairoTorregrosa/jaiskills

Made for: Claude Code, Codex.

Or install jaiskills, the plugin that ships this one along with the rest of its 12 skills, 4 agents, 2 hooks.

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/jairotorregrosa/jaiskills/goal-loop/github.svg)](https://agentmods.dev/skills/jairotorregrosa/jaiskills/goal-loop)
Your own site
<a href="https://agentmods.dev/skills/jairotorregrosa/jaiskills/goal-loop"><img src="https://agentmods.dev/badge/skills/jairotorregrosa/jaiskills/goal-loop/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.

agentmods 80×15 button for goal-loop

Your own site · 80×15
<a href="https://agentmods.dev/skills/jairotorregrosa/jaiskills/goal-loop"><img src="https://agentmods.dev/badge/skills/jairotorregrosa/jaiskills/goal-loop.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 27 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,253 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.00027 $0.03253
Opus 5.5 $0.00011 $0.01301
Sonnet 5.5 $0.00005 $0.00651
Haiku 4.5 $0.00003 $0.00325

Measured 1mo ago against content hash 3117464e2d32, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

goal-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 1mo 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/orchestration/goal-loop/SKILL.md · 172 lines

How it starts

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

Goal Loop: Gradient Descent for Goals, Built by an Agent Factory

Objective and flags: $ARGUMENTS

Empty objective → ask for one. Parse the flags (table at the end) before Phase 0.

Formal contract (invariants, phase pre/postconditions, conformance checks): references/spec.md. Read it before Phase 0 of a first run and whenever a phase rule is unclear. Worked example, end to end: references/example-cv-os.md. Read it when the goal is frontend or judgment-heavy.

Treat the goal as a training problem. The working tree is the parameter, evidence commands are the loss function, a fresh implementer is the forward pass, a diagnoser produces textual gradients (the backward pass), momentum accumulates recurring error patterns, and an independent judge validates against held-out checks the implementer never sees. An agent factory generates all of these agents specialized to the goal, consulting an archive of past loops.

Deep-Learning Mapping

Deep learning This loop Where it lives
Parameter θ Working tree + artifacts the repo
Forward pass Fresh implementer attempt agents/implementer.md
Training loss Visible validation evidence loop.md § Evidence (visible)
Held-out test set Hidden compositional checks heldout.md (judge-only)
Gradient ∂L/∂θ Textual diagnosis: which behavior caused the failure, what to change diagnoser output
Momentum Recurring-pattern memory across epochs loop.md § Momentum
Learning rate Edit scope per epoch (shrinks on plateau) contract field
Epoch One full loop iteration descent log
Early stopping No loss improvement for patience epochs decide step
Train/test leak Showing held-out checks to the implementer forbidden

Directory Layout

loops/
  archive.md            # cross-goal archive: agent designs + instruments that worked (stepping stones)
  <slug>/
    loop.md             # goal contract + descent log — the implementer sees this
    heldout.md          # held-out evidence — NEVER included in any implementer prompt
    agents/             # factory-generated, goal-specialized agent prompts
      implementer.md
      verifier.md
      diagnoser.md
      judge.md
    tools/              # factory-generated instruments (probes, harnesses, generators)

Read the full file on GitHub · 172 lines

Files

What ships with it

7 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. 1mo ago Changed · +7 lines · -191 tokens per session 3117464e2d32
  2. 1mo ago First seen · 165 lines · 218 tokens per session scan A 788cbc9fc805

Subscribe to this mod's changes

goal-loop is a skill published in the GitHub repository JairoTorregrosa/jaiskills (10 stars, last pushed 3d ago), licensed MIT. It adds 27 tokens to every session and 3,253 once invoked, about $0.0001 per session on Opus 5.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

eliza

Skill "eliza" from aomi-labs/skills, covering elizaos, what you probably got wrong, installation, cli (recommended for new projects) and from source (contributor workflow).

aomi-labs/skills · 51 tokens

swarmclaw

AI agent runtime and multi-agent orchestration platform. Teaches agents how to use SwarmClaw's 6 primitive tools, persistent memory, dreaming, delegation, connectors, credentials, and the skill system. Use when an agent is running on SwarmClaw and needs to understand the platform's capabilities.

swarmclawai/swarmclaw · 67 tokens

update-harness

Update an existing Claude Code harness — check for outdated components, duplication with official features, missing patterns, and improvement opportunities, then apply approved changes. Use whenever: 'update harness', 'update my harness', 'is my harness up to date', 'harness outdated', 'optimize harness', 'check my…

bzantium/meta-harness · 112 tokens

create-harness

Generate a complete, project-specific Claude Code harness — agents, skills, hooks, CLAUDE.md rules — tailored to any codebase. Use whenever someone says 'create a harness', 'set up agents for this project', 'configure Claude Code', 'build an agent team', 'make this project AI-ready', 'harness this project', or any…

bzantium/meta-harness · 117 tokens

help

Get oriented with the solopreneur plugin — see your AI team, check project status, and get suggestions for what to do next. Use when you're getting started or need a refresher.

pcatattacks/solopreneur-plugin · 41 tokens

review

Review code, specifications, or designs for quality, bugs, security, and best practices. Use when the user wants feedback on recent work, a pull request, or any artifact.

pcatattacks/solopreneur-plugin · 38 tokens