agent-loops

agent-loops is a skill for Claude Code, Codex from NickCrew/Claude-Cortex. It costs 125 tokens per session (12,931 once invoked), scanned B, original, MIT.

Complete operational workflow for implementer agents (Codex, Gemini, etc.) making code changes and writing tests. Drives all work through atomic commits — each loop operates on the smallest complete, reviewable change. Defines the Code Change Loop, Test Writing Loop, Lint Gate, and Issue Filing process with circuit…

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/nickcrew/claude-cortex/agent-loops
Any agent
npx skills add NickCrew/Claude-Cortex --skill agent-loops
Clone the repo
git clone --depth 1 https://github.com/NickCrew/Claude-Cortex

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 agent-loops

README.md
[![agentmods](https://agentmods.dev/badge/skills/nickcrew/claude-cortex/agent-loops.svg)](https://agentmods.dev/skills/nickcrew/claude-cortex/agent-loops)
Your own site
<a href="https://agentmods.dev/skills/nickcrew/claude-cortex/agent-loops"><img src="https://agentmods.dev/badge/skills/nickcrew/claude-cortex/agent-loops.svg" alt="Measured on agentmods" height="20"></a>
Per session 125 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 12,931 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. Scan, not verified.
Origin unknown 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.00125 $0.12931
Opus 5 $0.00063 $0.06466
Sonnet 5 $0.00025 $0.02586
Haiku 4.5 $0.00013 $0.01293

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

Security

Grade B, and why

agent-loops scanned grade B with 1 finding 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 today.

The scan reads SKILL.md. This mod also ships 5 executable files (scripts/diff-test-audit.sh, scripts/review-provider.sh, scripts/specialist-review.sh, …), 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.

Enumerates other installed skillsmediumAgent snooping

Other skills' SKILL.md files reveal prompts, capabilities and secrets that should be invisible to peers.

SKILL_DIR="$(ls -d ~/.codex/skills/agent-loops 2>/dev/null || ls -d .codex/skills/agent-loops 2>/dev/null)"
skills/agent-loops/SKILL.md · 1,179 lines

How it starts

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

Agent Workflow Loops

This skill defines the operational loops that implementer agents follow when making code changes and writing tests. Each loop has explicit entry criteria, exit criteria, and escalation rules. If you are an agent, follow these loops exactly.

You do not review your own work. All reviews are performed by an independent reviewer. Prefer Claude via the bundled scripts. If Claude is unavailable, use a different model before asking your own model family to review. Same-model shell-outs are the last resort. You never grade your own homework.

Bundled references:

  • references/testing-standards.md — Test quality standards (how to write tests)
  • references/audit-workflow.md — Test gap discovery (how to find what's missing)
  • references/perspective-catalog.md — Review perspective selection (used by primary and fallback code review)
  • references/review-prompt.md — Code review prompt template for fallback reviewers
  • references/audit-prompt.md — Test audit prompt template for module-scope (full-contract) audits
  • references/diff-audit-prompt.md — Test audit prompt template for diff-scope (per-commit) audits; used by diff-test-audit.sh when --git is active

Bundled scripts:

  • $SKILL_DIR/scripts/specialist-review.sh — Provider-aware Claude/Gemini/Codex CLI path for code review
  • $SKILL_DIR/scripts/diff-test-audit.sh — Provider-aware Claude/Gemini/Codex CLI path for test audit

Locate Scripts

The bundled scripts live inside the installed skill directory, not the project tree. Before invoking any script, resolve SKILL_DIR so paths work regardless of install scope:

SKILL_DIR="$(ls -d ~/.codex/skills/agent-loops 2>/dev/null || ls -d .codex/skills/agent-loops 2>/dev/null)"

All script invocations below use "$SKILL_DIR/scripts/...". Run the snippet above once at the start of your session and reuse the variable.


Architecture: Who Does What

Role Agent How
Implementer Codex or Gemini Writes code changes and test code
Code Reviewer Claude preferred; non-self scripted fallback next; same-model provider last; fresh-context Codex final fallback specialist-review keeps same-model shell-outs last; fallback reviewer uses bundled prompts and produces a review artifact
Test Auditor Claude preferred; non-self scripted fallback next; same-model provider last; fresh-context Codex final fallback diff-test-audit keeps same-model shell-outs last; fallback auditor uses bundled prompts and produces an audit artifact
Remediator Codex or Gemini Fixes findings from the independent review/audit artifact

Read the full file on GitHub · 1,179 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. today First seen · 1,179 lines · 125 tokens per session scan B 6bc047f1af7b

Subscribe to this mod's changes

agent-loops is a skill published in the GitHub repository NickCrew/Claude-Cortex (37 stars, last pushed 2mo ago), licensed MIT. It adds 125 tokens to every session and 12,931 once invoked, about $0.0006 per session on Opus 5. A static security scan graded it B with 1 finding (enumerates other installed skills). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories