loop-task

loop-task is a command for Claude Code from eshwarvijay/secondmate. It costs 21 tokens per session (904 once invoked), scanned A, original, MIT.

A command that runs a coding task through repeated stages: triage, implementation, verification, and a merge gate.

In plain words
What is it for?
Use it to have a maker agent implement each increment, a separate checker verify it, and the loop continue until the task is done or needs your decision.
Why use it?
It breaks work into checkable increments and avoids treating a complex task as a single unreviewed edit.

Command for Claude Code

Written for Claude Code: argument-hint in frontmatter. Also seen: mentions subagents.

Part of the secondmate plugin — 2 skills, 4 commands, 2 hooks shipped together

Good fit Use it to have a maker agent implement each increment, a separate checker verify it, and the loop continue until the task is done or needs your decision.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/eshwarvijay/secondmate/loop-task
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.

Clone the repo
git clone --depth 1 https://github.com/eshwarvijay/secondmate

Made for: Claude Code.

Or install secondmate, the plugin that ships this one along with the rest of its 2 skills, 4 commands, 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 loop-task

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

Your own site · 80×15
<a href="https://agentmods.dev/commands/eshwarvijay/secondmate/loop-task"><img src="https://agentmods.dev/badge/commands/eshwarvijay/secondmate/loop-task.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 21 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 904 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.00021 $0.00904
Opus 5.5 $0.00008 $0.00362
Sonnet 5.5 $0.00004 $0.00181
Haiku 4.5 $0.00002 $0.00090

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

Security

Grade A, and why

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

commands/loop-task.md · 73 lines

How it starts

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

Loop: $ARGUMENTS

Complete the goal above by running the loop below until an exit condition holds. This is the "loop-engineering" pattern (design the loop, not the prompt): a maker/checker split with a human gate before anything risky. Do NOT one-shot the goal — run the stages.

The loop

Repeat until done or escalate:

  1. Triage. State the goal in one line. Break it into the smallest next increment that can be independently verified. If the goal is already met, say so and stop. If it's ambiguous or you'd be guessing at intent, escalate (ask the user) instead of proceeding.

  2. State. Read any existing state relevant to the goal (repo's .claude/task_state.md if present, prior loop notes, the files involved). After each iteration, jot what changed + what's next so a resumed loop has a spine. Keep it to a few lines — not a document.

  3. Implement. Spawn ONE sub-agent (the maker) to make the increment: Agent(subagent_type: "general-purpose"). If the change touches files that a parallel iteration could also touch, pass isolation: "worktree". The maker returns a diff/summary, not a merged result you assumed.

  4. Verify. Spawn a SEPARATE sub-agent (the checker) to verify — never the same context that made the change. The checker runs the tests/build/lints the repo actually has and reads the diff adversarially: does it meet the goal, did it break anything, is the verification itself real (tests exist and ran)? It returns pass/fail with evidence. On fail, feed the reason back to step 1 and iterate. Verification is the human's responsibility by proxy — a green checker that didn't actually run anything is a failure, not a pass.

  5. Gate. Before any outward-facing or hard-to-reverse action (commit, push, PR, deploy, delete, send, external API write):

    • Safe / explicitly pre-authorized → do it, log what you did.
    • Risky / ambiguous / not authorized → escalate: stop and present the user the diff, the verifier's evidence, and the specific action you want to take. Wait for approval. Do not self-approve.

Read the full file on GitHub · 73 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 · 73 lines · 21 tokens per session scan A 7f2d70df38e8

Subscribe to this mod's changes

loop-task is a command published in the GitHub repository eshwarvijay/secondmate (5 stars, last pushed 3d ago), licensed MIT. It adds 21 tokens to every session and 904 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.