Help us improve
Share bugs, ideas, or general feedback.
From claude-commands
Defines goals with measurable success criteria and runs an autonomous convergence loop until goals are met or limits reached.
npx claudepluginhub jleechanorg/claude-commands --plugin claude-commandsHow this skill is triggered — by the user, by Claude, or both
Slash command
/claude-commands:goalexecThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Define a goal with measurable success criteria and run an autonomous convergence loop (plan→execute→validate→decide) until success criteria are met or convergence limits are reached.
Parses a goal statement, extracts measurable success criteria, and saves them to a file without executing. Use to define goals for later execution.
Executes durable, contract-driven goals with checkpoint validation and judge-gated completion. Useful for multi-turn autonomous tasks that need structured progress tracking.
Auto-loop execution workflow with quality gates. Use when starting any non-trivial implementation task. Provides automatic task decomposition, code implementation, testing (L1-L4), and iterative quality gates until completion. Invoke with /autoworker.
Share bugs, ideas, or general feedback.
Define a goal with measurable success criteria and run an autonomous convergence loop (plan→execute→validate→decide) until success criteria are met or convergence limits are reached.
/goalexec "Fix the rewards latency issue" # define + start immediate loop
/goalexec "Fix rewards" --cron 30m # define + schedule recurring loop
/goalexec --validate # check status, no loop
/goalexec --current # show active goal + criteria
/goalexec --clear # clear active goal
Parse arguments to determine mode:
--cron <duration> → scheduled mode (recurring loop)--validate → validation only--current → display only--clear → cleanup onlyCRITICAL: /goalexec must detect which agent runtime it's in and use the native looping mechanism.
Three tiers, tried in order:
| Tier | Condition | Mechanism | Works in |
|---|---|---|---|
| 1 | CronCreate tool available | /loop <duration> /goalexec --validate or CronCreate | Claude Code |
| 2 | cmux running (socket exists at /tmp/cmux*.sock) | scripts/goalexec-loop-cmux.sh --install (launchd + cmux reinjection) | Any agent in cmux (opencode, claude, etc.) |
| 3 | No CronCreate, no cmux | scripts/goalexec-loop.sh --goal "..." (bash while-loop + CLI) | Any terminal |
Detection logic:
CronCreate tool → Tier 1 (Claude Code native)/tmp/cmux-debug*.sock or /tmp/cmux.sock exists → Tier 2 (cmux reinjection)goals/ directory exists (mkdir -p goals/)goals/.current-goal exists, warn and ask before overwritinggoals/.current-goal (flat file, single active goal):
# Goal
<original statement>
## Success Criteria
1. <criterion>
2. <criterion>
...
## Session State
- Iteration: 0
- Last score: 0%
- Status: DEFINED
For immediate mode, run iterative cycle:
score = (met criteria / total criteria) × 100
A criterion is "met" if its validation check passes (file exists with correct content, test exit code = 0, PR state = MERGED, etc.).
--cron)Tier 1: Claude Code — use /loop or CronCreate:
/loop <duration> /goalexec --validate
Or:
CronCreate with cron="*/<minutes> * * * *" (every N minutes)
prompt="/goalexec --validate"
recurring=true
Tier 2: cmux reinjection (any agent in a cmux pane) — use launchd + cmux:
scripts/goalexec-loop-cmux.sh --install --goal "<goal text>" --interval 5m
This is the same pattern as scripts/monitoring/worldarchitect-ao-eloop.sh:
~/.goalexec-loop/cmux-target.env/goalexec --validate into the coder pane# Commands
scripts/goalexec-loop-cmux.sh --install --goal "Fix lint errors" --interval 10m --max-iterations 15
scripts/goalexec-loop-cmux.sh --status # check loop status
scripts/goalexec-loop-cmux.sh --uninstall # stop and remove launchd agent
scripts/goalexec-loop-cmux.sh --cmux-detect # detect cmux target and exit
Tier 3: bash CLI loop (no cmux, any terminal) — use scripts/goalexec-loop.sh:
scripts/goalexec-loop.sh --goal "<goal text>" --interval <seconds>
The bash script auto-detects which CLI to call (opencode run or claude -p) and runs a real while-loop:
/goalexec --validate each iterationgoals/.current-goal for convergence status# Commands
scripts/goalexec-loop.sh --goal "Fix lint errors" --interval 120 --max-iterations 15
scripts/goalexec-loop.sh --validate
scripts/goalexec-loop.sh --current
scripts/goalexec-loop.sh --clear
scripts/goalexec-loop.sh --dry-run --goal "test"
Important: ScheduleCron does NOT exist in any agent. The correct Claude Code tool is CronCreate.
goals/.current-goalgh pr viewGoal Validation Report
Goal: <statement>
Status: CONVERGING (67% - 2/3 criteria)
Criteria:
1. ✅ <criterion> — <evidence>
2. 🔄 <criterion> — <partial evidence>
3. ❌ <criterion> — <failure reason>
Next: <specific steps to address remaining>
Read and display goals/.current-goal with all criteria.
Remove goals/.current-goal and any session state.
Single flat file goals/.current-goal stores:
| Goal phrase | Criterion |
|---|---|
| "Create X" | X exists with correct content |
| "Fix Y" | Y no longer fails |
| "PR merged" | PR state = MERGED |
| "All tests pass" | Test exit code = 0 |
| "Implement Z" | Z works as specified |