# Repeat With Delay

> Execute repeated shell commands as separate tool calls with a delay between each iteration. Use when a user asks to run something N times, wait between runs, increment a counter each cycle, and see each iteration result before the next run. Use when this capability is needed.

- Skill: `tomevault-io/repeat-with-delay` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add tomevault-io/repeat-with-delay`
- Raw SKILL.md: https://api.skillmd.com/api/skills/tomevault-io/repeat-with-delay/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: tomevault-io (https://skillmd.com/u/tomevault-io)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/tomevault-io/repeat-with-delay

---


# Repeat With Delay

Run one command at a time as individual tool calls so each iteration is visible in the transcript.

## Required Execution Model

1. Determine loop parameters from the request:
- `iterations` (default `10`)
- `delay-seconds` (default `2`)
- `start` (default `1`)
- `command` (default `echo "$LOOP_COUNTER"`)

2. Execute iterations sequentially using separate tool calls:
- For each iteration, run one command tool call.
- Export the loop counter to that single call:
```bash
LOOP_COUNTER=<value> bash -lc '<command using $LOOP_COUNTER>'
```
- Show that tool call result before continuing.

3. If not on the final iteration and delay is greater than zero, run a separate sleep tool call:
```bash
sleep <delay-seconds>
```

4. Continue until iteration `N` is done. Do not batch iterations into one shell loop when the user wants per-iteration visibility.

## Example Mapping

For "run 10 times and delay for 2 seconds between each", execute:
- 10 separate command tool calls (`LOOP_COUNTER=1` to `LOOP_COUNTER=10`)
- 9 separate sleep tool calls (`sleep 2`) between runs

For "echo a number starting at 1 and increment each time":
```bash
LOOP_COUNTER=1 bash -lc 'echo "$LOOP_COUNTER"'
LOOP_COUNTER=2 bash -lc 'echo "$LOOP_COUNTER"'
...
```

## Notes

- Keep loop execution sequential; do not parallelize iterations unless explicitly requested.
- Preserve command failures; if one iteration fails, stop and report the failing iteration.
- Optional fallback script exists at `scripts/run_repeat_with_delay.sh`, but use it only if the user explicitly asks for one single wrapper command.

---
> Converted and distributed by [TomeVault](https://tomevault.io/claim/rebornix) — claim your Tome and manage your conversions.
<!-- tomevault:4.0:skill_md:2026-04-11 -->

