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.

A workflow for coding agents that make small code changes, write tests, run checks, and record each complete change as a commit.

In plain words
What is it for?
Use it to guide code-change loops, test-writing loops, lint checks, test-gap audits, reviews, and issue filing.
Why use it?
It gives implementation work clear checkpoints and review boundaries, while requiring independent review instead of self-review.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions CLAUDE.md; mentions subagents; positional $N argument.

Good fit Use it to guide code-change loops, test-writing loops, lint checks, test-gap audits, reviews, and issue filing.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/nickcrew/claude-cortex/agent-loops
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 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/github.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/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 agent-loops

Your own site · 80×15
<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="Reviewed on agentmods" width="80" 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. 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.00125 $0.12931
Opus 5.5 $0.00050 $0.05172
Sonnet 5.5 $0.00025 $0.02586
Haiku 4.5 $0.00013 $0.01293

Measured 1mo ago against content hash 6bc047f1af7b, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 1mo ago.

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. 1mo ago 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 (56 stars, last pushed 3mo ago), licensed MIT. It adds 125 tokens to every session and 12,931 once invoked, about $0.0005 per session on Opus 5.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

qa

Browser-based QA verification. Launches a real browser, navigates the app, clicks buttons, fills forms, and tests user flows. Works as a standalone skill or as a phase end condition in campaigns. Requires Playwright (optional dependency, graceful skip if not installed).

SethGammon/Citadel · 56 tokens

live-preview

Mid-build visual verification loop. Takes screenshots of components during construction, not just after. Catches visual regressions and invisible features before they compound. Requires Playwright or similar screenshot tool.

SethGammon/Citadel · 40 tokens

test-gen

Generate and verify tests — happy path, edge cases, error paths — using the project's own framework and patterns.

SethGammon/Citadel · 24 tokens

brooks-sweep

Full-sweep mode: runs a unified analysis across all quality dimensions — code decay, architecture, tech debt, and test quality — then applies fixes directly to the codebase. Safe changes are auto-applied; risky changes are confirmed before execution. Drawing on twelve classic engineering books. Triggers when: user…

hyhmrright/brooks-lint · 178 tokens

brooks-test

Test quality review drawing on twelve classic engineering books — with primary focus on xUnit Test Patterns, The Art of Unit Testing, How Google Tests Software, and Working Effectively with Legacy Code — that diagnoses structural problems in an existing test suite: brittleness, mock abuse, coverage illusions, slow…

hyhmrright/brooks-lint · 161 tokens

software-code-refactoring

Improve production code quality while preserving all existing test behavior. Commonly used for the Refactor phase of TDD red-green-refactor, but applicable to any codebase with tests. Use when production code works but needs cleanup — reducing duplication, improving naming, simplifying complexity, aligning with…

stencila/stencila · 102 tokens