English · 简体中文 · 繁體中文 · 日本語 · Español · Français · العربية · हिन्दी · Português (BR) · Русский · বাংলা
A discipline skill for running long tasks reliably — tasks that either repeat on a schedule (loops) or run until a goal is met (goals).
loop-goal is a single SKILL.md under skills/loop-goal/. Pick your tool below —
it installs into Claude Code, Codex, and GitHub Copilot.
The skills CLI installs the skill —
no clone, no manual copy:
npx skills add lgqyhm2010/loop-goal -a claude-code -a codex -a github-copilot -yDrop any -a … target you don't need. Add -g to install for every project
instead of just the current one.
- As a skill:
npx skills add lgqyhm2010/loop-goal -a claude-code(-gfor global) - As a plugin: in Claude Code, run
/plugin marketplace add lgqyhm2010/loop-goalthen/plugin install loop-goal@lgqyhm2010 - Manually: copy
skills/loop-goal/into.claude/skills/
- As a skill:
npx skills add lgqyhm2010/loop-goal -a codex— installs into.agents/skills/loop-goal/. Project-level install is recommended. - Always-on: copy the pointer from
AGENTS.mdinto your own repo'sAGENTS.md(or~/.codex/AGENTS.md) so the discipline is always loaded.
- As a skill:
npx skills add lgqyhm2010/loop-goal -a github-copilot— installs into.agents/skills/loop-goal/. - Always-on (recommended): copy the pointer from
.github/copilot-instructions.mdinto your own repo's.github/copilot-instructions.md.
Notes. For Codex, prefer a project-level install or the
AGENTS.mdroute — the CLI's global (-g) path (~/.codex/skills/) may not match where Codex reads global skills. For Copilot, the.github/copilot-instructions.mdroute is the most reliable way to keep the discipline always-on.
Once installed, just describe a looping or run-until-done task — the skill triggers on its own (see When it triggers).
Long-running agent tasks fail in three quiet ways:
- Lost progress — conversation context gets compacted and the agent forgets what it already did.
- Polluted context — tool output piles up across iterations, degrading reasoning over a long run.
- No exit — a loop with no written stop condition runs forever.
The fixes are well known (checkpoint to a file, isolate context per iteration, write the exit condition down). The trouble is they rely on the agent remembering to do them — and discipline drifts over a long run. This skill turns the three fixes into enforced rules.
When invoked, the skill:
- Detects the mode — LOOP (time-driven, recurring) vs GOAL (result-driven, run-until-done).
- Mandates a checkpoint file —
.loopgoal/state.jsonholds the single recoverable state; git commits hold history. - Enforces six rules — init with an explicit exit condition, run each iteration in a fresh subagent (context isolation), checkpoint in a fixed order, verify on resume, log decisions, exit cleanly.
It is pure discipline: it writes no code, runs no commands, and
does not wrap /loop or /schedule — it constrains how you run them.
Phrases like "loop", "goal", "keep running", "run in a loop", "until X", "run autonomously" — or their Chinese equivalents "持续做", "每隔", "循环跑", "直到…为止", "自主跑", "跑个 loop" — or an explicit "use the loop-goal skill".
Works in any project. It depends only on built-in tools (Agent, git)
and harness mechanisms (/loop, ScheduleWakeup). The superpowers
plugin is an optional companion, never a requirement.
skills/loop-goal/SKILL.md— the skill itself: mode detection, the checkpoint format, the six rules.skills/loop-goal/templates/state.json— the checkpoint skeleton, copied into a project by rule R1..claude-plugin/— Claude Code plugin + marketplace manifests.AGENTS.md,.github/copilot-instructions.md— thin always-on pointers for Codex and Copilot.DESIGN.md— design rationale and decisions.