/ctx:ctx-loopfrom ctx
Generates a shell script for running AI tools in autonomous iteration loops. Useful for unattended headless agent runs and CI-driven AI workflows.
Ships in ctx. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Generate a ready-to-use autonomous loop shell script.
loop.sh in the
project root; confirm before overwritingPROMPT.md; if missing, ask the user what prompt file
to usectx init first if neededPROMPT.md (set
those up first with ctx init --ralph)/ctx-loop
/ctx-loop --tool aider
/ctx-loop --prompt TASKS.md --max-iterations 10
/ctx-loop --completion SYSTEM_BLOCKED --output my-loop.sh
| Flag | Short | Default | Purpose |
|---|---|---|---|
--prompt | -p | PROMPT.md | Prompt file the loop reads |
--tool | -t | claude | AI tool: claude, aider, generic |
--max-iterations | -n | 0 (unlimited) | Stop after N iterations |
--completion | -c | SYSTEM_CONVERGED | Signal that ends the loop |
--output | -o | loop.sh | Output script filename |
| Tool | Command generated |
|---|---|
claude | claude --print "$(cat <prompt>)" |
aider | aider --message-file <prompt> |
generic | Template stub for custom AI CLI |
The loop watches AI output for these signals:
| Signal | Meaning |
|---|---|
SYSTEM_CONVERGED | All tasks complete; loop exits |
SYSTEM_BLOCKED | Needs human input; loop exits |
BOOTSTRAP_COMPLETE | Initial scaffolding done; loop exits |
ctx loop $ARGUMENTS
The command writes a shell script (default loop.sh) and makes
it executable. Report the generated path and how to run it:
chmod +x loop.sh # already done by ctx loop
./loop.sh
set -e and a 1-second sleep
between iterations to prevent runaway loops--max-iterations is strongly recommended for first runs;
suggest a reasonable default (e.g., 10) if the user omits it|| true so one
failed iteration does not kill the loopBefore reporting success, verify:
--max-iterations 0, user is aware it runs until
a completion signal (warn them)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub activememory/ctx --plugin ctx54 skills in this plugin
/ctx-agentLoad full context packet. Use at session start or when context seems stale or incomplete./ctx-architectureBuild and maintain architecture maps. Use to create or refresh ARCHITECTURE.md and DETAILED_DESIGN.md. Supports principal mode for deeper analysis: vision, future direction, bottlenecks, implementation alternatives, gaps, upstream proposals, and intervention points./ctx-architecture-enrichEnrich architecture artifacts with code intelligence data. Takes existing /ctx-architecture output as baseline, verifies and quantifies with GitNexus MCP (blast radius, execution flows, domain clustering, registration sites). Run after /ctx-architecture, not instead of it./ctx-archiveArchive completed tasks. Use when TASKS.md has many completed items cluttering the view.Other plugins' skills for the same job