loop-worker

An instruction set for an autonomous worker that drains a project workstream, meaning a group of tracked milestones, from start to finish. It selects pending milestones, implements them, ships each one, and continues until the workstream is empty or blocked.

In plain words
What is it for?
Use it with a named workstream to process its pending milestones sequentially, implement each task, and ship the results.
Why use it?
It removes the need to repeatedly choose the next task and manually coordinate implementation and delivery. It also requires checks for the correct branch, existing changes, and the expected workstream files.

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/bex-co/bex-security/loop-worker
Any agent
npx skills add bex-co/bex-security --skill loop-worker
Clone the repo
git clone --depth 1 https://github.com/bex-co/bex-security

Made for: Claude Code, Codex.

Per session 86 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,375 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00086 $0.01375
Opus 5 $0.00043 $0.00687
Sonnet 5 $0.00017 $0.00275
Haiku 4.5 $0.00009 $0.00137

Measured 2d ago against content hash a5dec1f1aa5a, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

loop-worker 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 2d 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.

.claude/skills/loop-worker/SKILL.md · 67 lines

How it starts

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

Task: Drain a .pm workstream milestone by milestone

/loop-worker <wN> — repeatedly pick the next pending milestone in workstream <wN>, implement it fully, /ship it, and continue to the next, until the workstream has no pending milestones left (or a milestone genuinely blocks). This is a long-running autonomous loop over the .pm board; it composes /pm (board reads/writes), your own implementation work, and /ship.

Parse the target workstream from $ARGUMENTS (e.g. w1). If $ARGUMENTS is empty, STOP and ask which workstream to drain — never guess.

Preconditions (verify once, up front)

  1. git branch --show-current is main. If not, STOP and ask (same rule as /ship).
  2. git status — note pre-existing uncommitted changes. Do not sweep unrelated changes into a milestone's ship; if the tree is dirty with work you didn't do, surface it and ask before starting.
  3. The workstream .pm/<wN>/README.md exists. If not, STOP and report.

The loop

Repeat until the exit condition below:

1. Pick the next pending milestone

Read .pm/<wN>/README.md. In the ## Milestones list, pending milestones are the unchecked ones (- [ ] **mN**). Pick the lowest-numbered pending milestone that still has a live directory (.pm/<wN>/mN/, not under done/). Cross-check by listing .pm/<wN>/m*/ and its done/ folder — the checkbox and the on-disk state must agree; if they disagree, trust the task files and flag the drift.

If there are no pending milestones, go to Exit.

Announce which milestone you picked and give a one-line plan before doing work.

2. Understand the milestone

Read .pm/<wN>/mN/README.md and every task file .pm/<wN>/mN/tNNN.md (skip any already in done/). These define the scope, order, and acceptance. Milestones ship features end to end — include the SDK, docs, and container tasks alongside the CLI ones; do not stop at the code. Respect .pm/DO_NOT_DO.md and the milestone's own acceptance criteria.

Read the full file on GitHub · 67 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. 2d ago First seen · 67 lines · 86 tokens per session scan A a5dec1f1aa5a

Subscribe to this mod's changes

loop-worker is a skill published in the GitHub repository bex-co/bex-security (40 stars, last pushed 3d ago), licensed Apache-2.0. It adds 86 tokens to every session and 1,375 once invoked, about $0.0004 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-30.