Treadmill: Recurring Command Runner

VerifiedCaution

Run a command on a recurring interval using a background shell loop. Allows polling, periodic tasks, and supervision.

Sby Skills Guide Bot
DevelopmentBeginner
7/25/2026
Claude CodeCursorWindsurfCopilotCodex
#treadmill#recurring-tasks#background-processes#polling#automation

Recommended for

Automated summary

Runs a command or prompt on a recurring interval using a background shell loop.

Strengths

  • Portable across all agent harnesses
  • Detached background processes survive agent restarts
  • Simple start/stop/status interface
  • Pairs with labrat for automated research workflows

Limitations

  • Requires Bash as the underlying tool
  • Not as integrated as native agent loops
  • Does not handle complex scheduling (cron-like)
When to use it

When you need to run a command repeatedly in the background, independent of the agent's lifecycle.

When not to use it

When the agent has a built-in loop (e.g., /loop) or you need more sophisticated scheduling.

Security analysis

Caution
Quality score88/100

The skill provides a legitimate task-scheduling mechanism using Bash scripts. It does not itself contain destructive or exfiltrating instructions, but it enables the execution of arbitrary commands repeatedly in the background, which requires caution. The risk is acceptable for a development tool.

Findings
  • •Runs arbitrary user-supplied commands in a background loop
  • •Stores command and state in .treadmill/ directory, which could be inspected by other processes
  • •Could be used to execute persistent potentially harmful operations if misused
How this analysis is made

Examples

Check research status every 5 minutes
Start a treadmill to run python .research/experiments/00-baseline/modal_app.py every 5 minutes.
Poll a deployment health endpoint
Start a treadmill to curl https://api.example.com/health every 2 minutes.
Run metrics script hourly
Start a treadmill to run python check_metrics.py every hour.

name: treadmill description: "Run a command or prompt on a recurring interval, like a lab rat on a wheel. Use when the user wants to poll, repeat a task periodically, set up a recurring check, or keep a long-running process supervised. Pairs with /labrat for overnight research sessions." license: Apache-2.0 compatibility: "Requires bash. Works on macOS and Linux." metadata: author: tau version: "1.0" allowed-tools: Bash

Treadmill

Run a command on a recurring interval using a background shell loop. Portable across all agent harnesses.

How to use

The bundled treadmill script handles start/stop/status. Set it up from the skill directory:

SKILL_DIR="$(cd "$(dirname "$0")" && pwd)"
export PATH="${SKILL_DIR}/scripts:$PATH"

Or reference it directly: bash ${CLAUDE_SKILL_DIR}/scripts/treadmill

Start a treadmill

treadmill start <interval> <command...>

Interval formats: 30s, 5m, 1h, or plain seconds (e.g. 300).

Examples:

# Check research status every 5 minutes
treadmill start 5m python .research/experiments/00-baseline/modal_app.py

# Poll a deployment
treadmill start 2m curl -s https://api.example.com/health

# Run a script every hour
treadmill start 1h python check_metrics.py

Stop

treadmill stop

Check status

treadmill status

View logs

treadmill log      # last 30 lines
treadmill log 100  # last 100 lines

State

Treadmill keeps its state in .treadmill/ in the current directory:

  • pid — PID of the background loop
  • config — interval, command, start time
  • log — stdout/stderr from each run

Pairing with labrat

For overnight ML research, start a treadmill that re-runs the labrat state-advance worker rather than a passive status printer:

# Reconcile state every 5 minutes
treadmill start 5m python /path/to/labrat/scripts/research-advance

Use research-status only for human-readable inspection. Use research-advance for automation, because it updates .research/state.json when artifacts appear.

If the harness is Codex, prefer the supervisor wrapper instead:

# Reconcile state, then wake Codex when the session is actionable
treadmill start 5m python /path/to/labrat/scripts/research-supervise

That wrapper gives you the missing /loop behavior: the background loop notices finished artifacts, updates .research/state.json, and only then starts a fresh non-interactive Codex run to do the next research step.

The agent can read treadmill logs to see what happened between invocations.

When to use this vs built-in loop

Some agent tools (like Claude Code) have a built-in /loop command. Use that when available. Use /treadmill when:

  • Your agent harness doesn't have a built-in loop
  • You want a detached background process that survives agent restarts
  • You need to run shell commands on a timer independent of the agent

From the file to a first result

The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.

View the source and supporting files

This download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.

1. Download the file

Download SKILL.md

From the root of a test project, save the file as .skill-downloads/treadmill-recurring-command-runner-mrx3xxjn/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.

Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.

mkdir -p '.skill-downloads/treadmill-recurring-command-runner-mrx3xxjn' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/treadmill-recurring-command-runner-mrx3xxjn/download' --output '.skill-downloads/treadmill-recurring-command-runner-mrx3xxjn/SKILL.md.part' && mv '.skill-downloads/treadmill-recurring-command-runner-mrx3xxjn/SKILL.md.part' '.skill-downloads/treadmill-recurring-command-runner-mrx3xxjn/SKILL.md'

2. Check prerequisites

Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.

Environment declared by the author: Requires bash. Works on macOS and Linux.

Tools declared by the author (check availability in your agent): Bash

No recognized prerequisites section in this file. This does not mean it is self-contained: libraries, tools and access requirements may be mentioned elsewhere in the content or source repository.

The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.

3. Load the skill

After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.

Claude Code
test -f '.skill-downloads/treadmill-recurring-command-runner-mrx3xxjn/SKILL.md' && test -s '.skill-downloads/treadmill-recurring-command-runner-mrx3xxjn/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/treadmill' && cp -R '.skill-downloads/treadmill-recurring-command-runner-mrx3xxjn' '.claude/skills/treadmill'

Cursor
test -f '.skill-downloads/treadmill-recurring-command-runner-mrx3xxjn/SKILL.md' && test -s '.skill-downloads/treadmill-recurring-command-runner-mrx3xxjn/SKILL.md' && mkdir -p '.cursor/skills' && test ! -e '.cursor/skills/treadmill' && cp -R '.skill-downloads/treadmill-recurring-command-runner-mrx3xxjn' '.cursor/skills/treadmill'

Codex
test -f '.skill-downloads/treadmill-recurring-command-runner-mrx3xxjn/SKILL.md' && test -s '.skill-downloads/treadmill-recurring-command-runner-mrx3xxjn/SKILL.md' && mkdir -p '.agents/skills' && test ! -e '.agents/skills/treadmill' && cp -R '.skill-downloads/treadmill-recurring-command-runner-mrx3xxjn' '.agents/skills/treadmill'

OpenSkills

OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.

Official OpenSkills installation
openskills install './.skill-downloads/treadmill-recurring-command-runner-mrx3xxjn'

openskills read 'treadmill-recurring-command-runner-mrx3xxjn'

Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.

For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.

openskills sync

Manual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.

4. Try a first task

Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:

Read .skill-downloads/treadmill-recurring-command-runner-mrx3xxjn/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.

Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.

Related skills