loop-engineering

loop-engineering is a skill for Claude Code from huytieu/COG-second-brain. It costs 63 tokens per session (150 once invoked), scanned A, original, MIT.

A reference for building and debugging agent workflows that repeat steps until a task is verified or finished. It covers loops such as search, check, retry, and scan until no work remains.

In plain words
What is it for?
Use it when creating or troubleshooting skills that fetch information, verify results, retry failures, or process items until everything is handled.
Why use it?
It helps make repeated agent work predictable and gives the loop clear checks and stopping conditions.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: reads .claude/ paths; installed under .agents/ (shared by several agents).

Part of the cog-second-brain plugin — 43 skills, 7 commands, 10 agents shipped together

Good fit Use it when creating or troubleshooting skills that fetch information, verify results, retry failures, or process items until everything is handled.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/huytieu/cog-second-brain/loop-engineering
About the project

COG is an AI-assisted second brain that stores knowledge in Markdown files and uses agents, skills, and version control to evolve it over time. It helps people manage knowledge and contacts while supporting several coding-agent tools; the catalogue entries are COG’s skills, agents, instructions, rules, and plugin surfaces.

huytieu/COG-second-brain · 1,315 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.

Any agent
npx skills add huytieu/COG-second-brain --skill loop-engineering
Clone the repo
git clone --depth 1 https://github.com/huytieu/COG-second-brain

Made for: Claude Code.

Or install cog-second-brain, the plugin that ships this one along with the rest of its 43 skills, 7 commands, 10 agents.

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

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/huytieu/cog-second-brain/loop-engineering"><img src="https://agentmods.dev/badge/skills/huytieu/cog-second-brain/loop-engineering.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 63 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 150 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. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 1 finding, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium Agent Snooping · line 6
    Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.
    Fix: Remove all code or instructions that list or read other skills' files or directories. Skills should operate independently; cross-skill access is a privilege escalation.
How audits are shown
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.00063 $0.00150
Opus 5.5 $0.00025 $0.00060
Sonnet 5.5 $0.00013 $0.00030
Haiku 4.5 $0.00006 $0.00015

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

Security

Grade A, and why

loop-engineering 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.

.agents/skills/loop-engineering/SKILL.md · 11 lines

What it actually says

Read .claude/skills/loop-engineering/SKILL.md and execute it exactly as written — that file is the authoritative playbook. Then follow .agents/rules/cog.md.

Antigravity substitution: where the playbook delegates to a .claude/agents/<name> worker, invoke .agents/agents/<name>.md via invoke_subagent instead.

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 · 11 lines · 63 tokens per session scan A 0ee060d9b289

Subscribe to this mod's changes

loop-engineering is a skill published in the GitHub repository huytieu/COG-second-brain (1,315 stars, last pushed yesterday), licensed MIT. It adds 63 tokens to every session and 150 once invoked, about $0.0003 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-30.

Related

Other skills, from other repositories

debugging

Playwright test debugging conventions for the scaffold — reading failure messages, classifying failure modes (TimeoutError, ZodError, strict-mode violation, locator not found, network errors, schema drift), the playwright.config.ts capture defaults (trace on-first-retry, screenshot only-on-failure, video…

idavidov13/agentic-playwright · 179 tokens

investigate

Forensic bug triage — rank suspects via lawbookinvestigate before draft --bug. Use with a stack trace or symptom when starting RCA.

esneiderbravo/speclaw · 33 tokens

test-failure-explorer

Import and query an existing Vitest 3.2 JSON report to explore test failures, file-level errors and original diagnostic evidence.

QwenLM/qwen-code · 32 tokens

diagnose-backend-bug

Diagnose a bounded backend or multi-service failure from GitHub Issues, Jira, Aone, user-provided exports, logs, traces, responses, stack traces, or job records. Use when a service, API, RPC, worker, queue, CLI, or scheduled job bug needs correlation through the project's existing observability route before repair; do…

QoderAI/better-harness · 87 tokens

prismer-python-debugpy

Debug Python: pdb REPL + debugpy remote (DAP).

Prismer-AI/PrismerCloud · 19 tokens

debug-live

Guides root-cause investigations with debugging capabilities by setting breakpoints, starting a debug session, stepping through execution, inspecting variables, and tracing symptoms back to their origin. Prefer it for runtime bugs, failing tests, exceptions, crashes, hangs, wrong/null values, and unexpected output…

microsoft/DebugMCP · 84 tokens