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.
npx agentmods add commands/eshwarvijay/secondmate/loop-taskgit clone --depth 1 https://github.com/eshwarvijay/secondmateWhat 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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00021 | $0.00904 |
| Opus 5 | $0.00010 | $0.00452 |
| Sonnet 5 | $0.00004 | $0.00181 |
| Haiku 4.5 | $0.00002 | $0.00090 |
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 yesterday.
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.
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:
-
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.
-
State. Read any existing state relevant to the goal (repo's
.claude/task_state.mdif 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. -
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, passisolation: "worktree". The maker returns a diff/summary, not a merged result you assumed. -
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.
-
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.
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.
- yesterday First seen · 73 lines · 21 tokens per session scan A 7f2d70df38e8
loop-task is a command published in the GitHub repository eshwarvijay/secondmate (3 stars, last pushed 5d ago), licensed MIT. It adds 21 tokens to every session and 904 once invoked, about $0.0001 per session on Opus 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.
Other commands, from other repositories
send
Send a message to a running agent session. Use this to correct or direct a live agent mid-stream without killing and respawning it.
test-feature
Test a React Native feature on the running simulator/emulator. Verifies UI, user flows, and internal state. Generates a persistent Maestro test file.
dispatcher
Pick the next-best repo to work on across the portfolio — rank free repos, recommend one, claim its lease atomically, and route to the entry command.
journey-audit
Outside-in product audit as a deep session — 7 read-only roles check what the site promises against what the code does, what a user experiences, what arrives by mail, and what the data says is used. Writes a dossier; needs a per-repo journey-manifest.
brain-stats
Show claudectl brain learning metrics — accuracy, correction rate, and effectiveness.
cost-tracker
Track session costs, understand token spend, and get optimization tips.